Class: Files::ZipDownloadFile
- Inherits:
-
Object
- Object
- Files::ZipDownloadFile
- Defined in:
- lib/files.com/models/zip_download_file.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.create(params = {}, options = {}) ⇒ Object
Parameters: code (required) - string - Secure code that was generated when creating the zip download.
Instance Method Summary collapse
-
#bundle_id ⇒ Object
int64 - Bundle Id.
- #bundle_id=(value) ⇒ Object
-
#bundle_registration_id ⇒ Object
int64 - Bundle Registration Id.
- #bundle_registration_id=(value) ⇒ Object
-
#code ⇒ Object
string - Secure code that was generated when creating the zip download.
- #code=(value) ⇒ Object
-
#cursor ⇒ Object
string - Cursor for fetching more files in subsequent requests.
- #cursor=(value) ⇒ Object
-
#files ⇒ Object
array(object) - A list of file names, sizes, and signed download URLs.
- #files=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ ZipDownloadFile
constructor
A new instance of ZipDownloadFile.
-
#limit ⇒ Object
int64 - Limit the number of files returned.
- #limit=(value) ⇒ Object
- #save ⇒ Object
-
#site_id ⇒ Object
int64 - Site Id.
- #site_id=(value) ⇒ Object
-
#user_id ⇒ Object
int64 - User Id.
- #user_id=(value) ⇒ Object
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (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 |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/zip_download_file.rb', line 5 def @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 = {}, = {}) 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, = Api.send_request("/zip_download_files", :post, params, ) ZipDownloadFiles.new(response.data, ) end |
Instance Method Details
#bundle_id ⇒ Object
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_id ⇒ Object
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 |
#code ⇒ Object
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 |
#cursor ⇒ Object
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 |
#files ⇒ Object
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 |
#limit ⇒ Object
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 |
#save ⇒ Object
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_id ⇒ Object
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_id ⇒ Object
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 |