Class: GetMonitorsResponse401

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



13124
13125
13126
13127
13128
13129
# File 'lib/schemas.rb', line 13124

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

.from_json!(json) ⇒ Object



13131
13132
13133
# File 'lib/schemas.rb', line 13131

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

Instance Method Details

#to_dynamicObject



13135
13136
13137
13138
13139
# File 'lib/schemas.rb', line 13135

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

#to_json(options = nil) ⇒ Object



13141
13142
13143
# File 'lib/schemas.rb', line 13141

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