Class: GetMonitorsMonitorIDResponse404

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



12911
12912
12913
12914
12915
12916
# File 'lib/schemas.rb', line 12911

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

.from_json!(json) ⇒ Object



12918
12919
12920
# File 'lib/schemas.rb', line 12918

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

Instance Method Details

#to_dynamicObject



12922
12923
12924
12925
12926
# File 'lib/schemas.rb', line 12922

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

#to_json(options = nil) ⇒ Object



12928
12929
12930
# File 'lib/schemas.rb', line 12928

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