Class: Files::Bundle

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = {}, 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/bundle.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

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



608
609
610
# File 'lib/files.com/models/bundle.rb', line 608

def self.all(params = {}, options = {})
  list(params, options)
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.
bypasses_site_expiration_rules - boolean - If true, this Share Link bypasses site-wide expiration rules. Only site admins may set this.
form_field_set_id - int64 - Id of Form Field Set to use with this bundle
create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
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
finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
max_uses - int64 - Maximum number of times bundle can be accessed
group_id - int64 - Owning group ID. If set, members of this group can view, edit, and share this Share Link.
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, `strftime` directives, and any custom form data.
path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
permissions - string - Permissions that apply to Folders in this Share Link.
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_one_time_password_to_recipient_at_registration - boolean - If true, require_share_recipient bundles will send a one-time password to the recipient when they register. Cannot be enabled if the bundle has a password set.
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?
start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
snapshot_id - int64 - ID of the snapshot containing this bundle's contents.
workspace_id - int64 - Workspace ID. `0` means the default workspace.
watermark_attachment_file - file - Preview watermark image applied to all bundle items.


659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/files.com/models/bundle.rb', line 659

def self.create(params = {}, options = {})
  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: group_id must be an Integer") if params[:group_id] and !params[:group_id].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: path_template_time_zone must be an String") if params[:path_template_time_zone] and !params[:path_template_time_zone].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 InvalidParameterError.new("Bad parameter: start_access_on_date must be an String") if params[:start_access_on_date] and !params[:start_access_on_date].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: snapshot_id must be an Integer") if params[:snapshot_id] and !params[:snapshot_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: paths") unless params[:paths]

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

.delete(id, params = {}, options = {}) ⇒ Object



761
762
763
764
765
766
767
768
769
# File 'lib/files.com/models/bundle.rb', line 761

def self.delete(id, params = {}, options = {})
  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]

  Api.send_request("/bundles/#{params[:id]}", :delete, params, options)
  nil
end

.destroy(id, params = {}, options = {}) ⇒ Object



771
772
773
774
# File 'lib/files.com/models/bundle.rb', line 771

def self.destroy(id, params = {}, options = {})
  delete(id, params, options)
  nil
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - Bundle ID.


614
615
616
617
618
619
620
621
622
# File 'lib/files.com/models/bundle.rb', line 614

def self.find(id, params = {}, options = {})
  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, options = Api.send_request("/bundles/#{params[:id]}", :get, params, options)
  Bundle.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



624
625
626
# File 'lib/files.com/models/bundle.rb', line 624

def self.get(id, params = {}, options = {})
  find(id, params, options)
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: 10000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code`, `user_id` or `bypasses_site_expiration_rules`. Valid field combinations are `[ user_id, expires_at ]`.
filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at` and `expires_at`.
filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
deleted - boolean - If true, only list deleted Share Links.


591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/files.com/models/bundle.rb', line 591

def self.list(params = {}, options = {})
  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_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].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, options)
  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.


690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/files.com/models/bundle.rb', line 690

def self.share(id, params = {}, options = {})
  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]

  Api.send_request("/bundles/#{params[:id]}/share", :post, params, options)
  nil
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.
bypasses_site_expiration_rules - boolean - If true, this Share Link bypasses site-wide expiration rules. Only site admins may set this.
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.
create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
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
finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
inbox_id - int64 - ID of the associated inbox, if available.
max_uses - int64 - Maximum number of times bundle can be accessed
group_id - int64 - Owning group ID. If set, members of this group can view, edit, and share this Share Link.
note - string - Bundle internal note
path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
permissions - string - Permissions that apply to Folders in this Share Link.
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_one_time_password_to_recipient_at_registration - boolean - If true, require_share_recipient bundles will send a one-time password to the recipient when they register. Cannot be enabled if the bundle has a password set.
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?
start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
skip_email - boolean - BundleRegistrations can be saved without providing email?
skip_name - boolean - BundleRegistrations can be saved without providing name?
workspace_id - int64 - Workspace ID. `0` means the default workspace.
user_id - int64 - The owning user id. Only site admins can set this.
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.


734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/files.com/models/bundle.rb', line 734

def self.update(id, params = {}, options = {})
  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: group_id must be an Integer") if params[:group_id] and !params[:group_id].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: path_template_time_zone must be an String") if params[:path_template_time_zone] and !params[:path_template_time_zone].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: start_access_on_date must be an String") if params[:start_access_on_date] and !params[:start_access_on_date].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/bundles/#{params[:id]}", :patch, params, options)
  Bundle.new(response.data, options)
