Class: PutCollectionsCollectionIDRequestsRequestIDResponse401Error

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



30361
30362
30363
30364
30365
30366
30367
30368
# File 'lib/schemas.rb', line 30361

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    details:                                                                  d["details"] ? PutCollectionsCollectionIDRequestsRequestIDResponse401ErrorDetails.from_dynamic!(d["details"]) : nil,
    message:                                                                  d["message"],
    put_collections_collection_id_requests_request_id_response401_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



30370
30371
30372
# File 'lib/schemas.rb', line 30370

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

Instance Method Details

#to_dynamicObject



30374
30375
30376
30377
30378
30379
30380
# File 'lib/schemas.rb', line 30374

def to_dynamic
  {
    "details" => details&.to_dynamic,
    "message" => message,
    "name"    => put_collections_collection_id_requests_request_id_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



30382
30383
30384
# File 'lib/schemas.rb', line 30382

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