Class: DeleteCollectionsCollectionIDResponsesResponseIDResponse404Error

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



1828
1829
1830
1831
1832
1833
1834
1835
# File 'lib/schemas.rb', line 1828

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

.from_json!(json) ⇒ Object



1837
1838
1839
# File 'lib/schemas.rb', line 1837

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

Instance Method Details

#to_dynamicObject



1841
1842
1843
1844
1845
1846
1847
# File 'lib/schemas.rb', line 1841

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

#to_json(options = nil) ⇒ Object



1849
1850
1851
# File 'lib/schemas.rb', line 1849

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