files-com 1.5.0__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 (113) hide show
  1. README.md +682 -0
  2. _VERSION +1 -0
  3. files_com-1.5.0.dist-info/METADATA +694 -0
  4. files_com-1.5.0.dist-info/RECORD +113 -0
  5. files_com-1.5.0.dist-info/WHEEL +5 -0
  6. files_com-1.5.0.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.5.0.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +270 -0
  9. files_sdk/api.py +57 -0
  10. files_sdk/api_client.py +327 -0
  11. files_sdk/error.py +2891 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +104 -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 +147 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/api_key.py +322 -0
  19. files_sdk/models/api_request_log.py +87 -0
  20. files_sdk/models/app.py +89 -0
  21. files_sdk/models/as2_incoming_message.py +123 -0
  22. files_sdk/models/as2_outgoing_message.py +119 -0
  23. files_sdk/models/as2_partner.py +374 -0
  24. files_sdk/models/as2_station.py +271 -0
  25. files_sdk/models/auto.py +36 -0
  26. files_sdk/models/automation.py +691 -0
  27. files_sdk/models/automation_log.py +77 -0
  28. files_sdk/models/automation_run.py +108 -0
  29. files_sdk/models/bandwidth_snapshot.py +91 -0
  30. files_sdk/models/behavior.py +334 -0
  31. files_sdk/models/bundle.py +550 -0
  32. files_sdk/models/bundle_action.py +86 -0
  33. files_sdk/models/bundle_download.py +94 -0
  34. files_sdk/models/bundle_notification.py +217 -0
  35. files_sdk/models/bundle_path.py +37 -0
  36. files_sdk/models/bundle_recipient.py +120 -0
  37. files_sdk/models/bundle_registration.py +79 -0
  38. files_sdk/models/clickwrap.py +268 -0
  39. files_sdk/models/dns_record.py +59 -0
  40. files_sdk/models/email_incoming_message.py +102 -0
  41. files_sdk/models/email_log.py +74 -0
  42. files_sdk/models/errors.py +37 -0
  43. files_sdk/models/exavault_api_request_log.py +85 -0
  44. files_sdk/models/external_event.py +148 -0
  45. files_sdk/models/file.py +791 -0
  46. files_sdk/models/file_action.py +39 -0
  47. files_sdk/models/file_comment.py +191 -0
  48. files_sdk/models/file_comment_reaction.py +125 -0
  49. files_sdk/models/file_migration.py +69 -0
  50. files_sdk/models/file_migration_log.py +78 -0
  51. files_sdk/models/file_upload_part.py +54 -0
  52. files_sdk/models/folder.py +154 -0
  53. files_sdk/models/form_field.py +43 -0
  54. files_sdk/models/form_field_set.py +240 -0
  55. files_sdk/models/ftp_action_log.py +87 -0
  56. files_sdk/models/gpg_key.py +254 -0
  57. files_sdk/models/group.py +276 -0
  58. files_sdk/models/group_user.py +231 -0
  59. files_sdk/models/history.py +236 -0
  60. files_sdk/models/history_export.py +238 -0
  61. files_sdk/models/history_export_result.py +98 -0
  62. files_sdk/models/image.py +37 -0
  63. files_sdk/models/inbox_recipient.py +118 -0
  64. files_sdk/models/inbox_registration.py +79 -0
  65. files_sdk/models/inbox_upload.py +80 -0
  66. files_sdk/models/invoice.py +91 -0
  67. files_sdk/models/invoice_line_item.py +46 -0
  68. files_sdk/models/ip_address.py +119 -0
  69. files_sdk/models/lock.py +158 -0
  70. files_sdk/models/message.py +244 -0
  71. files_sdk/models/message_comment.py +223 -0
  72. files_sdk/models/message_comment_reaction.py +181 -0
  73. files_sdk/models/message_reaction.py +170 -0
  74. files_sdk/models/notification.py +357 -0
  75. files_sdk/models/outbound_connection_log.py +88 -0
  76. files_sdk/models/payment.py +91 -0
  77. files_sdk/models/payment_line_item.py +42 -0
  78. files_sdk/models/permission.py +174 -0
  79. files_sdk/models/preview.py +40 -0
  80. files_sdk/models/priority.py +63 -0
  81. files_sdk/models/project.py +205 -0
  82. files_sdk/models/public_hosting_request_log.py +82 -0
  83. files_sdk/models/public_ip_address.py +42 -0
  84. files_sdk/models/public_key.py +212 -0
  85. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  86. files_sdk/models/remote_server.py +1677 -0
  87. files_sdk/models/remote_server_configuration_file.py +72 -0
  88. files_sdk/models/request.py +180 -0
  89. files_sdk/models/restore.py +104 -0
  90. files_sdk/models/session.py +100 -0
  91. files_sdk/models/settings_change.py +71 -0
  92. files_sdk/models/sftp_action_log.py +91 -0
  93. files_sdk/models/sftp_host_key.py +215 -0
  94. files_sdk/models/share_group.py +228 -0
  95. files_sdk/models/share_group_member.py +41 -0
  96. files_sdk/models/siem_http_destination.py +773 -0
  97. files_sdk/models/site.py +767 -0
  98. files_sdk/models/snapshot.py +255 -0
  99. files_sdk/models/sso_strategy.py +167 -0
  100. files_sdk/models/status.py +42 -0
  101. files_sdk/models/style.py +152 -0
  102. files_sdk/models/sync_log.py +75 -0
  103. files_sdk/models/usage_by_top_level_dir.py +41 -0
  104. files_sdk/models/usage_daily_snapshot.py +93 -0
  105. files_sdk/models/usage_snapshot.py +73 -0
  106. files_sdk/models/user.py +893 -0
  107. files_sdk/models/user_cipher_use.py +68 -0
  108. files_sdk/models/user_request.py +166 -0
  109. files_sdk/models/user_sftp_client_use.py +68 -0
  110. files_sdk/models/web_dav_action_log.py +87 -0
  111. files_sdk/models/webhook_test.py +104 -0
  112. files_sdk/path_util.py +42 -0
  113. files_sdk/util.py +34 -0