end

Instance Method Details

#bundlepathsObject

array(object) - A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.



414
415
416
# File 'lib/files.com/models/bundle.rb', line 414

def bundlepaths
  @attributes[:bundlepaths]
end

#bundlepaths=(value) ⇒ Object



418
419
420
# File 'lib/files.com/models/bundle.rb', line 418

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

#bypasses_site_expiration_rulesObject

boolean - If true, this Share Link bypasses site-wide expiration rules. Only site admins may set this.



211
212
213
# File 'lib/files.com/models/bundle.rb', line 211

def bypasses_site_expiration_rules
  @attributes[:bypasses_site_expiration_rules]
end

#bypasses_site_expiration_rules=(value) ⇒ Object



215
216
217
# File 'lib/files.com/models/bundle.rb', line 215

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

#clickwrap_bodyObject

string - Legal text that must be agreed to prior to accessing Bundle.



148
149
150
# File 'lib/files.com/models/bundle.rb', line 148

def clickwrap_body
  @attributes[:clickwrap_body]
end

#clickwrap_body=(value) ⇒ Object



152
153
154
# File 'lib/files.com/models/bundle.rb', line 152

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

#clickwrap_idObject

int64 - ID of the clickwrap to use with this bundle.



333
334
335
# File 'lib/files.com/models/bundle.rb', line 333

def clickwrap_id
  @attributes[:clickwrap_id]
end

#clickwrap_id=(value) ⇒ Object



337
338
339
# File 'lib/files.com/models/bundle.rb', line 337

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

#codeObject

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

#color_leftObject

string - Page link and button color



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

def color_left
  @attributes[:color_left]
end

#color_left=(value) ⇒ Object



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

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

string - Top bar link color



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

def color_link
  @attributes[:color_link]
end

#color_link=(value) ⇒ Object



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

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

#color_textObject

string - Page link and button color



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

def color_text
  @attributes[:color_text]
end

#color_text=(value) ⇒ Object



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

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

#color_topObject

string - Top bar background color



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

def color_top
  @attributes[:color_top]
end

#color_top=(value) ⇒ Object



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

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

#color_top_textObject

string - Top bar text color



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

def color_top_text
  @attributes[:color_top_text]
end

#color_top_text=(value) ⇒ Object



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

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

#create_snapshotObject

boolean - If true, create a snapshot of this bundle’s contents.



441
442
443
# File 'lib/files.com/models/bundle.rb', line 441

def create_snapshot
  @attributes[:create_snapshot]
end

#create_snapshot=(value) ⇒ Object



445
446
447
# File 'lib/files.com/models/bundle.rb', line 445

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

#created_atObject

date-time - Bundle created at date/time



220
221
222
# File 'lib/files.com/models/bundle.rb', line 220

def created_at
  @attributes[:created_at]
end

#delete(params = {}) ⇒ Object



553
554
555
556
557
558
559
560
561
# File 'lib/files.com/models/bundle.rb', line 553

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

#deletedObject

boolean - Indicates if the bundle has been deleted.



225
226
227
# File 'lib/files.com/models/bundle.rb', line 225

def deleted
  @attributes[:deleted]
end

#deleted=(value) ⇒ Object



229
230
231
# File 'lib/files.com/models/bundle.rb', line 229

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

#deleted_atObject

date-time - Bundle deleted at date/time



234
235
236
# File 'lib/files.com/models/bundle.rb', line 234

def deleted_at
  @attributes[:deleted_at]
end

#deleted_at=(value) ⇒ Object



238
239
240
# File 'lib/files.com/models/bundle.rb', line 238

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

#descriptionObject

string - Public description



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

def description
  @attributes[:description]
end

#description=(value) ⇒ Object



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

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

#destroy(params = {}) ⇒ Object



563
564
565
566
# File 'lib/files.com/models/bundle.rb', line 563

def destroy(params = {})
  delete(params)
  nil
end

#dont_allow_folders_in_uploadsObject

boolean - Should folder uploads be prevented?



396
397
398
# File 'lib/files.com/models/bundle.rb', line 396

def dont_allow_folders_in_uploads
  @attributes[:dont_allow_folders_in_uploads]
end

#dont_allow_folders_in_uploads=(value) ⇒ Object



400
401
402
# File 'lib/files.com/models/bundle.rb', line 400

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

#dont_separate_submissions_by_folderObject

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.



