Class: PostMonitorsResponse400Error

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



25680
25681
25682
25683
25684
25685
25686
25687
# File 'lib/schemas.rb', line 25680

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    details:                              d["details"],
    message:                              d["message"],
    post_monitors_response400_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



25689
25690
25691
# File 'lib/schemas.rb', line 25689

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

Instance Method Details

#to_dynamicObject



25693
25694
25695
25696
25697
25698
25699
# File 'lib/schemas.rb', line 25693

def to_dynamic
  {
    "details" => details,
    "message" => message,
    "name"    => post_monitors_response400_error_name,
  }
end

#to_json(options = nil) ⇒ Object



25701
25702
25703
# File 'lib/schemas.rb', line 25701

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