Class: GetMonitorsMonitorIDResponse401

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



12854
12855
12856
12857
12858
12859
# File 'lib/schemas.rb', line 12854

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

.from_json!(json) ⇒ Object



12861
12862
12863
# File 'lib/schemas.rb', line 12861

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

Instance Method Details

#to_dynamicObject



12865
12866
12867
12868
12869
# File 'lib/schemas.rb', line 12865

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

#to_json(options = nil) ⇒ Object



12871
12872
12873
# File 'lib/schemas.rb', line 12871

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