Class: PutMocksMockIDServerResponsesServerResponseIDResponse500

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



33178
33179
33180
33181
33182
33183
# File 'lib/schemas.rb', line 33178

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

.from_json!(json) ⇒ Object



33185
33186
33187
# File 'lib/schemas.rb', line 33185

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

Instance Method Details

#to_dynamicObject



33189
33190
33191
33192
33193
# File 'lib/schemas.rb', line 33189

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

#to_json(options = nil) ⇒ Object



33195
33196
33197
# File 'lib/schemas.rb', line 33195

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