Class: PostMonitorsResponse400

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



25709
25710
25711
25712
25713
25714
# File 'lib/schemas.rb', line 25709

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

.from_json!(json) ⇒ Object



25716
25717
25718
# File 'lib/schemas.rb', line 25716

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

Instance Method Details

#to_dynamicObject



25720
25721
25722
25723
25724
# File 'lib/schemas.rb', line 25720

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

#to_json(options = nil) ⇒ Object



25726
25727
25728
# File 'lib/schemas.rb', line 25726

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