Class: PatchCollectionsCollectionIDResponse404Error

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



18251
18252
18253
18254
18255
18256
18257
18258
# File 'lib/schemas.rb', line 18251

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

.from_json!(json) ⇒ Object



18260
18261
18262
# File 'lib/schemas.rb', line 18260

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

Instance Method Details

#to_dynamicObject



18264
18265
18266
18267
18268
18269
18270
# File 'lib/schemas.rb', line 18264

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

#to_json(options = nil) ⇒ Object



18272
18273
18274
# File 'lib/schemas.rb', line 18272

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