Class: Kloudless::Folder

Inherits:
Model
  • Object
show all
Defined in:
lib/kloudless/folder.rb

Overview

Class Method Summary collapse

Methods inherited from Model

http, #http, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Kloudless::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kloudless::Model

Class Method Details

.copy(account_id:, folder_id:, parent_id:, params: {}, **data) ⇒ Object



29
30
31
32
33
# File 'lib/kloudless/folder.rb', line 29

def self.copy(account_id:, folder_id:, parent_id:, params: {}, **data)
  path = "/accounts/#{}/storage/folders/#{folder_id}/copy"
  data[:parent_id] = parent_id
  new(http.post(path, params: params, data: data))
end

.create(account_id:, params: {}, **data) ⇒ Object



5
6
7
8
# File 'lib/kloudless/folder.rb', line 5

def self.create(account_id:, params: {}, **data)
  path = "/accounts/#{}/storage/folders"
  new(http.post(path, params: params, data: data))
end

.delete(account_id:, folder_id:, **params) ⇒ Object



36
37
38
39
# File 'lib/kloudless/folder.rb', line 36

def self.delete(account_id:, folder_id:, **params)
  path = "/accounts/#{}/storage/folders/#{folder_id}"
  new(http.delete(path, params: params))
end

.metadata(account_id:, folder_id:, **params) ⇒ Object



11
12
13
14
# File 'lib/kloudless/folder.rb', line 11

def self.(account_id:, folder_id:, **params)
  path = "/accounts/#{}/storage/folders/#{folder_id}"
  new(http.get(path, params: params))
end

.rename(account_id:, folder_id:, params: {}, **data) ⇒ Object



23
24
25
26
# File 'lib/kloudless/folder.rb', line 23

def self.rename(account_id:, folder_id:, params: {}, **data)
  path = "/accounts/#{}/storage/folders/#{folder_id}"
  new(http.patch(path, params: params, data: data))
end

.retrieve(account_id:, folder_id:, **params) ⇒ Object



17
18
19
20
# File 'lib/kloudless/folder.rb', line 17

def self.retrieve(account_id:, folder_id:, **params)
  path = "/accounts/#{}/storage/folders/#{folder_id}/contents"
  Kloudless::Collection.new(self, http.get(path, params: params))
end