243
244
245
# File 'lib/files.com/models/bundle.rb', line 243

def dont_separate_submissions_by_folder
  @attributes[:dont_separate_submissions_by_folder]
end

#dont_separate_submissions_by_folder=(value) ⇒ Object



247
248
249
# File 'lib/files.com/models/bundle.rb', line 247

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

#expires_atObject

date-time - Bundle expiration date/time



85
86
87
# File 'lib/files.com/models/bundle.rb', line 85

def expires_at
  @attributes[:expires_at]
end

#expires_at=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/bundle.rb', line 89

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

#finalize_snapshotObject

boolean - If true, finalize the snapshot of this bundle’s contents. Note that ‘create_snapshot` must also be true.



450
451
452
# File 'lib/files.com/models/bundle.rb', line 450

def finalize_snapshot
  @attributes[:finalize_snapshot]
end

#finalize_snapshot=(value) ⇒ Object



454
455
456
# File 'lib/files.com/models/bundle.rb', line 454

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

#form_field_setObject

FormFieldSet - Custom Form to use



157
158
159
# File 'lib/files.com/models/bundle.rb', line 157

def form_field_set
  @attributes[:form_field_set]
end

#form_field_set=(value) ⇒ Object



161
162
163
# File 'lib/files.com/models/bundle.rb', line 161

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

#form_field_set_idObject

int64 - Id of Form Field Set to use with this bundle



432
433
434
# File 'lib/files.com/models/bundle.rb', line 432

def form_field_set_id
  @attributes[:form_field_set_id]
end

#form_field_set_id=(value) ⇒ Object



436
437
438
# File 'lib/files.com/models/bundle.rb', line 436

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

#group_idObject

int64 - Owning group ID. If set, members of this group can view, edit, and share this Share Link.



324
325
326
# File 'lib/files.com/models/bundle.rb', line 324

def group_id
  @attributes[:group_id]
end

#group_id=(value) ⇒ Object



328
329
330
# File 'lib/files.com/models/bundle.rb', line 328

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

#has_inboxObject

boolean - Does this bundle have an associated inbox?



387
388
389
# File 'lib/files.com/models/bundle.rb', line 387

def has_inbox
  @attributes[:has_inbox]
end

#has_inbox=(value) ⇒ Object



391
392
393
# File 'lib/files.com/models/bundle.rb', line 391

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

#idObject

int64 - Bundle ID



202
203
204
# File 'lib/files.com/models/bundle.rb', line 202

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



206
207
208
# File 'lib/files.com/models/bundle.rb', line 206

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

#inbox_idObject

int64 - ID of the associated inbox, if available.



342
343
344
# File 'lib/files.com/models/bundle.rb', line 342

def inbox_id
  @attributes[:inbox_id]
end

#inbox_id=(value) ⇒ Object



346
347
348
# File 'lib/files.com/models/bundle.rb', line 346

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

#max_usesObject

int64 - Maximum number of times bundle can be accessed



252
253
254
# File 'lib/files.com/models/bundle.rb', line 252

def max_uses
  @attributes[:max_uses]
end

#max_uses=(value) ⇒ Object



256
257
258
# File 'lib/files.com/models/bundle.rb', line 256

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

#noteObject

string - Bundle internal note



261
262
263
# File 'lib/files.com/models/bundle.rb', line 261

def note
  @attributes[:note]
end

#note=(value) ⇒ Object



265
266
267
# File 'lib/files.com/models/bundle.rb', line 265

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

#passwordObject

string - Password for this bundle.



423
424
425
# File 'lib/files.com/models/bundle.rb', line 423

def password
  @attributes[:password]
end

#password=(value) ⇒ Object



427
428
429
# File 'lib/files.com/models/bundle.rb', line 427

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

#password_protectedObject

boolean - Is this bundle password protected?



94
95
96
# File 'lib/files.com/models/bundle.rb', line 94

def password_protected
  @attributes[:password_protected]
end

#password_protected=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/bundle.rb', line 98

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

#path_templateObject

string - Template for creating submission subfolders. Can use the uploader’s name, email address, ip, company, ‘strftime` directives, and any custom form data.



270
271
272
# File 'lib/files.com/models/bundle.rb', line 270

def path_template
  @attributes[:path_template]
end

#path_template=(value) ⇒ Object



274
275
276
# File 'lib/files.com/models/bundle.rb', line 274

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

#path_template_time_zoneObject

string - Timezone to use when rendering timestamps in path templates.



