Class: PutMocksMockIDResponse401

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



32687
32688
32689
32690
32691
32692
# File 'lib/schemas.rb', line 32687

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

.from_json!(json) ⇒ Object



32694
32695
32696
# File 'lib/schemas.rb', line 32694

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

Instance Method Details

#to_dynamicObject



32698
32699
32700
32701
32702
# File 'lib/schemas.rb', line 32698

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

#to_json(options = nil) ⇒ Object



32704
32705
32706
# File 'lib/schemas.rb', line 32704

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