Class: DeleteMonitorsMonitorIDResponse429

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



3369
3370
3371
3372
3373
3374
3375
# File 'lib/schemas.rb', line 3369

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

.from_json!(json) ⇒ Object



3377
3378
3379
# File 'lib/schemas.rb', line 3377

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

Instance Method Details

#to_dynamicObject



3381
3382
3383
3384
3385
3386
# File 'lib/schemas.rb', line 3381

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

#to_json(options = nil) ⇒ Object



3388
3389
3390
# File 'lib/schemas.rb', line 3388

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