279
280
281
# File 'lib/files.com/models/bundle.rb', line 279

def path_template_time_zone
  @attributes[:path_template_time_zone]
end

#path_template_time_zone=(value) ⇒ Object



283
284
285
# File 'lib/files.com/models/bundle.rb', line 283

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

#pathsObject

array(string) - A list of paths in this bundle. For performance reasons, this is not provided when listing bundles.



405
406
407
# File 'lib/files.com/models/bundle.rb', line 405

def paths
  @attributes[:paths]
end

#paths=(value) ⇒ Object



409
410
411
# File 'lib/files.com/models/bundle.rb', line 409

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

#permissionsObject

string - Permissions that apply to Folders in this Share Link.



103
104
105
# File 'lib/files.com/models/bundle.rb', line 103

def permissions
  @attributes[:permissions]
end

#permissions=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/bundle.rb', line 107

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

#preview_onlyObject

boolean



112
113
114
# File 'lib/files.com/models/bundle.rb', line 112

def preview_only
  @attributes[:preview_only]
end

#preview_only=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/bundle.rb', line 116

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

#require_logoutObject

boolean - If true, we will hide the ‘Remember Me’ box on the Bundle registration page, requiring that the user logout and log back in every time they visit the page.



139
140
141
# File 'lib/files.com/models/bundle.rb', line 139

def require_logout
  @attributes[:require_logout]
end

#require_logout=(value) ⇒ Object



143
144
145
# File 'lib/files.com/models/bundle.rb', line 143

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

#require_registrationObject

boolean - Show a registration page that captures the downloader’s name and email address?



121
122
123
# File 'lib/files.com/models/bundle.rb', line 121

def require_registration
  @attributes[:require_registration]
end

#require_registration=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/bundle.rb', line 125

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

#require_share_recipientObject

boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?



130
131
132
# File 'lib/files.com/models/bundle.rb', line 130

def require_share_recipient
  @attributes[:require_share_recipient]
end

#require_share_recipient=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/bundle.rb', line 134

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

#saveObject



568
569
570
571
572
573
574
575
576
577
# File 'lib/files.com/models/bundle.rb', line 568

def save
  if @attributes[:id]
    new_obj = update(@attributes)
  else
    new_obj = Bundle.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#send_email_receipt_to_uploaderObject

boolean - Send delivery receipt to the uploader. Note: For writable share only



288
289
290
# File 'lib/files.com/models/bundle.rb', line 288

def send_email_receipt_to_uploader
  @attributes[:send_email_receipt_to_uploader]
end

#send_email_receipt_to_uploader=(value) ⇒ Object



292
293
294
# File 'lib/files.com/models/bundle.rb', line 292

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

#send_one_time_password_to_recipient_at_registrationObject

boolean - If true, require_share_recipient bundles will send a one-time password to the recipient when they register. Cannot be enabled if the bundle has a password set.



369
370
371
# File 'lib/files.com/models/bundle.rb', line 369

def send_one_time_password_to_recipient_at_registration
  @attributes[:send_one_time_password_to_recipient_at_registration]
end

#send_one_time_password_to_recipient_at_registration=(value) ⇒ Object



373
374
375
# File 'lib/files.com/models/bundle.rb', line 373

def send_one_time_password_to_recipient_at_registration=(value)
  @attributes[:send_one_time_password_to_recipient_at_registration] = 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.


482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/files.com/models/bundle.rb', line 482

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_companyObject

boolean - BundleRegistrations can be saved without providing company?



193
194
195
# File 'lib/files.com/models/bundle.rb', line 193

def skip_company
  @attributes[:skip_company]
end

#skip_company=(value) ⇒ Object



197
198
199
# File 'lib/files.com/models/bundle.rb', line 197

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

#skip_emailObject

boolean - BundleRegistrations can be saved without providing email?



175
176
177
# File 'lib/files.com/models/bundle.rb', line 175

def skip_email
  @attributes[:skip_email]
end

#skip_email=(value) ⇒ Object



179
180
181
# File 'lib/files.com/models/bundle.rb', line 179

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

#skip_nameObject

boolean - BundleRegistrations can be saved without providing name?



166
167
168
# File 'lib/files.com/models/bundle.rb', line 166

def skip_name
  @attributes[:skip_name]
end

#skip_name=(value) ⇒ Object



170
171
172
# File 'lib/files.com/models/bundle.rb', line 170

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

#snapshot_idObject

int64 - ID of the snapshot containing this bundle’s contents.



