Class: PutCollectionsCollectionIDResponsesResponseIDResponse404Error

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



31375
31376
31377
31378
31379
31380
31381
31382
# File 'lib/schemas.rb', line 31375

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

.from_json!(json) ⇒ Object



31384
31385
31386
# File 'lib/schemas.rb', line 31384

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

Instance Method Details

#to_dynamicObject



31388
31389
31390
31391
31392
31393
31394
# File 'lib/schemas.rb', line 31388

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

#to_json(options = nil) ⇒ Object



31396
31397
31398
# File 'lib/schemas.rb', line 31396

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