Class: PutMocksMockIDServerResponsesServerResponseIDResponse401

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



33089
33090
33091
33092
33093
33094
# File 'lib/schemas.rb', line 33089

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

.from_json!(json) ⇒ Object



33096
33097
33098
# File 'lib/schemas.rb', line 33096

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

Instance Method Details

#to_dynamicObject



33100
33101
33102
33103
33104
# File 'lib/schemas.rb', line 33100

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

#to_json(options = nil) ⇒ Object



33106
33107
33108
# File 'lib/schemas.rb', line 33106

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