Class: PutCollectionsCollectionIDFoldersFolderIDResponse

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



29695
29696
29697
29698
29699
29700
29701
29702
29703
# File 'lib/schemas.rb', line 29695

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

.from_json!(json) ⇒ Object



29705
29706
29707
# File 'lib/schemas.rb', line 29705

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

Instance Method Details

#to_dynamicObject



29709
29710
29711
29712
29713
29714
29715
29716
# File 'lib/schemas.rb', line 29709

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

#to_json(options = nil) ⇒ Object



29718
29719
29720
# File 'lib/schemas.rb', line 29718

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