files-com 1.6.208__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of files-com might be problematic. Click here for more details.

Files changed (126) hide show
  1. README.md +758 -0
  2. _VERSION +1 -0
  3. files_com-1.6.208.dist-info/METADATA +770 -0
  4. files_com-1.6.208.dist-info/RECORD +126 -0
  5. files_com-1.6.208.dist-info/WHEEL +5 -0
  6. files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.6.208.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +309 -0
  9. files_sdk/api.py +63 -0
  10. files_sdk/api_client.py +336 -0
  11. files_sdk/error.py +2981 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +119 -0
  14. files_sdk/models/account_line_item.py +51 -0
  15. files_sdk/models/action.py +49 -0
  16. files_sdk/models/action_notification_export.py +153 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/agent_push_update.py +44 -0
  19. files_sdk/models/api_key.py +318 -0
  20. files_sdk/models/api_request_log.py +105 -0
  21. files_sdk/models/app.py +89 -0
  22. files_sdk/models/as2_incoming_message.py +117 -0
  23. files_sdk/models/as2_outgoing_message.py +113 -0
  24. files_sdk/models/as2_partner.py +415 -0
  25. files_sdk/models/as2_station.py +282 -0
  26. files_sdk/models/auto.py +36 -0
  27. files_sdk/models/automation.py +823 -0
  28. files_sdk/models/automation_log.py +94 -0
  29. files_sdk/models/automation_run.py +112 -0
  30. files_sdk/models/bandwidth_snapshot.py +91 -0
  31. files_sdk/models/behavior.py +340 -0
  32. files_sdk/models/bundle.py +686 -0
  33. files_sdk/models/bundle_action.py +93 -0
  34. files_sdk/models/bundle_download.py +94 -0
  35. files_sdk/models/bundle_notification.py +252 -0
  36. files_sdk/models/bundle_path.py +37 -0
  37. files_sdk/models/bundle_recipient.py +133 -0
  38. files_sdk/models/bundle_registration.py +82 -0
  39. files_sdk/models/child_site_management_policy.py +278 -0
  40. files_sdk/models/clickwrap.py +268 -0
  41. files_sdk/models/dns_record.py +59 -0
  42. files_sdk/models/email_incoming_message.py +102 -0
  43. files_sdk/models/email_log.py +84 -0
  44. files_sdk/models/errors.py +37 -0
  45. files_sdk/models/exavault_api_request_log.py +102 -0
  46. files_sdk/models/external_event.py +148 -0
  47. files_sdk/models/file.py +851 -0
  48. files_sdk/models/file_action.py +39 -0
  49. files_sdk/models/file_comment.py +191 -0
  50. files_sdk/models/file_comment_reaction.py +125 -0
  51. files_sdk/models/file_migration.py +69 -0
  52. files_sdk/models/file_migration_log.py +88 -0
  53. files_sdk/models/file_upload_part.py +54 -0
  54. files_sdk/models/folder.py +186 -0
  55. files_sdk/models/form_field.py +43 -0
  56. files_sdk/models/form_field_set.py +265 -0
  57. files_sdk/models/ftp_action_log.py +104 -0
  58. files_sdk/models/gpg_key.py +333 -0
  59. files_sdk/models/group.py +338 -0
  60. files_sdk/models/group_user.py +235 -0
  61. files_sdk/models/history.py +236 -0
  62. files_sdk/models/history_export.py +238 -0
  63. files_sdk/models/history_export_result.py +98 -0
  64. files_sdk/models/holiday_region.py +58 -0
  65. files_sdk/models/image.py +37 -0
  66. files_sdk/models/inbound_s3_log.py +95 -0
  67. files_sdk/models/inbox_recipient.py +124 -0
  68. files_sdk/models/inbox_registration.py +79 -0
  69. files_sdk/models/inbox_upload.py +80 -0
  70. files_sdk/models/invoice.py +91 -0
  71. files_sdk/models/invoice_line_item.py +51 -0
  72. files_sdk/models/ip_address.py +119 -0
  73. files_sdk/models/key_lifecycle_rule.py +243 -0
  74. files_sdk/models/lock.py +174 -0
  75. files_sdk/models/message.py +244 -0
  76. files_sdk/models/message_comment.py +223 -0
  77. files_sdk/models/message_comment_reaction.py +181 -0
  78. files_sdk/models/message_reaction.py +170 -0
  79. files_sdk/models/notification.py +451 -0
  80. files_sdk/models/outbound_connection_log.py +105 -0
  81. files_sdk/models/partner.py +307 -0
  82. files_sdk/models/payment.py +91 -0
  83. files_sdk/models/payment_line_item.py +42 -0
  84. files_sdk/models/permission.py +190 -0
  85. files_sdk/models/preview.py +40 -0
  86. files_sdk/models/priority.py +63 -0
  87. files_sdk/models/project.py +205 -0
  88. files_sdk/models/public_hosting_request_log.py +101 -0
  89. files_sdk/models/public_ip_address.py +42 -0
  90. files_sdk/models/public_key.py +269 -0
  91. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  92. files_sdk/models/remote_mount_backend.py +438 -0
  93. files_sdk/models/remote_server.py +1854 -0
  94. files_sdk/models/remote_server_configuration_file.py +73 -0
  95. files_sdk/models/remote_server_credential.py +855 -0
  96. files_sdk/models/request.py +184 -0
  97. files_sdk/models/restore.py +142 -0
  98. files_sdk/models/scim_log.py +88 -0
  99. files_sdk/models/session.py +100 -0
  100. files_sdk/models/settings_change.py +71 -0
  101. files_sdk/models/sftp_action_log.py +108 -0
  102. files_sdk/models/sftp_host_key.py +215 -0
  103. files_sdk/models/share_group.py +228 -0
  104. files_sdk/models/share_group_member.py +41 -0
  105. files_sdk/models/siem_http_destination.py +1074 -0
  106. files_sdk/models/site.py +1289 -0
  107. files_sdk/models/snapshot.py +255 -0
  108. files_sdk/models/sso_strategy.py +168 -0
  109. files_sdk/models/status.py +42 -0
  110. files_sdk/models/style.py +152 -0
  111. files_sdk/models/sync.py +588 -0
  112. files_sdk/models/sync_log.py +86 -0
  113. files_sdk/models/sync_run.py +124 -0
  114. files_sdk/models/usage_by_top_level_dir.py +41 -0
  115. files_sdk/models/usage_daily_snapshot.py +93 -0
  116. files_sdk/models/usage_snapshot.py +73 -0
  117. files_sdk/models/user.py +1232 -0
  118. files_sdk/models/user_cipher_use.py +91 -0
  119. files_sdk/models/user_lifecycle_rule.py +355 -0
  120. files_sdk/models/user_request.py +166 -0
  121. files_sdk/models/user_sftp_client_use.py +68 -0
  122. files_sdk/models/web_dav_action_log.py +104 -0
  123. files_sdk/models/webhook_test.py +116 -0
  124. files_sdk/models/workspace.py +202 -0
  125. files_sdk/path_util.py +42 -0
  126. files_sdk/util.py +34 -0
