Class: DeleteCollectionsCollectionIDResponse404Error

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



1467
1468
1469
1470
1471
1472
1473
1474
# File 'lib/schemas.rb', line 1467

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

.from_json!(json) ⇒ Object



1476
1477
1478
# File 'lib/schemas.rb', line 1476

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

Instance Method Details

#to_dynamicObject



1480
1481
1482
1483
1484
1485
1486
# File 'lib/schemas.rb', line 1480

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

#to_json(options = nil) ⇒ Object



1488
1489
1490
# File 'lib/schemas.rb', line 1488

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