Class: GetCollectionsCollectionIDRequestsRequestIDResponse404Error

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



7860
7861
7862
7863
7864
7865
7866
7867
# File 'lib/schemas.rb', line 7860

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

.from_json!(json) ⇒ Object



7869
7870
7871
# File 'lib/schemas.rb', line 7869

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

Instance Method Details

#to_dynamicObject



7873
7874
7875
7876
7877
7878
7879
# File 'lib/schemas.rb', line 7873

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

#to_json(options = nil) ⇒ Object



7881
7882
7883
# File 'lib/schemas.rb', line 7881

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