Class: GetCollectionsCollectionIDFoldersFolderIDResponse

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



7356
7357
7358
7359
7360
7361
7362
7363
# File 'lib/schemas.rb', line 7356

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

.from_json!(json) ⇒ Object



7365
7366
7367
# File 'lib/schemas.rb', line 7365

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

Instance Method Details

#to_dynamicObject



7369
7370
7371
7372
7373
7374
7375
# File 'lib/schemas.rb', line 7369

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

#to_json(options = nil) ⇒ Object



7377
7378
7379
# File 'lib/schemas.rb', line 7377

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