Class: PutCollectionsCollectionIDRequestsRequestIDResponse400Error

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



30262
30263
30264
30265
30266
30267
30268
30269
# File 'lib/schemas.rb', line 30262

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

.from_json!(json) ⇒ Object



30271
30272
30273
# File 'lib/schemas.rb', line 30271

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

Instance Method Details

#to_dynamicObject



30275
30276
30277
30278
30279
30280
30281
# File 'lib/schemas.rb', line 30275

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

#to_json(options = nil) ⇒ Object



30283
30284
30285
# File 'lib/schemas.rb', line 30283

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