Class: GetMocksMockIDResponse500

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



11458
11459
11460
11461
11462
11463
# File 'lib/schemas.rb', line 11458

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

.from_json!(json) ⇒ Object



11465
11466
11467
# File 'lib/schemas.rb', line 11465

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

Instance Method Details

#to_dynamicObject



11469
11470
11471
11472
11473
# File 'lib/schemas.rb', line 11469

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

#to_json(options = nil) ⇒ Object



11475
11476
11477
# File 'lib/schemas.rb', line 11475

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