@@ -0,0 +1,686 @@
1
+ import builtins # noqa: F401
2
+ from files_sdk.api import Api # noqa: F401
3
+ from files_sdk.list_obj import ListObj
4
+ from files_sdk.error import ( # noqa: F401
5
+ InvalidParameterError,
6
+ MissingParameterError,
7
+ NotImplementedError,
8
+ )
9
+
10
+
11
+ class Bundle:
12
+ default_attributes = {
13
+ "code": None, # string - Bundle code. This code forms the end part of the Public URL.
14
+ "color_left": None, # string - Page link and button color
15
+ "color_link": None, # string - Top bar link color
16
+ "color_text": None, # string - Page link and button color
17
+ "color_top": None, # string - Top bar background color
18
+ "color_top_text": None, # string - Top bar text color
19
+ "url": None, # string - Public URL of Share Link
20
+ "description": None, # string - Public description
21
+ "expires_at": None, # date-time - Bundle expiration date/time
22
+ "password_protected": None, # boolean - Is this bundle password protected?
23
+ "permissions": None, # string - Permissions that apply to Folders in this Share Link.
24
+ "preview_only": None, # boolean
25
+ "require_registration": None, # boolean - Show a registration page that captures the downloader's name and email address?
26
+ "require_share_recipient": None, # boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
27
+ "require_logout": None, # 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.
28
+ "clickwrap_body": None, # string - Legal text that must be agreed to prior to accessing Bundle.
29
+ "form_field_set": None, # FormFieldSet - Custom Form to use
30
+ "skip_name": None, # boolean - BundleRegistrations can be saved without providing name?
31
+ "skip_email": None, # boolean - BundleRegistrations can be saved without providing email?
32
+ "start_access_on_date": None, # date-time - Date when share will start to be accessible. If `nil` access granted right after create.
33
+ "skip_company": None, # boolean - BundleRegistrations can be saved without providing company?
34
+ "id": None, # int64 - Bundle ID
35
+ "created_at": None, # date-time - Bundle created at date/time
36
+ "dont_separate_submissions_by_folder": None, # 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.
37
+ "max_uses": None, # int64 - Maximum number of times bundle can be accessed
38
+ "note": None, # string - Bundle internal note
39
+ "path_template": None, # string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
40
+ "path_template_time_zone": None, # string - Timezone to use when rendering timestamps in path templates.
41
+ "send_email_receipt_to_uploader": None, # boolean - Send delivery receipt to the uploader. Note: For writable share only
42
+ "snapshot_id": None, # int64 - ID of the snapshot containing this bundle's contents.
43
+ "user_id": None, # int64 - Bundle creator user ID
44
+ "username": None, # string - Bundle creator username
45
+ "clickwrap_id": None, # int64 - ID of the clickwrap to use with this bundle.
46
+ "inbox_id": None, # int64 - ID of the associated inbox, if available.
47
+ "watermark_attachment": None, # Image - Preview watermark image applied to all bundle items.
48
+ "watermark_value": None, # object - Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
49
+ "has_inbox": None, # boolean - Does this bundle have an associated inbox?
50
+ "dont_allow_folders_in_uploads": None, # boolean - Should folder uploads be prevented?
51
+ "paths": None, # array(string) - A list of paths in this bundle. For performance reasons, this is not provided when listing bundles.
52
+ "bundlepaths": None, # array(object) - A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
53
+ "password": None, # string - Password for this bundle.
54
+ "form_field_set_id": None, # int64 - Id of Form Field Set to use with this bundle
55
+ "create_snapshot": None, # boolean - If true, create a snapshot of this bundle's contents.
56
+ "finalize_snapshot": None, # boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
57
+ "watermark_attachment_file": None, # file - Preview watermark image applied to all bundle items.
58
+ "watermark_attachment_delete": None, # boolean - If true, will delete the file stored in watermark_attachment
59
+ }
60
+
61
+ def __init__(self, attributes=None, options=None):
62
+ if not isinstance(attributes, dict):
63
+ attributes = {}
64
+ if not isinstance(options, dict):
65
+ options = {}
66
+ self.set_attributes(attributes)
67
+ self.options = options
68
+
69
+ def set_attributes(self, attributes):
70
+ for attribute, default_value in Bundle.default_attributes.items():
71
+ setattr(self, attribute, attributes.get(attribute, default_value))
72
+
73
+ def get_attributes(self):
74
+ return {
75
+ k: getattr(self, k, None)
76
+ for k in Bundle.default_attributes
77
+ if getattr(self, k, None) is not None
78
+ }
79
+
80
+ # Send email(s) with a link to bundle
81
+ #
82
+ # Parameters:
83
+ # to - array(string) - A list of email addresses to share this bundle with. Required unless `recipients` is used.
84
+ # note - string - Note to include in email.
85
+ # recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
86
+ def share(self, params=None):
87
+ if not isinstance(params, dict):
88
+ params = {}
89
+
90
+ if hasattr(self, "id") and self.id:
91
+ params["id"] = self.id
92
+ else:
93
+ raise MissingParameterError("Current object doesn't have a id")
94
+ if "id" not in params:
95
+ raise MissingParameterError("Parameter missing: id")
96
+ if "id" in params and not isinstance(params["id"], int):
97
+ raise InvalidParameterError("Bad parameter: id must be an int")
98
+ if "to" in params and not isinstance(params["to"], builtins.list):
99
+ raise InvalidParameterError("Bad parameter: to must be an list")
100
+ if "note" in params and not isinstance(params["note"], str):
101
+ raise InvalidParameterError("Bad parameter: note must be an str")
102
+ if "recipients" in params and not isinstance(
103
+ params["recipients"], builtins.list
104
+ ):
105
+ raise InvalidParameterError(
106
+ "Bad parameter: recipients must be an list"
107
+ )
108
+ Api.send_request(
109
+ "POST",
110
+ "/bundles/{id}/share".format(id=params["id"]),
111
+ params,
112
+ self.options,
113
+ )
114
+
115
+ # Parameters:
116
+ # paths - array(string) - A list of paths to include in this bundle.
117
+ # password - string - Password for this bundle.
118
+ # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
119
+ # clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
120
+ # code - string - Bundle code. This code forms the end part of the Public URL.
121
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
122
+ # description - string - Public description
123
+ # 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.
124
+ # expires_at - string - Bundle expiration date/time
125
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
126
+ # inbox_id - int64 - ID of the associated inbox, if available.
127
+ # max_uses - int64 - Maximum number of times bundle can be accessed
128
+ # note - string - Bundle internal note
129
+ # 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.
130
+ # path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
131
+ # permissions - string - Permissions that apply to Folders in this Share Link.
132
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
133
+ # require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
134
+ # send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
135
+ # skip_company - boolean - BundleRegistrations can be saved without providing company?
136
+ # start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
137
+ # skip_email - boolean - BundleRegistrations can be saved without providing email?
138
+ # skip_name - boolean - BundleRegistrations can be saved without providing name?
139
+ # user_id - int64 - The owning user id. Only site admins can set this.
140
+ # watermark_attachment_delete - boolean - If true, will delete the file stored in watermark_attachment
141
+ # watermark_attachment_file - file - Preview watermark image applied to all bundle items.
142
+ def update(self, params=None):
143
+ if not isinstance(params, dict):
144
+ params = {}
145
+
146
+ if hasattr(self, "id") and self.id:
147
+ params["id"] = self.id
148
+ else:
149
+ raise MissingParameterError("Current object doesn't have a id")
150
+ if "id" not in params:
151
+ raise MissingParameterError("Parameter missing: id")
152
+ if "id" in params and not isinstance(params["id"], int):
153
+ raise InvalidParameterError("Bad parameter: id must be an int")
154
+ if "paths" in params and not isinstance(
155
+ params["paths"], builtins.list
156
+ ):
157
+ raise InvalidParameterError("Bad parameter: paths must be an list")
158
+ if "password" in params and not isinstance(params["password"], str):
159
+ raise InvalidParameterError(
160
+ "Bad parameter: password must be an str"
161
+ )
162
+ if "form_field_set_id" in params and not isinstance(
163
+ params["form_field_set_id"], int
164
+ ):
165
+ raise InvalidParameterError(
166
+ "Bad parameter: form_field_set_id must be an int"
167
+ )
168
+ if "clickwrap_id" in params and not isinstance(
169
+ params["clickwrap_id"], int
170
+ ):
171
+ raise InvalidParameterError(
172
+ "Bad parameter: clickwrap_id must be an int"
173
+ )
174
+ if "code" in params and not isinstance(params["code"], str):
175
+ raise InvalidParameterError("Bad parameter: code must be an str")
176
+ if "description" in params and not isinstance(
177
+ params["description"], str
178
+ ):
179
+ raise InvalidParameterError(
180
+ "Bad parameter: description must be an str"
181
+ )
182
+ if "expires_at" in params and not isinstance(
183
+ params["expires_at"], str
184
+ ):
185
+ raise InvalidParameterError(
186
+ "Bad parameter: expires_at must be an str"
187
+ )
188
+ if "inbox_id" in params and not isinstance(params["inbox_id"], int):
189
+ raise InvalidParameterError(
190
+ "Bad parameter: inbox_id must be an int"
191
+ )
192
+ if "max_uses" in params and not isinstance(params["max_uses"], int):
193
+ raise InvalidParameterError(
194
+ "Bad parameter: max_uses must be an int"
195
+ )
196
+ if "note" in params and not isinstance(params["note"], str):
197
+ raise InvalidParameterError("Bad parameter: note must be an str")
198
+ if "path_template" in params and not isinstance(
199
+ params["path_template"], str
200
+ ):
201
+ raise InvalidParameterError(
202
+ "Bad parameter: path_template must be an str"
203
+ )
204
+ if "path_template_time_zone" in params and not isinstance(
205
+ params["path_template_time_zone"], str
206
+ ):
207
+ raise InvalidParameterError(
208
+ "Bad parameter: path_template_time_zone must be an str"
209
+ )
210
+ if "permissions" in params and not isinstance(
211
+ params["permissions"], str
212
+ ):
213
+ raise InvalidParameterError(
214
+ "Bad parameter: permissions must be an str"
215
+ )
216
+ if "start_access_on_date" in params and not isinstance(
217
+ params["start_access_on_date"], str
218
+ ):
219
+ raise InvalidParameterError(
220
+ "Bad parameter: start_access_on_date must be an str"
221
+ )
222
+ if "user_id" in params and not isinstance(params["user_id"], int):
223
+ raise InvalidParameterError(
224
+ "Bad parameter: user_id must be an int"
225
+ )
226
+ response, _options = Api.send_request(
227
+ "PATCH",
228
+ "/bundles/{id}".format(id=params["id"]),
229
+ params,
230
+ self.options,
231
+ )
232
+ return response.data
233
+
234
+ def delete(self, params=None):
235
+ if not isinstance(params, dict):
236
+ params = {}
237
+
238
+ if hasattr(self, "id") and self.id:
239
+ params["id"] = self.id
240
+ else:
241
+ raise MissingParameterError("Current object doesn't have a id")
242
+ if "id" not in params:
243
+ raise MissingParameterError("Parameter missing: id")
244
+ if "id" in params and not isinstance(params["id"], int):
245
+ raise InvalidParameterError("Bad parameter: id must be an int")
246
+ Api.send_request(
247
+ "DELETE",
248
+ "/bundles/{id}".format(id=params["id"]),
249
+ params,
250
+ self.options,
251
+ )
252
+
253
+ def destroy(self, params=None):
254
+ self.delete(params)
255
+
256
+ def save(self):
257
+ if hasattr(self, "id") and self.id:
258
+ new_obj = self.update(self.get_attributes())
259
+ self.set_attributes(new_obj.get_attributes())
260
+ return True
261
+ else:
262
+ new_obj = create(self.get_attributes(), self.options)
263
+ self.set_attributes(new_obj.get_attributes())
264
+ return True
265
+
266
+
267
+ # Parameters:
268
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
269
+ # 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.
270
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
271
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
272
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
273
+ # 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`.
274
+ # 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`.
275
+ # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
276
+ # 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`.
277
+ # 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`.
278
+ def list(params=None, options=None):
279
+ if not isinstance(params, dict):
280
+ params = {}
281
+ if not isinstance(options, dict):
282
+ options = {}
283
+ if "user_id" in params and not isinstance(params["user_id"], int):
284
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
285
+ if "cursor" in params and not isinstance(params["cursor"], str):
286
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
287
+ if "per_page" in params and not isinstance(params["per_page"], int):
288
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
289
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
290
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
291
+ if "filter" in params and not isinstance(params["filter"], dict):
292
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
293
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
294
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
295
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
296
+ raise InvalidParameterError(
297
+ "Bad parameter: filter_gteq must be an dict"
298
+ )
299
+ if "filter_prefix" in params and not isinstance(
300
+ params["filter_prefix"], dict
301
+ ):
302
+ raise InvalidParameterError(
303
+ "Bad parameter: filter_prefix must be an dict"
304
+ )
305
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
306
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
307
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
308
+ raise InvalidParameterError(
309
+ "Bad parameter: filter_lteq must be an dict"
310
+ )
311
+ return ListObj(Bundle, "GET", "/bundles", params, options)
312
+
313
+
314
+ def all(params=None, options=None):
315
+ list(params, options)
316
+
317
+
318
+ # Parameters:
319
+ # id (required) - int64 - Bundle ID.
320
+ def find(id, params=None, options=None):
321
+ if not isinstance(params, dict):
322
+ params = {}
323
+ if not isinstance(options, dict):
324
+ options = {}
325
+ params["id"] = id
326
+ if "id" in params and not isinstance(params["id"], int):
327
+ raise InvalidParameterError("Bad parameter: id must be an int")
328
+ if "id" not in params:
329
+ raise MissingParameterError("Parameter missing: id")
330
+ response, options = Api.send_request(
331
+ "GET", "/bundles/{id}".format(id=params["id"]), params, options
332
+ )
333
+ return Bundle(response.data, options)
334
+
335
+
336
+ def get(id, params=None, options=None):
337
+ find(id, params, options)
338
+
339
+
340
+ # Parameters:
341
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
342
+ # paths (required) - array(string) - A list of paths to include in this bundle.
343
+ # password - string - Password for this bundle.
344
+ # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
345
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
346
+ # 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.
347
+ # expires_at - string - Bundle expiration date/time
348
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
349
+ # max_uses - int64 - Maximum number of times bundle can be accessed
350
+ # description - string - Public description
351
+ # note - string - Bundle internal note
352
+ # code - string - Bundle code. This code forms the end part of the Public URL.
353
+ # 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.
354
+ # path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
355
+ # permissions - string - Permissions that apply to Folders in this Share Link.
356
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
357
+ # clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
358
+ # inbox_id - int64 - ID of the associated inbox, if available.
359
+ # require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
360
+ # send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
361
+ # skip_email - boolean - BundleRegistrations can be saved without providing email?
362
+ # skip_name - boolean - BundleRegistrations can be saved without providing name?
363
+ # skip_company - boolean - BundleRegistrations can be saved without providing company?
364
+ # start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
365
+ # snapshot_id - int64 - ID of the snapshot containing this bundle's contents.
366
+ # watermark_attachment_file - file - Preview watermark image applied to all bundle items.
367
+ def create(params=None, options=None):
368
+ if not isinstance(params, dict):
369
+ params = {}
370
+ if not isinstance(options, dict):
371
+ options = {}
372
+ if "user_id" in params and not isinstance(params["user_id"], int):
373
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
374
+ if "paths" in params and not isinstance(params["paths"], builtins.list):
375
+ raise InvalidParameterError("Bad parameter: paths must be an list")
376
+ if "password" in params and not isinstance(params["password"], str):
377
+ raise InvalidParameterError("Bad parameter: password must be an str")
378
+ if "form_field_set_id" in params and not isinstance(
379
+ params["form_field_set_id"], int
380
+ ):
381
+ raise InvalidParameterError(
382
+ "Bad parameter: form_field_set_id must be an int"
383
+ )
384
+ if "create_snapshot" in params and not isinstance(
385
+ params["create_snapshot"], bool
386
+ ):
387
+ raise InvalidParameterError(
388
+ "Bad parameter: create_snapshot must be an bool"
389
+ )
390
+ if "dont_separate_submissions_by_folder" in params and not isinstance(
391
+ params["dont_separate_submissions_by_folder"], bool
392
+ ):
393
+ raise InvalidParameterError(
394
+ "Bad parameter: dont_separate_submissions_by_folder must be an bool"
395
+ )
396
+ if "expires_at" in params and not isinstance(params["expires_at"], str):
397
+ raise InvalidParameterError("Bad parameter: expires_at must be an str")
398
+ if "finalize_snapshot" in params and not isinstance(
399
+ params["finalize_snapshot"], bool
400
+ ):
401
+ raise InvalidParameterError(
402
+ "Bad parameter: finalize_snapshot must be an bool"
403
+ )
404
+ if "max_uses" in params and not isinstance(params["max_uses"], int):
405
+ raise InvalidParameterError("Bad parameter: max_uses must be an int")
406
+ if "description" in params and not isinstance(params["description"], str):
407
+ raise InvalidParameterError(
408
+ "Bad parameter: description must be an str"
409
+ )
410
+ if "note" in params and not isinstance(params["note"], str):
411
+ raise InvalidParameterError("Bad parameter: note must be an str")
412
+ if "code" in params and not isinstance(params["code"], str):
413
+ raise InvalidParameterError("Bad parameter: code must be an str")
414
+ if "path_template" in params and not isinstance(
415
+ params["path_template"], str
416
+ ):
417
+ raise InvalidParameterError(
418
+ "Bad parameter: path_template must be an str"
419
+ )
420
+ if "path_template_time_zone" in params and not isinstance(
421
+ params["path_template_time_zone"], str
422
+ ):
423
+ raise InvalidParameterError(
424
+ "Bad parameter: path_template_time_zone must be an str"
425
+ )
426
+ if "permissions" in params and not isinstance(params["permissions"], str):
427
+ raise InvalidParameterError(
428
+ "Bad parameter: permissions must be an str"
429
+ )
430
+ if "require_registration" in params and not isinstance(
431
+ params["require_registration"], bool
432
+ ):
433
+ raise InvalidParameterError(
434
+ "Bad parameter: require_registration must be an bool"
435
+ )
436
+ if "clickwrap_id" in params and not isinstance(
437
+ params["clickwrap_id"], int
438
+ ):
439
+ raise InvalidParameterError(
440
+ "Bad parameter: clickwrap_id must be an int"
441
+ )
442
+ if "inbox_id" in params and not isinstance(params["inbox_id"], int):
443
+ raise InvalidParameterError("Bad parameter: inbox_id must be an int")
444
+ if "require_share_recipient" in params and not isinstance(
445
+ params["require_share_recipient"], bool
446
+ ):
447
+ raise InvalidParameterError(
448
+ "Bad parameter: require_share_recipient must be an bool"
449
+ )
450
+ if "send_email_receipt_to_uploader" in params and not isinstance(
451
+ params["send_email_receipt_to_uploader"], bool
452
+ ):
453
+ raise InvalidParameterError(
454
+ "Bad parameter: send_email_receipt_to_uploader must be an bool"
455
+ )
456
+ if "skip_email" in params and not isinstance(params["skip_email"], bool):
457
+ raise InvalidParameterError(
458
+ "Bad parameter: skip_email must be an bool"
459
+ )
460
+ if "skip_name" in params and not isinstance(params["skip_name"], bool):
461
+ raise InvalidParameterError("Bad parameter: skip_name must be an bool")
462
+ if "skip_company" in params and not isinstance(
463
+ params["skip_company"], bool
464
+ ):
465
+ raise InvalidParameterError(
466
+ "Bad parameter: skip_company must be an bool"
467
+ )
468
+ if "start_access_on_date" in params and not isinstance(
469
+ params["start_access_on_date"], str
470
+ ):
471
+ raise InvalidParameterError(
472
+ "Bad parameter: start_access_on_date must be an str"
473
+ )
474
+ if "snapshot_id" in params and not isinstance(params["snapshot_id"], int):
475
+ raise InvalidParameterError(
476
+ "Bad parameter: snapshot_id must be an int"
477
+ )
478
+ if "paths" not in params:
479
+ raise MissingParameterError("Parameter missing: paths")
480
+ response, options = Api.send_request("POST", "/bundles", params, options)
481
+ return Bundle(response.data, options)
482
+
483
+
484
+ # Send email(s) with a link to bundle
485
+ #
486
+ # Parameters:
487
+ # to - array(string) - A list of email addresses to share this bundle with. Required unless `recipients` is used.
488
+ # note - string - Note to include in email.
489
+ # recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
490
+ def share(id, params=None, options=None):
491
+ if not isinstance(params, dict):
492
+ params = {}
493
+ if not isinstance(options, dict):
494
+ options = {}
495
+ params["id"] = id
496
+ if "id" in params and not isinstance(params["id"], int):
497
+ raise InvalidParameterError("Bad parameter: id must be an int")
498
+ if "to" in params and not isinstance(params["to"], builtins.list):
499
+ raise InvalidParameterError("Bad parameter: to must be an list")
500
+ if "note" in params and not isinstance(params["note"], str):
501
+ raise InvalidParameterError("Bad parameter: note must be an str")
502
+ if "recipients" in params and not isinstance(
503
+ params["recipients"], builtins.list
504
+ ):
505
+ raise InvalidParameterError(
506
+ "Bad parameter: recipients must be an list"
507
+ )
508
+ if "id" not in params:
509
+ raise MissingParameterError("Parameter missing: id")
510
+ Api.send_request(
511
+ "POST", "/bundles/{id}/share".format(id=params["id"]), params, options
512
+ )
513
+
514
+
515
+ # Parameters:
516
+ # paths - array(string) - A list of paths to include in this bundle.
517
+ # password - string - Password for this bundle.
518
+ # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
519
+ # clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
520
+ # code - string - Bundle code. This code forms the end part of the Public URL.
521
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
522
+ # description - string - Public description
523
+ # 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.
524
+ # expires_at - string - Bundle expiration date/time
525
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
526
+ # inbox_id - int64 - ID of the associated inbox, if available.
527
+ # max_uses - int64 - Maximum number of times bundle can be accessed
528
+ # note - string - Bundle internal note
529
+ # 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.
530
+ # path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
531
+ # permissions - string - Permissions that apply to Folders in this Share Link.
532
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
533
+ # require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
534
+ # send_email_receipt_to_uploader - boolean - Send delivery receipt to the uploader. Note: For writable share only
535
+ # skip_company - boolean - BundleRegistrations can be saved without providing company?
536
+ # start_access_on_date - string - Date when share will start to be accessible. If `nil` access granted right after create.
537
+ # skip_email - boolean - BundleRegistrations can be saved without providing email?
538
+ # skip_name - boolean - BundleRegistrations can be saved without providing name?
539
+ # user_id - int64 - The owning user id. Only site admins can set this.
540
+ # watermark_attachment_delete - boolean - If true, will delete the file stored in watermark_attachment
541
+ # watermark_attachment_file - file - Preview watermark image applied to all bundle items.
542
+ def update(id, params=None, options=None):
543
+ if not isinstance(params, dict):
544
+ params = {}
545
+ if not isinstance(options, dict):
546
+ options = {}
547
+ params["id"] = id
548
+ if "id" in params and not isinstance(params["id"], int):
549
+ raise InvalidParameterError("Bad parameter: id must be an int")
550
+ if "paths" in params and not isinstance(params["paths"], builtins.list):
551
+ raise InvalidParameterError("Bad parameter: paths must be an list")
552
+ if "password" in params and not isinstance(params["password"], str):
553
+ raise InvalidParameterError("Bad parameter: password must be an str")
554
+ if "form_field_set_id" in params and not isinstance(
555
+ params["form_field_set_id"], int
556
+ ):
557
+ raise InvalidParameterError(
558
+ "Bad parameter: form_field_set_id must be an int"
559
+ )
560
+ if "clickwrap_id" in params and not isinstance(
561
+ params["clickwrap_id"], int
562
+ ):
563
+ raise InvalidParameterError(
564
+ "Bad parameter: clickwrap_id must be an int"
565
+ )
566
+ if "code" in params and not isinstance(params["code"], str):
567
+ raise InvalidParameterError("Bad parameter: code must be an str")
568
+ if "create_snapshot" in params and not isinstance(
569
+ params["create_snapshot"], bool
570
+ ):
571
+ raise InvalidParameterError(
572
+ "Bad parameter: create_snapshot must be an bool"
573
+ )
574
+ if "description" in params and not isinstance(params["description"], str):
575
+ raise InvalidParameterError(
576
+ "Bad parameter: description must be an str"
577
+ )
578
+ if "dont_separate_submissions_by_folder" in params and not isinstance(
579
+ params["dont_separate_submissions_by_folder"], bool
580
+ ):
581
+ raise InvalidParameterError(
582
+ "Bad parameter: dont_separate_submissions_by_folder must be an bool"
583
+ )
584
+ if "expires_at" in params and not isinstance(params["expires_at"], str):
585
+ raise InvalidParameterError("Bad parameter: expires_at must be an str")
586
+ if "finalize_snapshot" in params and not isinstance(
587
+ params["finalize_snapshot"], bool
588
+ ):
589
+ raise InvalidParameterError(
590
+ "Bad parameter: finalize_snapshot must be an bool"
591
+ )
592
+ if "inbox_id" in params and not isinstance(params["inbox_id"], int):
593
+ raise InvalidParameterError("Bad parameter: inbox_id must be an int")
594
+ if "max_uses" in params and not isinstance(params["max_uses"], int):
595
+ raise InvalidParameterError("Bad parameter: max_uses must be an int")
596
+ if "note" in params and not isinstance(params["note"], str):
597
+ raise InvalidParameterError("Bad parameter: note must be an str")
598
+ if "path_template" in params and not isinstance(
599
+ params["path_template"], str
600
+ ):
601
+ raise InvalidParameterError(
602
+ "Bad parameter: path_template must be an str"
603
+ )
604
+ if "path_template_time_zone" in params and not isinstance(
605
+ params["path_template_time_zone"], str
606
+ ):
607
+ raise InvalidParameterError(
608
+ "Bad parameter: path_template_time_zone must be an str"
609
+ )
610
+ if "permissions" in params and not isinstance(params["permissions"], str):
611
+ raise InvalidParameterError(
612
+ "Bad parameter: permissions must be an str"
613
+ )
614
+ if "require_registration" in params and not isinstance(
615
+ params["require_registration"], bool
616
+ ):
617
+ raise InvalidParameterError(
618
+ "Bad parameter: require_registration must be an bool"
619
+ )
620
+ if "require_share_recipient" in params and not isinstance(
621
+ params["require_share_recipient"], bool
622
+ ):
623
+ raise InvalidParameterError(
624
+ "Bad parameter: require_share_recipient must be an bool"
625
+ )
626
+ if "send_email_receipt_to_uploader" in params and not isinstance(
627
+ params["send_email_receipt_to_uploader"], bool
628
+ ):
629
+ raise InvalidParameterError(
630
+ "Bad parameter: send_email_receipt_to_uploader must be an bool"
631
+ )
632
+ if "skip_company" in params and not isinstance(
633
+ params["skip_company"], bool
634
+ ):
635
+ raise InvalidParameterError(
636
+ "Bad parameter: skip_company must be an bool"
637
+ )
638
+ if "start_access_on_date" in params and not isinstance(
639
+ params["start_access_on_date"], str
640
+ ):
641
+ raise InvalidParameterError(
642
+ "Bad parameter: start_access_on_date must be an str"
643
+ )
644
+ if "skip_email" in params and not isinstance(params["skip_email"], bool):
645
+ raise InvalidParameterError(
646
+ "Bad parameter: skip_email must be an bool"
647
+ )
648
+ if "skip_name" in params and not isinstance(params["skip_name"], bool):
649
+ raise InvalidParameterError("Bad parameter: skip_name must be an bool")
650
+ if "user_id" in params and not isinstance(params["user_id"], int):
651
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
652
+ if "watermark_attachment_delete" in params and not isinstance(
653
+ params["watermark_attachment_delete"], bool
654
+ ):
655
+ raise InvalidParameterError(
656
+ "Bad parameter: watermark_attachment_delete must be an bool"
657
+ )
658
+ if "id" not in params:
659
+ raise MissingParameterError("Parameter missing: id")
660
+ response, options = Api.send_request(
661
+ "PATCH", "/bundles/{id}".format(id=params["id"]), params, options
662
+ )
663
+ return Bundle(response.data, options)
664
+
665
+
666
+ def delete(id, params=None, options=None):
667
+ if not isinstance(params, dict):
668
+ params = {}
669
+ if not isinstance(options, dict):
670
+ options = {}
671
+ params["id"] = id
672
+ if "id" in params and not isinstance(params["id"], int):
673
+ raise InvalidParameterError("Bad parameter: id must be an int")
674
+ if "id" not in params:
675
+ raise MissingParameterError("Parameter missing: id")
676
+ Api.send_request(
677
+ "DELETE", "/bundles/{id}".format(id=params["id"]), params, options
678
+ )
679
+
680
+
681
+ def destroy(id, params=None, options=None):
682
+ delete(id, params, options)
683
+
684
+
685
+ def new(*args, **kwargs):
686
+ return Bundle(*args, **kwargs)