Class: PostMonitorsResponse500Error

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



25885
25886
25887
25888
25889
25890
25891
# File 'lib/schemas.rb', line 25885

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

.from_json!(json) ⇒ Object



25893
25894
25895
# File 'lib/schemas.rb', line 25893

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

Instance Method Details

#to_dynamicObject



25897
25898
25899
25900
25901
25902
# File 'lib/schemas.rb', line 25897

def to_dynamic
  {
    "message" => message,
    "name"    => post_monitors_response500_error_name,
  }
end

#to_json(options = nil) ⇒ Object



25904
25905
25906
# File 'lib/schemas.rb', line 25904

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