297
298
299
# File 'lib/files.com/models/bundle.rb', line 297

def snapshot_id
  @attributes[:snapshot_id]
end

#snapshot_id=(value) ⇒ Object



301
302
303
# File 'lib/files.com/models/bundle.rb', line 301

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

#start_access_on_dateObject

date-time - Date when share will start to be accessible. If ‘nil` access granted right after create.



184
185
186
# File 'lib/files.com/models/bundle.rb', line 184

def start_access_on_date
  @attributes[:start_access_on_date]
end

#start_access_on_date=(value) ⇒ Object



188
189
190
# File 'lib/files.com/models/bundle.rb', line 188

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

#update(params = {}) ⇒ Object

Parameters:

paths - array(string) - A list of paths to include in this bundle.
password - string - Password for this bundle.
bypasses_site_expiration_rules - boolean - If true, this Share Link bypasses site-wide expiration rules. Only site admins may set this.
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.
create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
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
finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
inbox_id - int64 - ID of the associated inbox, if available.
max_uses - int64 - Maximum number of times bundle can be accessed
group_id - int64 - Owning group ID. If set, members of this group can view, edit, and share this Share Link.
note - string - Bundle internal note
path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
permissions - string - Permissions that apply to Folders in this Share Link.
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_one_time_password_to_recipient_at_registration - boolean - If true, require_share_recipient bundles will send a one-time password to the recipient when they register. Cannot be enabled if the bundle has a password set.
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?
start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
skip_email - boolean - BundleRegistrations can be saved without providing email?
skip_name - boolean - BundleRegistrations can be saved without providing name?
workspace_id - int64 - Workspace ID. `0` means the default workspace.
user_id - int64 - The owning user id. Only site admins can set this.
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.


526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/files.com/models/bundle.rb', line 526

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: group_id must be an Integer") if params[:group_id] and !params[:group_id].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: path_template_time_zone must be an String") if params[:path_template_time_zone] and !params[:path_template_time_zone].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: start_access_on_date must be an String") if params[:start_access_on_date] and !params[:start_access_on_date].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/bundles/#{@attributes[:id]}", :patch, params, @options)
end

#urlObject

string - Public URL of Share Link



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

def url
  @attributes[:url]
end

#url=(value) ⇒ Object



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

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

#user_idObject

int64 - Bundle creator user ID



306
307
308
# File 'lib/files.com/models/bundle.rb', line 306

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



310
311
312
# File 'lib/files.com/models/bundle.rb', line 310

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

#usernameObject

string - Bundle creator username



315
316
317
# File 'lib/files.com/models/bundle.rb', line 315

def username
  @attributes[:username]
end

#username=(value) ⇒ Object



319
320
321
# File 'lib/files.com/models/bundle.rb', line 319

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

#watermark_attachmentObject

Image - Preview watermark image applied to all bundle items.



351
352
353
# File 'lib/files.com/models/bundle.rb', line 351

def watermark_attachment
  @attributes[:watermark_attachment]
end

#watermark_attachment=(value) ⇒ Object



355
356
357
# File 'lib/files.com/models/bundle.rb', line 355

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

#watermark_attachment_deleteObject

boolean - If true, will delete the file stored in watermark_attachment



468
469
470
# File 'lib/files.com/models/bundle.rb', line 468

def watermark_attachment_delete
  @attributes[:watermark_attachment_delete]
end

#watermark_attachment_delete=(value) ⇒ Object



472
473
474
# File 'lib/files.com/models/bundle.rb', line 472

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

#watermark_attachment_fileObject

file - Preview watermark image applied to all bundle items.



459
460
461
# File 'lib/files.com/models/bundle.rb', line 459

def watermark_attachment_file
  @attributes[:watermark_attachment_file]
end

#watermark_attachment_file=(value) ⇒ Object



463
464
465
# File 'lib/files.com/models/bundle.rb', line 463

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

#watermark_valueObject

object - Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value



360
361
362
# File 'lib/files.com/models/bundle.rb', line 360

def watermark_value
  @attributes[:watermark_value]
end

#watermark_value=(value) ⇒ Object



364
365
366
# File 'lib/files.com/models/bundle.rb', line 364

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

#workspace_idObject

int64 - Workspace ID. ‘0` means the default workspace.



378
379
380
# File 'lib/files.com/models/bundle.rb', line 378

def workspace_id
  @attributes[:workspace_id]
end

#workspace_id=(value) ⇒ Object



382
383
384
# File 'lib/files.com/models/bundle.rb', line 382

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