Class: PutMocksMockIDResponse404

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



32749
32750
32751
32752
32753
32754
# File 'lib/schemas.rb', line 32749

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

.from_json!(json) ⇒ Object



32756
32757
32758
# File 'lib/schemas.rb', line 32756

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

Instance Method Details

#to_dynamicObject



32760
32761
32762
32763
32764
# File 'lib/schemas.rb', line 32760

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

#to_json(options = nil) ⇒ Object



32766
32767
32768
# File 'lib/schemas.rb', line 32766

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