Class: GetMonitorsMonitorIDResponse429

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



12941
12942
12943
12944
12945
12946
12947
# File 'lib/schemas.rb', line 12941

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

.from_json!(json) ⇒ Object



12949
12950
12951
# File 'lib/schemas.rb', line 12949

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

Instance Method Details

#to_dynamicObject



12953
12954
12955
12956
12957
12958
# File 'lib/schemas.rb', line 12953

def to_dynamic
  {
    "error"   => error,
    "message" => message,
  }
end

#to_json(options = nil) ⇒ Object



12960
12961
12962
# File 'lib/schemas.rb', line 12960

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