Class: PutCollectionsCollectionIDResponse404Error

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



30829
30830
30831
30832
30833
30834
30835
30836
# File 'lib/schemas.rb', line 30829

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

.from_json!(json) ⇒ Object



30838
30839
30840
# File 'lib/schemas.rb', line 30838

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

Instance Method Details

#to_dynamicObject



30842
30843
30844
30845
30846
30847
30848
# File 'lib/schemas.rb', line 30842

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

#to_json(options = nil) ⇒ Object



30850
30851
30852
# File 'lib/schemas.rb', line 30850

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