Class: Files::Bundle
- Inherits:
-
Object
- Object
- Files::Bundle
- Defined in:
- lib/files.com/models/bundle.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
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: user_id - int64 - User ID.
- .delete(id, params = {}, options = {}) ⇒ Object
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - Bundle ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: user_id - int64 - User ID.
-
.share(id, params = {}, options = {}) ⇒ Object
Send email(s) with a link to bundle.
-
.update(id, params = {}, options = {}) ⇒ Object
Parameters: paths - array(string) - A list of paths to include in this bundle.
Instance Method Summary collapse
-
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Bundle.
- #clickwrap_body=(value) ⇒ Object
-
#clickwrap_id ⇒ Object
int64 - ID of the clickwrap to use with this bundle.
- #clickwrap_id=(value) ⇒ Object
-
#code ⇒ Object
string - Bundle code.
- #code=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - Bundle created at date/time.
- #delete(params = {}) ⇒ Object
-
#description ⇒ Object
string - Public description.
- #description=(value) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#dont_separate_submissions_by_folder ⇒ Object
boolean - Do not create subfolders for files uploaded to this share.
- #dont_separate_submissions_by_folder=(value) ⇒ Object
-
#expires_at ⇒ Object
date-time - Bundle expiration date/time.
- #expires_at=(value) ⇒ Object
-
#form_field_set ⇒ Object
FormFieldSet - Custom Form to use.
- #form_field_set=(value) ⇒ Object
-
#form_field_set_id ⇒ Object
int64 - Id of Form Field Set to use with this bundle.
- #form_field_set_id=(value) ⇒ Object
-
#has_inbox ⇒ Object
boolean - Does this bundle have an associated inbox?.
- #has_inbox=(value) ⇒ Object
-
#id ⇒ Object
int64 - Bundle ID.
- #id=(value) ⇒ Object
-
#inbox_id ⇒ Object
int64 - ID of the associated inbox, if available.
- #inbox_id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ Bundle
constructor
A new instance of Bundle.
-
#max_uses ⇒ Object
int64 - Maximum number of times bundle can be accessed.
- #max_uses=(value) ⇒ Object
-
#note ⇒ Object
string - Bundle internal note.
- #note=(value) ⇒ Object
-
#password ⇒ Object
string - Password for this bundle.
- #password=(value) ⇒ Object
-
#password_protected ⇒ Object
boolean - Is this bundle password protected?.
- #password_protected=(value) ⇒ Object
-
#path_template ⇒ Object
string - Template for creating submission subfolders.
- #path_template=(value) ⇒ Object
-
#paths ⇒ Object
array - A list of paths in this bundle.
- #paths=(value) ⇒ Object
-
#permissions ⇒ Object
string - Permissions that apply to Folders in this Share Link.
- #permissions=(value) ⇒ Object
-
#preview_only ⇒ Object
boolean - Restrict users to previewing files only?.
- #preview_only=(value) ⇒ Object
-
#require_registration ⇒ Object
boolean - Show a registration page that captures the downloader’s name and email address?.
- #require_registration=(value) ⇒ Object
-
#require_share_recipient ⇒ Object
boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?.
- #require_share_recipient=(value) ⇒ Object
- #save ⇒ Object
-
#send_email_receipt_to_uploader ⇒ Object
boolean - Send delivery receipt to the uploader.
- #send_email_receipt_to_uploader=(value) ⇒ Object
-
#share(params = {}) ⇒ Object
Send email(s) with a link to bundle.
-
#skip_company ⇒ Object
boolean - BundleRegistrations can be saved without providing company?.
- #skip_company=(value) ⇒ Object
-
#skip_email ⇒ Object
boolean - BundleRegistrations can be saved without providing email?.
- #skip_email=(value) ⇒ Object
-
#skip_name ⇒ Object
boolean - BundleRegistrations can be saved without providing name?.
- #skip_name=(value) ⇒ Object
-
#update(params = {}) ⇒ Object
Parameters: paths - array(string) - A list of paths to include in this bundle.
-
#url ⇒ Object
string - Public URL of Share Link.
- #url=(value) ⇒ Object
-
#user_id ⇒ Object
int64 - Bundle creator user ID.
- #user_id=(value) ⇒ Object
-
#username ⇒ Object
string - Bundle creator username.
- #username=(value) ⇒ Object
-
#watermark_attachment ⇒ Object
Image - Preview watermark image applied to all bundle items.
- #watermark_attachment=(value) ⇒ Object
-
#watermark_attachment_delete ⇒ Object
boolean - If true, will delete the file stored in watermark_attachment.
- #watermark_attachment_delete=(value) ⇒ Object
-
#watermark_attachment_file ⇒ Object
file - Preview watermark image applied to all bundle items.
- #watermark_attachment_file=(value) ⇒ Object
-
#watermark_value ⇒ Object
object - Preview watermark settings applied to all bundle items.
- #watermark_value=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ Bundle
Returns a new instance of Bundle.
7 8 9 10 |
# File 'lib/files.com/models/bundle.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/bundle.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/bundle.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
420 421 422 |
# File 'lib/files.com/models/bundle.rb', line 420 def self.all(params = {}, = {}) list(params, ) end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
paths (required) - array(string) - A list of paths to include in this bundle.
password - string - Password for this bundle.
form_field_set_id - int64 - Id of Form Field Set to use with this bundle
dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
expires_at - string - Bundle expiration date/time
max_uses - int64 - Maximum number of times bundle can be accessed
description - string - Public description
note - string - Bundle internal note
code - string - Bundle code. This code forms the end part of the Public URL.
path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
permissions - string - Permissions that apply to Folders in this Share Link.
preview_only - boolean - Restrict users to previewing files only?
require_registration - boolean - Show a registration page that captures the downloader's name and email address?
clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
inbox_id - int64 - ID of the associated inbox, if available.
require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
skip_email - boolean - BundleRegistrations can be saved without providing email?
skip_name - boolean - BundleRegistrations can be saved without providing name?
skip_company - boolean - BundleRegistrations can be saved without providing company?
watermark_attachment_file - file - Preview watermark image applied to all bundle items.
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/files.com/models/bundle.rb', line 463 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params[:paths] and !params[:paths].is_a?(Array) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: form_field_set_id must be an Integer") if params[:form_field_set_id] and !params[:form_field_set_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params[:expires_at] and !params[:expires_at].is_a?(String) raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params[:max_uses] and !params[:max_uses].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: note must be an String") if params[:note] and !params[:note].is_a?(String) raise InvalidParameterError.new("Bad parameter: code must be an String") if params[:code] and !params[:code].is_a?(String) raise InvalidParameterError.new("Bad parameter: path_template must be an String") if params[:path_template] and !params[:path_template].is_a?(String) raise InvalidParameterError.new("Bad parameter: permissions must be an String") if params[:permissions] and !params[:permissions].is_a?(String) raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params[:clickwrap_id] and !params[:clickwrap_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params[:inbox_id] and !params[:inbox_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: paths") unless params[:paths] response, = Api.send_request("/bundles", :post, params, ) Bundle.new(response.data, ) end |
.delete(id, params = {}, options = {}) ⇒ Object
547 548 549 550 551 552 553 554 555 |
# File 'lib/files.com/models/bundle.rb', line 547 def self.delete(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/bundles/#{params[:id]}", :delete, params, ) response.data end |
.destroy(id, params = {}, options = {}) ⇒ Object
557 558 559 |
# File 'lib/files.com/models/bundle.rb', line 557 def self.destroy(id, params = {}, = {}) delete(id, params, ) end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - Bundle ID.
426 427 428 429 430 431 432 433 434 |
# File 'lib/files.com/models/bundle.rb', line 426 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/bundles/#{params[:id]}", :get, params, ) Bundle.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
436 437 438 |
# File 'lib/files.com/models/bundle.rb', line 436 def self.get(id, params = {}, = {}) find(id, params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[created_at]=desc`). Valid fields are `created_at` and `code`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `created_at`.
filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`.
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/files.com/models/bundle.rb', line 403 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].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: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params[:filter_like] and !params[:filter_like].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash) List.new(Bundle, params) do Api.send_request("/bundles", :get, params, ) end end |
.share(id, params = {}, options = {}) ⇒ Object
Send email(s) with a link to bundle
Parameters:
to - array(string) - A list of email addresses to share this bundle with. Required unless `recipients` is used.
note - string - Note to include in email.
recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/files.com/models/bundle.rb', line 489 def self.share(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: to must be an Array") if params[:to] and !params[:to].is_a?(Array) raise InvalidParameterError.new("Bad parameter: note must be an String") if params[:note] and !params[:note].is_a?(String) raise InvalidParameterError.new("Bad parameter: recipients must be an Array") if params[:recipients] and !params[:recipients].is_a?(Array) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/bundles/#{params[:id]}/share", :post, params, ) response.data end |
.update(id, params = {}, options = {}) ⇒ Object
Parameters:
paths - array(string) - A list of paths to include in this bundle.
password - string - Password for this bundle.
form_field_set_id - int64 - Id of Form Field Set to use with this bundle
clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
code - string - Bundle code. This code forms the end part of the Public URL.
description - string - Public description
dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
expires_at - string - Bundle expiration date/time
inbox_id - int64 - ID of the associated inbox, if available.
max_uses - int64 - Maximum number of times bundle can be accessed
note - string - Bundle internal note
path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
permissions - string - Permissions that apply to Folders in this Share Link.
preview_only - boolean - Restrict users to previewing files only?
require_registration - boolean - Show a registration page that captures the downloader's name and email address?
require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
skip_company - boolean - BundleRegistrations can be saved without providing company?
skip_email - boolean - BundleRegistrations can be saved without providing email?
skip_name - boolean - BundleRegistrations can be saved without providing name?
watermark_attachment_delete - boolean - If true, will delete the file stored in watermark_attachment
watermark_attachment_file - file - Preview watermark image applied to all bundle items.
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/files.com/models/bundle.rb', line 525 def self.update(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params[:paths] and !params[:paths].is_a?(Array) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: form_field_set_id must be an Integer") if params[:form_field_set_id] and !params[:form_field_set_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params[:clickwrap_id] and !params[:clickwrap_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: code must be an String") if params[:code] and !params[:code].is_a?(String) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params[:expires_at] and !params[:expires_at].is_a?(String) raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params[:inbox_id] and !params[:inbox_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params[:max_uses] and !params[:max_uses].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: note must be an String") if params[:note] and !params[:note].is_a?(String) raise InvalidParameterError.new("Bad parameter: path_template must be an String") if params[:path_template] and !params[:path_template].is_a?(String) raise InvalidParameterError.new("Bad parameter: permissions must be an String") if params[:permissions] and !params[:permissions].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/bundles/#{params[:id]}", :patch, params, ) Bundle.new(response.data, ) end |
Instance Method Details
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Bundle.
85 86 87 |
# File 'lib/files.com/models/bundle.rb', line 85 def clickwrap_body @attributes[:clickwrap_body] end |
#clickwrap_body=(value) ⇒ Object
89 90 91 |
# File 'lib/files.com/models/bundle.rb', line 89 def clickwrap_body=(value) @attributes[:clickwrap_body] = value end |
#clickwrap_id ⇒ Object
int64 - ID of the clickwrap to use with this bundle.
216 217 218 |
# File 'lib/files.com/models/bundle.rb', line 216 def clickwrap_id @attributes[:clickwrap_id] end |
#clickwrap_id=(value) ⇒ Object
220 221 222 |
# File 'lib/files.com/models/bundle.rb', line 220 def clickwrap_id=(value) @attributes[:clickwrap_id] = value end |
#code ⇒ Object
string - Bundle code. This code forms the end part of the Public URL.
13 14 15 |
# File 'lib/files.com/models/bundle.rb', line 13 def code @attributes[:code] end |
#code=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/bundle.rb', line 17 def code=(value) @attributes[:code] = value end |
#created_at ⇒ Object
date-time - Bundle created at date/time
139 140 141 |
# File 'lib/files.com/models/bundle.rb', line 139 def created_at @attributes[:created_at] end |
#delete(params = {}) ⇒ Object
369 370 371 372 373 374 375 376 377 |
# File 'lib/files.com/models/bundle.rb', line 369 def delete(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/bundles/#{@attributes[:id]}", :delete, params, @options) end |
#description ⇒ Object
string - Public description
31 32 33 |
# File 'lib/files.com/models/bundle.rb', line 31 def description @attributes[:description] end |
#description=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/bundle.rb', line 35 def description=(value) @attributes[:description] = value end |
#destroy(params = {}) ⇒ Object
379 380 381 |
# File 'lib/files.com/models/bundle.rb', line 379 def destroy(params = {}) delete(params) end |
#dont_separate_submissions_by_folder ⇒ Object
boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
144 145 146 |
# File 'lib/files.com/models/bundle.rb', line 144 def dont_separate_submissions_by_folder @attributes[:dont_separate_submissions_by_folder] end |
#dont_separate_submissions_by_folder=(value) ⇒ Object
148 149 150 |
# File 'lib/files.com/models/bundle.rb', line 148 def dont_separate_submissions_by_folder=(value) @attributes[:dont_separate_submissions_by_folder] = value end |
#expires_at ⇒ Object
date-time - Bundle expiration date/time
153 154 155 |
# File 'lib/files.com/models/bundle.rb', line 153 def expires_at @attributes[:expires_at] end |
#expires_at=(value) ⇒ Object
157 158 159 |
# File 'lib/files.com/models/bundle.rb', line 157 def expires_at=(value) @attributes[:expires_at] = value end |
#form_field_set ⇒ Object
FormFieldSet - Custom Form to use
94 95 96 |
# File 'lib/files.com/models/bundle.rb', line 94 def form_field_set @attributes[:form_field_set] end |
#form_field_set=(value) ⇒ Object
98 99 100 |
# File 'lib/files.com/models/bundle.rb', line 98 def form_field_set=(value) @attributes[:form_field_set] = value end |
#form_field_set_id ⇒ Object
int64 - Id of Form Field Set to use with this bundle
279 280 281 |
# File 'lib/files.com/models/bundle.rb', line 279 def form_field_set_id @attributes[:form_field_set_id] end |
#form_field_set_id=(value) ⇒ Object
283 284 285 |
# File 'lib/files.com/models/bundle.rb', line 283 def form_field_set_id=(value) @attributes[:form_field_set_id] = value end |
#has_inbox ⇒ Object
boolean - Does this bundle have an associated inbox?
252 253 254 |
# File 'lib/files.com/models/bundle.rb', line 252 def has_inbox @attributes[:has_inbox] end |
#has_inbox=(value) ⇒ Object
256 257 258 |
# File 'lib/files.com/models/bundle.rb', line 256 def has_inbox=(value) @attributes[:has_inbox] = value end |
#id ⇒ Object
int64 - Bundle ID
130 131 132 |
# File 'lib/files.com/models/bundle.rb', line 130 def id @attributes[:id] end |
#id=(value) ⇒ Object
134 135 136 |
# File 'lib/files.com/models/bundle.rb', line 134 def id=(value) @attributes[:id] = value end |
#inbox_id ⇒ Object
int64 - ID of the associated inbox, if available.
225 226 227 |
# File 'lib/files.com/models/bundle.rb', line 225 def inbox_id @attributes[:inbox_id] end |
#inbox_id=(value) ⇒ Object
229 230 231 |
# File 'lib/files.com/models/bundle.rb', line 229 def inbox_id=(value) @attributes[:inbox_id] = value end |
#max_uses ⇒ Object
int64 - Maximum number of times bundle can be accessed
162 163 164 |
# File 'lib/files.com/models/bundle.rb', line 162 def max_uses @attributes[:max_uses] end |
#max_uses=(value) ⇒ Object
166 167 168 |
# File 'lib/files.com/models/bundle.rb', line 166 def max_uses=(value) @attributes[:max_uses] = value end |
#note ⇒ Object
string - Bundle internal note
171 172 173 |
# File 'lib/files.com/models/bundle.rb', line 171 def note @attributes[:note] end |
#note=(value) ⇒ Object
175 176 177 |
# File 'lib/files.com/models/bundle.rb', line 175 def note=(value) @attributes[:note] = value end |
#password ⇒ Object
string - Password for this bundle.
270 271 272 |
# File 'lib/files.com/models/bundle.rb', line 270 def password @attributes[:password] end |
#password=(value) ⇒ Object
274 275 276 |
# File 'lib/files.com/models/bundle.rb', line 274 def password=(value) @attributes[:password] = value end |
#password_protected ⇒ Object
boolean - Is this bundle password protected?
40 41 42 |
# File 'lib/files.com/models/bundle.rb', line 40 def password_protected @attributes[:password_protected] end |
#password_protected=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/bundle.rb', line 44 def password_protected=(value) @attributes[:password_protected] = value end |
#path_template ⇒ Object
string - Template for creating submission subfolders. Can use the uploader’s name, email address, ip, company, and any custom form data.
180 181 182 |
# File 'lib/files.com/models/bundle.rb', line 180 def path_template @attributes[:path_template] end |
#path_template=(value) ⇒ Object
184 185 186 |
# File 'lib/files.com/models/bundle.rb', line 184 def path_template=(value) @attributes[:path_template] = value end |
#paths ⇒ Object
array - A list of paths in this bundle
261 262 263 |
# File 'lib/files.com/models/bundle.rb', line 261 def paths @attributes[:paths] end |
#paths=(value) ⇒ Object
265 266 267 |
# File 'lib/files.com/models/bundle.rb', line 265 def paths=(value) @attributes[:paths] = value end |
#permissions ⇒ Object
string - Permissions that apply to Folders in this Share Link.
49 50 51 |
# File 'lib/files.com/models/bundle.rb', line 49 def @attributes[:permissions] end |
#permissions=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/bundle.rb', line 53 def (value) @attributes[:permissions] = value end |
#preview_only ⇒ Object
boolean - Restrict users to previewing files only?
58 59 60 |
# File 'lib/files.com/models/bundle.rb', line 58 def preview_only @attributes[:preview_only] end |
#preview_only=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/bundle.rb', line 62 def preview_only=(value) @attributes[:preview_only] = value end |
#require_registration ⇒ Object
boolean - Show a registration page that captures the downloader’s name and email address?
67 68 69 |
# File 'lib/files.com/models/bundle.rb', line 67 def require_registration @attributes[:require_registration] end |
#require_registration=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/bundle.rb', line 71 def require_registration=(value) @attributes[:require_registration] = value end |
#require_share_recipient ⇒ Object
boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
76 77 78 |
# File 'lib/files.com/models/bundle.rb', line 76 def require_share_recipient @attributes[:require_share_recipient] end |
#require_share_recipient=(value) ⇒ Object
80 81 82 |
# File 'lib/files.com/models/bundle.rb', line 80 def require_share_recipient=(value) @attributes[:require_share_recipient] = value end |
#save ⇒ Object
383 384 385 386 387 388 389 390 |
# File 'lib/files.com/models/bundle.rb', line 383 def save if @attributes[:id] update(@attributes) else new_obj = Bundle.create(@attributes, @options) @attributes = new_obj.attributes end end |
#send_email_receipt_to_uploader ⇒ Object
boolean - Send delivery receipt to the uploader. Note: For writable share only
189 190 191 |
# File 'lib/files.com/models/bundle.rb', line 189 def send_email_receipt_to_uploader @attributes[:send_email_receipt_to_uploader] end |
#send_email_receipt_to_uploader=(value) ⇒ Object
193 194 195 |
# File 'lib/files.com/models/bundle.rb', line 193 def send_email_receipt_to_uploader=(value) @attributes[:send_email_receipt_to_uploader] = value end |
#share(params = {}) ⇒ Object
Send email(s) with a link to bundle
Parameters:
to - array(string) - A list of email addresses to share this bundle with. Required unless `recipients` is used.
note - string - Note to include in email.
recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/files.com/models/bundle.rb', line 311 def share(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: to must be an Array") if params[:to] and !params[:to].is_a?(Array) raise InvalidParameterError.new("Bad parameter: note must be an String") if params[:note] and !params[:note].is_a?(String) raise InvalidParameterError.new("Bad parameter: recipients must be an Array") if params[:recipients] and !params[:recipients].is_a?(Array) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/bundles/#{@attributes[:id]}/share", :post, params, @options) end |
#skip_company ⇒ Object
boolean - BundleRegistrations can be saved without providing company?
121 122 123 |
# File 'lib/files.com/models/bundle.rb', line 121 def skip_company @attributes[:skip_company] end |
#skip_company=(value) ⇒ Object
125 126 127 |
# File 'lib/files.com/models/bundle.rb', line 125 def skip_company=(value) @attributes[:skip_company] = value end |
#skip_email ⇒ Object
boolean - BundleRegistrations can be saved without providing email?
112 113 114 |
# File 'lib/files.com/models/bundle.rb', line 112 def skip_email @attributes[:skip_email] end |
#skip_email=(value) ⇒ Object
116 117 118 |
# File 'lib/files.com/models/bundle.rb', line 116 def skip_email=(value) @attributes[:skip_email] = value end |
#skip_name ⇒ Object
boolean - BundleRegistrations can be saved without providing name?
103 104 105 |
# File 'lib/files.com/models/bundle.rb', line 103 def skip_name @attributes[:skip_name] end |
#skip_name=(value) ⇒ Object
107 108 109 |
# File 'lib/files.com/models/bundle.rb', line 107 def skip_name=(value) @attributes[:skip_name] = value end |
#update(params = {}) ⇒ Object
Parameters:
paths - array(string) - A list of paths to include in this bundle.
password - string - Password for this bundle.
form_field_set_id - int64 - Id of Form Field Set to use with this bundle
clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
code - string - Bundle code. This code forms the end part of the Public URL.
description - string - Public description
dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
expires_at - string - Bundle expiration date/time
inbox_id - int64 - ID of the associated inbox, if available.
max_uses - int64 - Maximum number of times bundle can be accessed
note - string - Bundle internal note
path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
permissions - string - Permissions that apply to Folders in this Share Link.
preview_only - boolean - Restrict users to previewing files only?
require_registration - boolean - Show a registration page that captures the downloader's name and email address?
require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
skip_company - boolean - BundleRegistrations can be saved without providing company?
skip_email - boolean - BundleRegistrations can be saved without providing email?
skip_name - boolean - BundleRegistrations can be saved without providing name?
watermark_attachment_delete - boolean - If true, will delete the file stored in watermark_attachment
watermark_attachment_file - file - Preview watermark image applied to all bundle items.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/files.com/models/bundle.rb', line 347 def update(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params[:paths] and !params[:paths].is_a?(Array) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: form_field_set_id must be an Integer") if params[:form_field_set_id] and !params[:form_field_set_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params[:clickwrap_id] and !params[:clickwrap_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: code must be an String") if params[:code] and !params[:code].is_a?(String) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params[:expires_at] and !params[:expires_at].is_a?(String) raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params[:inbox_id] and !params[:inbox_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params[:max_uses] and !params[:max_uses].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: note must be an String") if params[:note] and !params[:note].is_a?(String) raise InvalidParameterError.new("Bad parameter: path_template must be an String") if params[:path_template] and !params[:path_template].is_a?(String) raise InvalidParameterError.new("Bad parameter: permissions must be an String") if params[:permissions] and !params[:permissions].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/bundles/#{@attributes[:id]}", :patch, params, @options) end |
#url ⇒ Object
string - Public URL of Share Link
22 23 24 |
# File 'lib/files.com/models/bundle.rb', line 22 def url @attributes[:url] end |
#url=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/bundle.rb', line 26 def url=(value) @attributes[:url] = value end |
#user_id ⇒ Object
int64 - Bundle creator user ID
198 199 200 |
# File 'lib/files.com/models/bundle.rb', line 198 def user_id @attributes[:user_id] end |
#user_id=(value) ⇒ Object
202 203 204 |
# File 'lib/files.com/models/bundle.rb', line 202 def user_id=(value) @attributes[:user_id] = value end |
#username ⇒ Object
string - Bundle creator username
207 208 209 |
# File 'lib/files.com/models/bundle.rb', line 207 def username @attributes[:username] end |
#username=(value) ⇒ Object
211 212 213 |
# File 'lib/files.com/models/bundle.rb', line 211 def username=(value) @attributes[:username] = value end |
#watermark_attachment ⇒ Object
Image - Preview watermark image applied to all bundle items.
234 235 236 |
# File 'lib/files.com/models/bundle.rb', line 234 def @attributes[:watermark_attachment] end |
#watermark_attachment=(value) ⇒ Object
238 239 240 |
# File 'lib/files.com/models/bundle.rb', line 238 def (value) @attributes[:watermark_attachment] = value end |
#watermark_attachment_delete ⇒ Object
boolean - If true, will delete the file stored in watermark_attachment
297 298 299 |
# File 'lib/files.com/models/bundle.rb', line 297 def @attributes[:watermark_attachment_delete] end |
#watermark_attachment_delete=(value) ⇒ Object
301 302 303 |
# File 'lib/files.com/models/bundle.rb', line 301 def (value) @attributes[:watermark_attachment_delete] = value end |
#watermark_attachment_file ⇒ Object
file - Preview watermark image applied to all bundle items.
288 289 290 |
# File 'lib/files.com/models/bundle.rb', line 288 def @attributes[:watermark_attachment_file] end |
#watermark_attachment_file=(value) ⇒ Object
292 293 294 |
# File 'lib/files.com/models/bundle.rb', line 292 def (value) @attributes[:watermark_attachment_file] = value end |
#watermark_value ⇒ Object
object - Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
243 244 245 |
# File 'lib/files.com/models/bundle.rb', line 243 def watermark_value @attributes[:watermark_value] end |
#watermark_value=(value) ⇒ Object
247 248 249 |
# File 'lib/files.com/models/bundle.rb', line 247 def watermark_value=(value) @attributes[:watermark_value] = value end |