Class: PostMonitorsResponse500

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



25912
25913
25914
25915
25916
25917
# File 'lib/schemas.rb', line 25912

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

.from_json!(json) ⇒ Object



25919
25920
25921
# File 'lib/schemas.rb', line 25919

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

Instance Method Details

#to_dynamicObject



25923
25924
25925
25926
25927
# File 'lib/schemas.rb', line 25923

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

#to_json(options = nil) ⇒ Object



25929
25930
25931
# File 'lib/schemas.rb', line 25929

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