Class: DeleteCollectionsCollectionIDResponsesResponseIDResponse

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



1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/schemas.rb', line 1653

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data:                                                                 d["data"] ? DeleteCollectionsCollectionIDResponsesResponseIDResponseData.from_dynamic!(d["data"]) : nil,
    delete_collections_collection_id_responses_response_id_response_meta: d["meta"],
    model_id:                                                             d["model_id"],
    revision:                                                             d["revision"],
  )
end

.from_json!(json) ⇒ Object



1663
1664
1665
# File 'lib/schemas.rb', line 1663

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

Instance Method Details

#to_dynamicObject



1667
1668
1669
1670
1671
1672
1673
1674
# File 'lib/schemas.rb', line 1667

def to_dynamic
  {
    "data"     => data&.to_dynamic,
    "meta"     => delete_collections_collection_id_responses_response_id_response_meta,
    "model_id" => model_id,
    "revision" => revision,
  }
end

#to_json(options = nil) ⇒ Object



1676
1677
1678
# File 'lib/schemas.rb', line 1676

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