Class: PutCollectionsCollectionIDRequestsRequestIDResponse401

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



30390
30391
30392
30393
30394
30395
# File 'lib/schemas.rb', line 30390

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

.from_json!(json) ⇒ Object



30397
30398
30399
# File 'lib/schemas.rb', line 30397

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

Instance Method Details

#to_dynamicObject



30401
30402
30403
30404
30405
# File 'lib/schemas.rb', line 30401

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

#to_json(options = nil) ⇒ Object



30407
30408
30409
# File 'lib/schemas.rb', line 30407

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