Class: PostMocksMockIDServerResponsesResponse400

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



24332
24333
24334
24335
24336
24337
# File 'lib/schemas.rb', line 24332

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

.from_json!(json) ⇒ Object



24339
24340
24341
# File 'lib/schemas.rb', line 24339

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

Instance Method Details

#to_dynamicObject



24343
24344
24345
24346
24347
# File 'lib/schemas.rb', line 24343

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

#to_json(options = nil) ⇒ Object



24349
24350
24351
# File 'lib/schemas.rb', line 24349

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