Class: PutMocksMockIDServerResponsesServerResponseIDResponse429

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



33119
33120
33121
33122
33123
33124
33125
# File 'lib/schemas.rb', line 33119

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

.from_json!(json) ⇒ Object



33127
33128
33129
# File 'lib/schemas.rb', line 33127

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

Instance Method Details

#to_dynamicObject



33131
33132
33133
33134
33135
33136
# File 'lib/schemas.rb', line 33131

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

#to_json(options = nil) ⇒ Object



33138
33139
33140
# File 'lib/schemas.rb', line 33138

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