Class: Files::ZipDownloadFile

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/zip_download_file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ ZipDownloadFile

Returns a new instance of ZipDownloadFile.



7
8
9
10
# File 'lib/files.com/models/zip_download_file.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/zip_download_file.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/zip_download_file.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

code (required) - string - Secure code that was generated when creating the zip download.
limit - int64 - Limit the number of files returned.
cursor - string - Cursor used for paging through files.
site_id - int64 - Only check the given site for the zip download.


100
101
102
103
104
105
106
107
108
109
# File 'lib/files.com/models/zip_download_file.rb', line 100

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: code must be an String") if params[:code] and !params[:code].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: limit must be an Integer") if params[:limit] and !params[:limit].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: site_id must be an Integer") if params[:site_id] and !params[:site_id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: code") unless params[:code]

  response, options = Api.send_request("/zip_download_files", :post, params, options)
  ZipDownloadFiles.new(response.data, options)
end

Instance Method Details

#bundle_idObject

int64 - Bundle Id



31
32
33
# File 'lib/files.com/models/zip_download_file.rb', line 31

def bundle_id
  @attributes[:bundle_id]
end

#bundle_id=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/zip_download_file.rb', line 35

def bundle_id=(value)
  @attributes[:bundle_id] = value
end

#bundle_registration_idObject

int64 - Bundle Registration Id



40
41
42
# File 'lib/files.com/models/zip_download_file.rb', line 40

def bundle_registration_id
  @attributes[:bundle_registration_id]
end

#bundle_registration_id=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/zip_download_file.rb', line 44

def bundle_registration_id=(value)
  @attributes[:bundle_registration_id] = value
end

#codeObject

string - Secure code that was generated when creating the zip download.



67
68
69
# File 'lib/files.com/models/zip_download_file.rb', line 67

def code
  @attributes[:code]
end

#code=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/zip_download_file.rb', line 71

def code=(value)
  @attributes[:code] = value
end

#cursorObject

string - Cursor for fetching more files in subsequent requests.



58
59
60
# File 'lib/files.com/models/zip_download_file.rb', line 58

def cursor
  @attributes[:cursor]
end

#cursor=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/zip_download_file.rb', line 62

def cursor=(value)
  @attributes[:cursor] = value
end

#filesObject

array(object) - A list of file names, sizes, and signed download URLs.



49
50
51
# File 'lib/files.com/models/zip_download_file.rb', line 49

def files
  @attributes[:files]
end

#files=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/zip_download_file.rb', line 53

def files=(value)
  @attributes[:files] = value
end

#limitObject

int64 - Limit the number of files returned.



76
77
78
# File 'lib/files.com/models/zip_download_file.rb', line 76

def limit
  @attributes[:limit]
end

#limit=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/zip_download_file.rb', line 80

def limit=(value)
  @attributes[:limit] = value
end

#saveObject



84
85
86
87
88
89
90
91
92
93
# File 'lib/files.com/models/zip_download_file.rb', line 84

def save
  if @attributes[:id]
    raise NotImplementedError.new("The ZipDownloadFile object doesn't support updates.")
  else
    new_obj = ZipDownloadFile.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#site_idObject

int64 - Site Id



13
14
15
# File 'lib/files.com/models/zip_download_file.rb', line 13

def site_id
  @attributes[:site_id]
end

#site_id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/zip_download_file.rb', line 17

def site_id=(value)
  @attributes[:site_id] = value
end

#user_idObject

int64 - User Id



22
23
24
# File 'lib/files.com/models/zip_download_file.rb', line 22

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/zip_download_file.rb', line 26

def user_id=(value)
  @attributes[:user_id] = value
end