Class: GetCollectionsCollectionIDRequestsRequestIDResponse401Error

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



7761
7762
7763
7764
7765
7766
7767
7768
# File 'lib/schemas.rb', line 7761

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

.from_json!(json) ⇒ Object



7770
7771
7772
# File 'lib/schemas.rb', line 7770

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

Instance Method Details

#to_dynamicObject



7774
7775
7776
7777
7778
7779
7780
# File 'lib/schemas.rb', line 7774

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

#to_json(options = nil) ⇒ Object



7782
7783
7784
# File 'lib/schemas.rb', line 7782

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