Class: DeleteCollectionsCollectionIDRequestsRequestIDResponse404Error

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



1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/schemas.rb', line 1220

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

.from_json!(json) ⇒ Object



1229
1230
1231
# File 'lib/schemas.rb', line 1229

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

Instance Method Details

#to_dynamicObject



1233
1234
1235
1236
1237
1238
1239
# File 'lib/schemas.rb', line 1233

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

#to_json(options = nil) ⇒ Object



1241
1242
1243
# File 'lib/schemas.rb', line 1241

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