Class: PostMonitorsMonitorIDRunResponse401

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



25502
25503
25504
25505
25506
25507
# File 'lib/schemas.rb', line 25502

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    error: d["error"] ? PostMonitorsMonitorIDRunResponse401Error.from_dynamic!(d["error"]) : nil,
  )
end

.from_json!(json) ⇒ Object



25509
25510
25511
# File 'lib/schemas.rb', line 25509

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



25513
25514
25515
25516
25517
# File 'lib/schemas.rb', line 25513

def to_dynamic
  {
    "error" => error&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



25519
25520
25521
# File 'lib/schemas.rb', line 25519

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end