@@ -0,0 +1,694 @@
1
+ Metadata-Version: 2.4
2
+ Name: files_com
3
+ Version: 1.5.0
4
+ Summary: Python bindings for the Files.com API
5
+ License: MIT
6
+ Requires-Python: >=3.5
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: requests>=2.20
10
+ Requires-Dist: requests-toolbelt>=1.0.0
11
+ Dynamic: license-file
12
+
13
+ # Files.com Python Client
14
+
15
+ The content included here should be enough to get started, but please visit our
16
+ [Developer Documentation Website](https://developers.files.com/python/) for the complete documentation.
17
+
18
+ ## Introduction
19
+
20
+ The Files.com Python package is the best way to use Files.com from applications written in the Python language.
21
+
22
+ Files.com customers use our Python package for directly working with files and folders as well as performing management tasks such as adding/removing users, onboarding counterparties, retrieving information about automations and more.
23
+
24
+ Every function in the Files.com application is available via Python. Nothing is excluded.
25
+
26
+ This package is officially supported by Files.com for Python 3.8+. Prior versions of Python are considered end-of-life by the Python Software Foundation and Files.com only supports environments that are still supported by their vendor. With that said, we believe that this package works in Python 3.5-3.7 as well.
27
+
28
+ The Python package uses the Files.com RESTful APIs via the HTTPS protocol (port 443) to securely communicate and transfer files so no firewall changes should be required in order to allow connectivity to Files.com.
29
+
30
+ ### Installation
31
+
32
+ Use `pip` to install the latest version of the `Files.com` package.
33
+
34
+ ```shell
35
+ pip3 install Files.com
36
+ ```
37
+
38
+ Files.com automatically pushes a new release to PIP every time a commit is made to the `master` branch on GitHub, so there is no benefit in directly linking the package from GitHub.
39
+
40
+ ### Files.com is Committed to Python
41
+
42
+ Python is the most commonly used language for custom integrations to Files.com. Our Files.com Desktop v6 application (that we publish) is also written in Python, using this exact same package.
43
+
44
+ Explore the [files-sdk-python](https://github.com/Files-com/files-sdk-python) code on GitHub.
45
+
46
+ ### Getting Support
47
+
48
+ The Files.com Support team provides official support for all of our official Files.com integration tools.
49
+
50
+ To initiate a support conversation, you can send an [Authenticated Support Request](https://www.files.com/docs/overview/requesting-support) or simply send an E-Mail to support@files.com.
51
+
52
+ ## Authentication
53
+
54
+ There are two ways to authenticate: API Key authentication and Session-based authentication.
55
+
56
+ ### Authenticate with an API Key
57
+
58
+ Authenticating with an API key is the recommended authentication method for most scenarios, and is
59
+ the method used in the examples on this site.
60
+
61
+ To use an API Key, first generate an API key from the [web
62
+ interface](https://www.files.com/docs/sdk-and-apis/api-keys) or [via the API or an
63
+ SDK](/python/resources/developers/api-keys).
64
+
65
+ Note that when using a user-specific API key, if the user is an administrator, you will have full
66
+ access to the entire API. If the user is not an administrator, you will only be able to access files
67
+ that user can access, and no access will be granted to site administration functions in the API.
68
+
69
+ ```python title="Example Request"
70
+ import files_sdk
71
+
72
+ files_sdk.set_api_key("YOUR_API_KEY")
73
+
74
+ ## Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
75
+ try:
76
+ files_sdk.user.list(params, {"api_key": "YOUR_API_KEY"})
77
+ except files_sdk.error.NotAuthenticatedError as err:
78
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
79
+ except files_sdk.error.Error as err:
80
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
81
+ ```
82
+
83
+ Don't forget to replace the placeholder, `YOUR_API_KEY`, with your actual API key.
84
+
85
+ ### Authenticate with a Session
86
+
87
+ You can also authenticate by creating a user session using the username and
88
+ password of an active user. If the user is an administrator, the session will have full access to
89
+ all capabilities of Files.com. Sessions created from regular user accounts will only be able to access files that
90
+ user can access, and no access will be granted to site administration functions.
91
+
92
+ Sessions use the exact same session timeout settings as web interface sessions. When a
93
+ session times out, simply create a new session and resume where you left off. This process is not
94
+ automatically handled by our SDKs because we do not want to store password information in memory without
95
+ your explicit consent.
96
+
97
+ #### Logging In
98
+
99
+ To create a session, the `create` method is called on the `files_sdk` object with the user's username and
100
+ password.
101
+
102
+ This returns a session object that can be used to authenticate SDK method calls.
103
+
104
+ ```python title="Example Request"
105
+ import files_sdk
106
+
107
+ try:
108
+ session = files_sdk.session.create({ "username": "motor", "password": "vroom" })
109
+ except files_sdk.error.NotAuthenticatedError as err:
110
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
111
+ except files_sdk.error.Error as err:
112
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
113
+ ```
114
+
115
+ #### Using a Session
116
+
117
+ Once a session has been created, you can store the session globally, use the session per object, or use the session per request to authenticate SDK operations.
118
+
119
+ ```python title="Example Request"
120
+ import files_sdk
121
+
122
+ ## You may set the returned session to be used by default for subsequent requests.
123
+ files_sdk.set_session(session)
124
+
125
+ try:
126
+ # Alternatively, you can specify the session ID on a per-object basis in the second parameter to a model constructor.
127
+ user = files_sdk.user.User(params, {"session_id": session.id})
128
+
129
+ # You may also specify the session ID on a per-request basis in the final parameter to static methods.
130
+ files_sdk.user.find(id, params, {"session_id": session.id})
131
+ except files_sdk.error.NotAuthenticatedError as err:
132
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
133
+ except files_sdk.error.Error as err:
134
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
135
+ ```
136
+
137
+ #### Logging Out
138
+
139
+ User sessions can be ended calling the `destroy` method on the `session` object.
140
+
141
+ ```python title="Example Request"
142
+ session.destroy()
143
+ ```
144
+
145
+ ## Configuration
146
+
147
+ Global configuration is performed by setting attributes on the `files_sdk` object.
148
+
149
+ ### Configuration Options
150
+
151
+ #### Base URL
152
+
153
+ Setting the base URL for the API is required if your site is configured to disable global acceleration.
154
+ This can also be set to use a mock server in development or CI.
155
+
156
+ ```python title="Example setting"
157
+ import files_sdk
158
+
159
+ files_sdk.base_url = "https://SUBDOMAIN.files.com"
160
+ ```
161
+
162
+ #### Log Level
163
+
164
+ This SDK utilizes the standard Python logging framework. It will respect the global log level
165
+ and you can set the module specific log level and other logging settings by getting the logger
166
+ object in the standard manner as shown below:
167
+
168
+ ```python title="Example setting"
169
+ import logging
170
+
171
+ logging.getLogger("files_sdk")
172
+ ```
173
+
174
+ #### Console Log Level
175
+
176
+ Enables printing of messages to stderr in addition to normal logging.
177
+
178
+ Allowed values are:
179
+
180
+ * `None`
181
+ * "info"
182
+ * "debug"
183
+
184
+ ```python title="Example setting"
185
+ import files_sdk
186
+
187
+ files_sdk.console_log_level = "info"
188
+ ```
189
+
190
+ #### Open Timeout
191
+
192
+ Open timeout in seconds. The default value is 30.
193
+
194
+ ```python title="Example setting"
195
+ import files_sdk
196
+
197
+ files_sdk.open_timeout = 60
198
+ ```
199
+
200
+ #### Read Timeout
201
+
202
+ Read timeout in seconds. The default value is 60.
203
+
204
+ ```python title="Example setting"
205
+ import files_sdk
206
+
207
+ files_sdk.read_timeout = 90
208
+ ```
209
+
210
+ #### Initial Network Retry Delay
211
+
212
+ Initial retry delay in seconds. The default value is 0.5.
213
+
214
+ ```python title="Example setting"
215
+ import files_sdk
216
+
217
+ files_sdk.initial_network_retry_delay = 1
218
+ ```
219
+
220
+ #### Maximum Retry Delay
221
+
222
+ Maximum network retry delay in seconds. The default value is 2.
223
+
224
+ ```python title="Example setting"
225
+ import files_sdk
226
+
227
+ files_sdk.max_network_retry_delay = 5
228
+ ```
229
+
230
+ #### Maximum Network Retries
231
+
232
+ Maximum number of retries. The default value is 3.
233
+
234
+ ```python title="Example setting"
235
+ import files_sdk
236
+
237
+ files_sdk.max_network_retries = 5
238
+ ```
239
+
240
+ #### Source IP
241
+
242
+ Configure the local IP address from which to send requests.
243
+
244
+ ```python title="Example setting"
245
+ import files_sdk
246
+
247
+ files_sdk.source_ip = '10.1.2.3'
248
+ ```
249
+
250
+ ## Sort and Filter
251
+
252
+ Several of the Files.com API resources have list operations that return multiple instances of the
253
+ resource. The List operations can be sorted and filtered.
254
+
255
+ ### Sorting
256
+
257
+ To sort the returned data, pass in the ```sort_by``` method argument.
258
+
259
+ Each resource supports a unique set of valid sort fields and can only be sorted by one field at a
260
+ time.
261
+
262
+ The argument value is a Python dictionary that has a key of the resource field name sort on and a
263
+ value of either ```"asc"``` or ```"desc"``` to specify the sort order.
264
+
265
+ ```python title="Sort Example"
266
+ import files_sdk
267
+
268
+ try:
269
+ # users sorted by username
270
+ users = files_sdk.user.list({
271
+ "sort_by": { "username": "asc" }
272
+ })
273
+ for user in users.auto_paging_iter():
274
+ # Operate on user
275
+ except files_sdk.error.NotAuthenticatedError as err:
276
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
277
+ except files_sdk.error.Error as err:
278
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
279
+ ```
280
+
281
+ ### Filtering
282
+
283
+ Filters apply selection criteria to the underlying query that returns the results. They can be
284
+ applied individually or combined with other filters, and the resulting data can be sorted by a
285
+ single field.
286
+
287
+ Each resource supports a unique set of valid filter fields, filter combinations, and combinations of
288
+ filters and sort fields.
289
+
290
+ The passed in argument value is a Python dictionary that has a key of the resource field name to
291
+ filter on and a passed in value to use in the filter comparison.
292
+
293
+ #### Filter Types
294
+
295
+ | Filter | Type | Description |
296
+ | --------- | --------- | --------- |
297
+ | `filter` | Exact | Find resources that have an exact field value match to a passed in value. (i.e., FIELD_VALUE = PASS_IN_VALUE). |
298
+ | `filter_prefix` | Pattern | Find resources where the specified field is prefixed by the supplied value. This is applicable to values that are strings. |
299
+ | `filter_gt` | Range | Find resources that have a field value that is greater than the passed in value. (i.e., FIELD_VALUE > PASS_IN_VALUE). |
300
+ | `filter_gteq` | Range | Find resources that have a field value that is greater than or equal to the passed in value. (i.e., FIELD_VALUE >= PASS_IN_VALUE). |
301
+ | `filter_lt` | Range | Find resources that have a field value that is less than the passed in value. (i.e., FIELD_VALUE < PASS_IN_VALUE). |
302
+ | `filter_lteq` | Range | Find resources that have a field value that is less than or equal to the passed in value. (i.e., FIELD_VALUE \<= PASS_IN_VALUE). |
303
+
304
+ ```python title="Exact Filter Example"
305
+ import files_sdk
306
+
307
+ try:
308
+ # non admin users
309
+ users = files_sdk.user.list({
310
+ "filter": { "not_site_admin": true }
311
+ })
312
+ for user in users.auto_paging_iter():
313
+ # Operate on user
314
+ except files_sdk.error.NotAuthenticatedError as err:
315
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
316
+ except files_sdk.error.Error as err:
317
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
318
+ ```
319
+
320
+ ```python title="Range Filter Example"
321
+ import files_sdk
322
+
323
+ try:
324
+ # users who haven't logged in since 2024-01-01
325
+ users = files_sdk.user.list({
326
+ "filter_gteq": { "last_login_at": "2024-01-01" }
327
+ })
328
+ for user in users.auto_paging_iter():
329
+ # Operate on user
330
+ except files_sdk.error.NotAuthenticatedError as err:
331
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
332
+ except files_sdk.error.Error as err:
333
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
334
+ ```
335
+
336
+ ```python title="Pattern Filter Example"
337
+ import files_sdk
338
+
339
+ try:
340
+ # users whose usernames start with 'test'
341
+ users = files_sdk.user.list({
342
+ "filter_prefix": { "username": "test" }
343
+ })
344
+ for user in users.auto_paging_iter():
345
+ # Operate on user
346
+ except files_sdk.error.NotAuthenticatedError as err:
347
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
348
+ except files_sdk.error.Error as err:
349
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
350
+ ```
351
+
352
+ ```python title="Combination Filter with Sort Example"
353
+ import files_sdk
354
+
355
+ try:
356
+ # users whose usernames start with 'test' and are not admins
357
+ users = files_sdk.user.list({
358
+ "filter_prefix": { "username": "test" },
359
+ "filter": { "not_site_admin": "true" },
360
+ "sort_by": { "username": "asc" }
361
+ })
362
+ for user in users.auto_paging_iter():
363
+ # Operate on user
364
+ except files_sdk.error.NotAuthenticatedError as err:
365
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
366
+ except files_sdk.error.Error as err:
367
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
368
+ ```
369
+
370
+ ## Foreign Language Support
371
+
372
+ The Files.com Python SDK will soon be updated to support localized responses by using a configuration
373
+ method. When available, it can be used to guide the API in selecting a preferred language for applicable response content.
374
+
375
+ Language support currently applies to select human-facing fields only, such as notification messages
376
+ and error descriptions.
377
+
378
+ If the specified language is not supported or the value is omitted, the API defaults to English.
379
+
380
+ ## Errors
381
+
382
+ The Files.com Python SDK will return errors by raising exceptions. There are many exception classes defined in the Files SDK that correspond
383
+ to specific errors.
384
+
385
+ The raised exceptions come from two categories:
386
+
387
+ 1. SDK Exceptions - errors that originate within the SDK
388
+ 2. API Exceptions - errors that occur due to the response from the Files.com API. These errors are grouped into common error types.
389
+
390
+ There are several types of exceptions within each category. Exception classes indicate different types of errors and are named in a
391
+ fashion that describe the general premise of the originating error. More details can be found in the err object message.
392
+
393
+ Use standard Python exception handling to detect and deal with errors. It is generally recommended to handle specific errors first, then
394
+ handle the general `files_sdk.error.Error` exception as a catch-all.
395
+
396
+ ```python title="Example Error Handling"
397
+ import files_sdk
398
+
399
+ try:
400
+ session = files_sdk.session.create({ "username": "USERNAME", "password": "BADPASSWORD" })
401
+ except files_sdk.error.NotAuthenticatedError as err:
402
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
403
+ except files_sdk.error.Error as err:
404
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
405
+ ```
406
+
407
+ ### Error Types
408
+
409
+ #### SDK Errors
410
+
411
+ SDK errors are general errors that occur within the SDK code. Each exception class inherits from a standard `Error` base class.
412
+
413
+ ```python title="Example SDK Exception Class Inheritance Structure"
414
+ files_sdk.error.APIConnectionError -> files_sdk.error.Error -> Exception
415
+ ```
416
+ ##### SDK Exception Classes
417
+
418
+ | Error Class Name| Description |
419
+ | --------------- | ------------ |
420
+ | `APIConnectionError`| The Files.com API cannot be reached |
421
+ | `AuthenticationError`| Not enough authentication information has been provided |
422
+ | `InvalidParameterError`| A passed in parameter is invalid |
423
+ | `MissingParameterError`| A method parameter is missing |
424
+ | `NotImplementedError`| The called method has not be implemented by the SDK |
425
+
426
+ #### API Errors
427
+
428
+ API errors are errors returned by the Files.com API. Each exception class inherits from an error group base class.
429
+ The error group base class indicates a particular type of error.
430
+
431
+ ```python title="Example API Exception Class Inheritance Structure"
432
+ files_sdk.error.FolderAdminPermissionRequiredError -> files_sdk.error.NotAuthorizedError -> files_sdk.error.APIError -> files_sdk.error.Error -> Exception
433
+ ```
434
+ ##### API Exception Classes
435
+
436
+ | Error Class Name | Error Group |
437
+ | --------- | --------- |
438
+ |`AgentUpgradeRequiredError`| `BadRequestError` |
439
+ |`AttachmentTooLargeError`| `BadRequestError` |
440
+ |`CannotDownloadDirectoryError`| `BadRequestError` |
441
+ |`CantMoveWithMultipleLocationsError`| `BadRequestError` |
442
+ |`DatetimeParseError`| `BadRequestError` |
443
+ |`DestinationSameError`| `BadRequestError` |
444
+ |`DoesNotSupportSortingError`| `BadRequestError` |
445
+ |`FolderMustNotBeAFileError`| `BadRequestError` |
446
+ |`FoldersNotAllowedError`| `BadRequestError` |
447
+ |`InvalidBodyError`| `BadRequestError` |
448
+ |`InvalidCursorError`| `BadRequestError` |
449
+ |`InvalidCursorTypeForSortError`| `BadRequestError` |
450
+ |`InvalidEtagsError`| `BadRequestError` |
451
+ |`InvalidFilterAliasCombinationError`| `BadRequestError` |
452
+ |`InvalidFilterFieldError`| `BadRequestError` |
453
+ |`InvalidFilterParamError`| `BadRequestError` |
454
+ |`InvalidFilterParamFormatError`| `BadRequestError` |
455
+ |`InvalidFilterParamValueError`| `BadRequestError` |
456
+ |`InvalidInputEncodingError`| `BadRequestError` |
457
+ |`InvalidInterfaceError`| `BadRequestError` |
458
+ |`InvalidOauthProviderError`| `BadRequestError` |
459
+ |`InvalidPathError`| `BadRequestError` |
460
+ |`InvalidReturnToUrlError`| `BadRequestError` |
461
+ |`InvalidSortFieldError`| `BadRequestError` |
462
+ |`InvalidSortFilterCombinationError`| `BadRequestError` |
463
+ |`InvalidUploadOffsetError`| `BadRequestError` |
464
+ |`InvalidUploadPartGapError`| `BadRequestError` |
465
+ |`InvalidUploadPartSizeError`| `BadRequestError` |
466
+ |`MethodNotAllowedError`| `BadRequestError` |
467
+ |`MultipleSortParamsNotAllowedError`| `BadRequestError` |
468
+ |`NoValidInputParamsError`| `BadRequestError` |
469
+ |`PartNumberTooLargeError`| `BadRequestError` |
470
+ |`PathCannotHaveTrailingWhitespaceError`| `BadRequestError` |
471
+ |`ReauthenticationNeededFieldsError`| `BadRequestError` |
472
+ |`RequestParamsContainInvalidCharacterError`| `BadRequestError` |
473
+ |`RequestParamsInvalidError`| `BadRequestError` |
474
+ |`RequestParamsRequiredError`| `BadRequestError` |
475
+ |`SearchAllOnChildPathError`| `BadRequestError` |
476
+ |`UnrecognizedSortIndexError`| `BadRequestError` |
477
+ |`UnsupportedCurrencyError`| `BadRequestError` |
478
+ |`UnsupportedHttpResponseFormatError`| `BadRequestError` |
479
+ |`UnsupportedMediaTypeError`| `BadRequestError` |
480
+ |`UserIdInvalidError`| `BadRequestError` |
481
+ |`UserIdOnUserEndpointError`| `BadRequestError` |
482
+ |`UserRequiredError`| `BadRequestError` |
483
+ |`AdditionalAuthenticationRequiredError`| `NotAuthenticatedError` |
484
+ |`ApiKeySessionsNotSupportedError`| `NotAuthenticatedError` |
485
+ |`AuthenticationRequiredError`| `NotAuthenticatedError` |
486
+ |`BundleRegistrationCodeFailedError`| `NotAuthenticatedError` |
487
+ |`FilesAgentTokenFailedError`| `NotAuthenticatedError` |
488
+ |`InboxRegistrationCodeFailedError`| `NotAuthenticatedError` |
489
+ |`InvalidCredentialsError`| `NotAuthenticatedError` |
490
+ |`InvalidOauthError`| `NotAuthenticatedError` |
491
+ |`InvalidOrExpiredCodeError`| `NotAuthenticatedError` |
492
+ |`InvalidSessionError`| `NotAuthenticatedError` |
493
+ |`InvalidUsernameOrPasswordError`| `NotAuthenticatedError` |
494
+ |`LockedOutError`| `NotAuthenticatedError` |
495
+ |`LockoutRegionMismatchError`| `NotAuthenticatedError` |
496
+ |`OneTimePasswordIncorrectError`| `NotAuthenticatedError` |
497
+ |`TwoFactorAuthenticationErrorError`| `NotAuthenticatedError` |
498
+ |`TwoFactorAuthenticationSetupExpiredError`| `NotAuthenticatedError` |
499
+ |`ApiKeyIsDisabledError`| `NotAuthorizedError` |
500
+ |`ApiKeyIsPathRestrictedError`| `NotAuthorizedError` |
501
+ |`ApiKeyOnlyForDesktopAppError`| `NotAuthorizedError` |
502
+ |`ApiKeyOnlyForMobileAppError`| `NotAuthorizedError` |
503
+ |`ApiKeyOnlyForOfficeIntegrationError`| `NotAuthorizedError` |
504
+ |`BillingOrSiteAdminPermissionRequiredError`| `NotAuthorizedError` |
505
+ |`BillingPermissionRequiredError`| `NotAuthorizedError` |
506
+ |`BundleMaximumUsesReachedError`| `NotAuthorizedError` |
507
+ |`BundlePermissionRequiredError`| `NotAuthorizedError` |
508
+ |`CannotLoginWhileUsingKeyError`| `NotAuthorizedError` |
509
+ |`CantActForOtherUserError`| `NotAuthorizedError` |
510
+ |`ContactAdminForPasswordChangeHelpError`| `NotAuthorizedError` |
511
+ |`FilesAgentFailedAuthorizationError`| `NotAuthorizedError` |
512
+ |`FolderAdminOrBillingPermissionRequiredError`| `NotAuthorizedError` |
513
+ |`FolderAdminPermissionRequiredError`| `NotAuthorizedError` |
514
+ |`FullPermissionRequiredError`| `NotAuthorizedError` |
515
+ |`HistoryPermissionRequiredError`| `NotAuthorizedError` |
516
+ |`InsufficientPermissionForParamsError`| `NotAuthorizedError` |
517
+ |`InsufficientPermissionForSiteError`| `NotAuthorizedError` |
518
+ |`MustAuthenticateWithApiKeyError`| `NotAuthorizedError` |
519
+ |`NeedAdminPermissionForInboxError`| `NotAuthorizedError` |
520
+ |`NonAdminsMustQueryByFolderOrPathError`| `NotAuthorizedError` |
521
+ |`NotAllowedToCreateBundleError`| `NotAuthorizedError` |
522
+ |`PasswordChangeNotRequiredError`| `NotAuthorizedError` |
523
+ |`PasswordChangeRequiredError`| `NotAuthorizedError` |
524
+ |`ReadOnlySessionError`| `NotAuthorizedError` |
525
+ |`ReadPermissionRequiredError`| `NotAuthorizedError` |
526
+ |`ReauthenticationFailedError`| `NotAuthorizedError` |
527
+ |`ReauthenticationFailedFinalError`| `NotAuthorizedError` |
528
+ |`ReauthenticationNeededActionError`| `NotAuthorizedError` |
529
+ |`RecaptchaFailedError`| `NotAuthorizedError` |
530
+ |`SelfManagedRequiredError`| `NotAuthorizedError` |
531
+ |`SiteAdminRequiredError`| `NotAuthorizedError` |
532
+ |`SiteFilesAreImmutableError`| `NotAuthorizedError` |
533
+ |`TwoFactorAuthenticationRequiredError`| `NotAuthorizedError` |
534
+ |`UserIdWithoutSiteAdminError`| `NotAuthorizedError` |
535
+ |`WriteAndBundlePermissionRequiredError`| `NotAuthorizedError` |
536
+ |`WritePermissionRequiredError`| `NotAuthorizedError` |
537
+ |`ApiKeyNotFoundError`| `NotFoundError` |
538
+ |`BundlePathNotFoundError`| `NotFoundError` |
539
+ |`BundleRegistrationNotFoundError`| `NotFoundError` |
540
+ |`CodeNotFoundError`| `NotFoundError` |
541
+ |`FileNotFoundError`| `NotFoundError` |
542
+ |`FileUploadNotFoundError`| `NotFoundError` |
543
+ |`FolderNotFoundError`| `NotFoundError` |
544
+ |`GroupNotFoundError`| `NotFoundError` |
545
+ |`InboxNotFoundError`| `NotFoundError` |
546
+ |`NestedNotFoundError`| `NotFoundError` |
547
+ |`PlanNotFoundError`| `NotFoundError` |
548
+ |`SiteNotFoundError`| `NotFoundError` |
549
+ |`UserNotFoundError`| `NotFoundError` |
550
+ |`AlreadyCompletedError`| `ProcessingFailureError` |
551
+ |`AutomationCannotBeRunManuallyError`| `ProcessingFailureError` |
552
+ |`BehaviorNotAllowedOnRemoteServerError`| `ProcessingFailureError` |
553
+ |`BundleOnlyAllowsPreviewsError`| `ProcessingFailureError` |
554
+ |`BundleOperationRequiresSubfolderError`| `ProcessingFailureError` |
555
+ |`CouldNotCreateParentError`| `ProcessingFailureError` |
556
+ |`DestinationExistsError`| `ProcessingFailureError` |
557
+ |`DestinationFolderLimitedError`| `ProcessingFailureError` |
558
+ |`DestinationParentConflictError`| `ProcessingFailureError` |
559
+ |`DestinationParentDoesNotExistError`| `ProcessingFailureError` |
560
+ |`ExceededRuntimeLimitError`| `ProcessingFailureError` |
561
+ |`ExpiredPrivateKeyError`| `ProcessingFailureError` |
562
+ |`ExpiredPublicKeyError`| `ProcessingFailureError` |
563
+ |`ExportFailureError`| `ProcessingFailureError` |
564
+ |`ExportNotReadyError`| `ProcessingFailureError` |
565
+ |`FailedToChangePasswordError`| `ProcessingFailureError` |
566
+ |`FileLockedError`| `ProcessingFailureError` |
567
+ |`FileNotUploadedError`| `ProcessingFailureError` |
568
+ |`FilePendingProcessingError`| `ProcessingFailureError` |
569
+ |`FileProcessingErrorError`| `ProcessingFailureError` |
570
+ |`FileTooBigToDecryptError`| `ProcessingFailureError` |
571
+ |`FileTooBigToEncryptError`| `ProcessingFailureError` |
572
+ |`FileUploadedToWrongRegionError`| `ProcessingFailureError` |
573
+ |`FilenameTooLongError`| `ProcessingFailureError` |
574
+ |`FolderLockedError`| `ProcessingFailureError` |
575
+ |`FolderNotEmptyError`| `ProcessingFailureError` |
576
+ |`HistoryUnavailableError`| `ProcessingFailureError` |
577
+ |`InvalidBundleCodeError`| `ProcessingFailureError` |
578
+ |`InvalidFileTypeError`| `ProcessingFailureError` |
579
+ |`InvalidFilenameError`| `ProcessingFailureError` |
580
+ |`InvalidPriorityColorError`| `ProcessingFailureError` |
581
+ |`InvalidRangeError`| `ProcessingFailureError` |
582
+ |`InvalidSiteError`| `ProcessingFailureError` |
583
+ |`ModelSaveErrorError`| `ProcessingFailureError` |
584
+ |`MultipleProcessingErrorsError`| `ProcessingFailureError` |
585
+ |`PathTooLongError`| `ProcessingFailureError` |
586
+ |`RecipientAlreadySharedError`| `ProcessingFailureError` |
587
+ |`RemoteServerErrorError`| `ProcessingFailureError` |
588
+ |`ResourceBelongsToParentSiteError`| `ProcessingFailureError` |
589
+ |`ResourceLockedError`| `ProcessingFailureError` |
590
+ |`SubfolderLockedError`| `ProcessingFailureError` |
591
+ |`TwoFactorAuthenticationCodeAlreadySentError`| `ProcessingFailureError` |
592
+ |`TwoFactorAuthenticationCountryBlacklistedError`| `ProcessingFailureError` |
593
+ |`TwoFactorAuthenticationGeneralErrorError`| `ProcessingFailureError` |
594
+ |`TwoFactorAuthenticationMethodUnsupportedErrorError`| `ProcessingFailureError` |
595
+ |`TwoFactorAuthenticationUnsubscribedRecipientError`| `ProcessingFailureError` |
596
+ |`UpdatesNotAllowedForRemotesError`| `ProcessingFailureError` |
597
+ |`DuplicateShareRecipientError`| `RateLimitedError` |
598
+ |`ReauthenticationRateLimitedError`| `RateLimitedError` |
599
+ |`TooManyConcurrentLoginsError`| `RateLimitedError` |
600
+ |`TooManyConcurrentRequestsError`| `RateLimitedError` |
601
+ |`TooManyLoginAttemptsError`| `RateLimitedError` |
602
+ |`TooManyRequestsError`| `RateLimitedError` |
603
+ |`TooManySharesError`| `RateLimitedError` |
604
+ |`AgentUnavailableError`| `ServiceUnavailableError` |
605
+ |`AutomationsUnavailableError`| `ServiceUnavailableError` |
606
+ |`MigrationInProgressError`| `ServiceUnavailableError` |
607
+ |`SiteDisabledError`| `ServiceUnavailableError` |
608
+ |`UploadsUnavailableError`| `ServiceUnavailableError` |
609
+ |`AccountAlreadyExistsError`| `SiteConfigurationError` |
610
+ |`AccountOverdueError`| `SiteConfigurationError` |
611
+ |`NoAccountForSiteError`| `SiteConfigurationError` |
612
+ |`SiteWasRemovedError`| `SiteConfigurationError` |
613
+ |`TrialExpiredError`| `SiteConfigurationError` |
614
+ |`TrialLockedError`| `SiteConfigurationError` |
615
+ |`UserRequestsEnabledRequiredError`| `SiteConfigurationError` |
616
+
617
+ ## Pagination
618
+
619
+ Certain API operations return lists of objects. When the number of objects in the list is large,
620
+ the API will paginate the results.
621
+
622
+ The Files.com Python SDK provides multiple ways to paginate through lists of objects.
623
+
624
+ ### Automatic Pagination
625
+
626
+ The `auto_paging_iter` method automatically paginates and loads each page into memory.
627
+
628
+ ```python title="Example Request"
629
+ import files_sdk
630
+
631
+ try:
632
+ for item in files_sdk.folder.list_for("remote/path/to/folder").auto_paging_iter():
633
+ print(item.type, item.path)
634
+ except files_sdk.error.NotAuthenticatedError as err:
635
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
636
+ except files_sdk.error.Error as err:
637
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
638
+ ```
639
+
640
+ ### Manual Pagination
641
+
642
+ The `load_next_page/has_next_page` methods allow for manual pagination and loading of each page into memory.
643
+
644
+ ```python title="Example Request"
645
+ import files_sdk
646
+
647
+ try:
648
+ list_obj = files_sdk.folder.list_for("remote/path/to/folder")
649
+
650
+ while True:
651
+ for item in list_obj:
652
+ print(item.type, item.path)
653
+ if not list_obj.has_next_page:
654
+ break
655
+ list_obj.load_next_page()
656
+ except files_sdk.error.NotAuthenticatedError as err:
657
+ print(f"Authentication Error Occurred ({type(err).__name__}):", err)
658
+ except files_sdk.error.Error as err:
659
+ print(f"Unknown Error Occurred ({type(err).__name__}):", err)
660
+ ```
661
+
662
+ ## Case Sensitivity
663
+
664
+ The Files.com API compares files and paths in a case-insensitive manner. For related documentation see [Case Sensitivity Documentation](https://www.files.com/docs/files-and-folders/file-system-semantics/case-sensitivity).
665
+
666
+ The `path_util.is_same` function in the Files.com SDK is designed to help you determine if two paths on
667
+ your native file system would be considered the same on Files.com. This is particularly important
668
+ when handling errors related to duplicate file names and when developing tools for folder
669
+ synchronization.
670
+
671
+ ```python title="Compare Case-Insensitive Files and Paths"
672
+ import files_sdk
673
+
674
+ if files_sdk.path_util.is_same("Fïłèńämê.Txt", "filename.txt"):
675
+ print("Paths are the same")
676
+ ```
677
+
678
+ ## Mock Server
679
+
680
+ Files.com publishes a Files.com API server, which is useful for testing your use of the Files.com
681
+ SDKs and other direct integrations against the Files.com API in an integration test environment.
682
+
683
+ It is a Ruby app that operates as a minimal server for the purpose of testing basic network
684
+ operations and JSON encoding for your SDK or API client. It does not maintain state and it does not
685
+ deeply inspect your submissions for correctness.
686
+
687
+ Eventually we will add more features intended for integration testing, such as the ability to
688
+ intentionally provoke errors.
689
+
690
+ Download the server as a Docker image via [Docker Hub](https://hub.docker.com/r/filescom/files-mock-server).
691
+
692
+ The Source Code is also available on [GitHub](https://github.com/Files-com/files-mock-server).
693
+
694
+ A README is available on the GitHub link.