files-com 1.6.14__py3-none-any.whl → 1.6.113__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 (53) hide show
  1. README.md +80 -18
  2. _VERSION +1 -1
  3. {files_com-1.6.14.dist-info → files_com-1.6.113.dist-info}/METADATA +81 -19
  4. {files_com-1.6.14.dist-info → files_com-1.6.113.dist-info}/RECORD +53 -46
  5. files_sdk/__init__.py +17 -1
  6. files_sdk/error.py +98 -23
  7. files_sdk/models/__init__.py +9 -0
  8. files_sdk/models/api_key.py +10 -0
  9. files_sdk/models/api_request_log.py +20 -3
  10. files_sdk/models/as2_partner.py +27 -5
  11. files_sdk/models/as2_station.py +1 -1
  12. files_sdk/models/automation.py +49 -5
  13. files_sdk/models/automation_log.py +20 -3
  14. files_sdk/models/behavior.py +2 -16
  15. files_sdk/models/bundle.py +1 -1
  16. files_sdk/models/bundle_action.py +5 -1
  17. files_sdk/models/bundle_registration.py +1 -1
  18. files_sdk/models/child_site_management_policy.py +278 -0
  19. files_sdk/models/email_log.py +17 -7
  20. files_sdk/models/exavault_api_request_log.py +20 -3
  21. files_sdk/models/file.py +8 -0
  22. files_sdk/models/file_migration_log.py +17 -7
  23. files_sdk/models/folder.py +11 -1
  24. files_sdk/models/ftp_action_log.py +20 -3
  25. files_sdk/models/gpg_key.py +61 -9
  26. files_sdk/models/history_export.py +4 -4
  27. files_sdk/models/history_export_result.py +2 -2
  28. files_sdk/models/holiday_region.py +58 -0
  29. files_sdk/models/inbox_registration.py +1 -1
  30. files_sdk/models/invoice_line_item.py +5 -0
  31. files_sdk/models/outbound_connection_log.py +20 -3
  32. files_sdk/models/partner.py +296 -0
  33. files_sdk/models/permission.py +10 -2
  34. files_sdk/models/public_hosting_request_log.py +27 -8
  35. files_sdk/models/public_key.py +39 -3
  36. files_sdk/models/remote_mount_backend.py +438 -0
  37. files_sdk/models/remote_server.py +19 -91
  38. files_sdk/models/remote_server_configuration_file.py +1 -0
  39. files_sdk/models/scim_log.py +88 -0
  40. files_sdk/models/sftp_action_log.py +20 -3
  41. files_sdk/models/siem_http_destination.py +98 -19
  42. files_sdk/models/site.py +37 -20
  43. files_sdk/models/sso_strategy.py +2 -1
  44. files_sdk/models/sync.py +574 -0
  45. files_sdk/models/sync_log.py +19 -8
  46. files_sdk/models/sync_run.py +123 -0
  47. files_sdk/models/user.py +79 -2
  48. files_sdk/models/user_cipher_use.py +24 -1
  49. files_sdk/models/user_lifecycle_rule.py +94 -39
  50. files_sdk/models/web_dav_action_log.py +20 -3
  51. {files_com-1.6.14.dist-info → files_com-1.6.113.dist-info}/WHEEL +0 -0
  52. {files_com-1.6.14.dist-info → files_com-1.6.113.dist-info}/licenses/LICENSE +0 -0
  53. {files_com-1.6.14.dist-info → files_com-1.6.113.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,438 @@
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 RemoteMountBackend:
12
+ default_attributes = {
13
+ "canary_file_path": None, # string - Path to the canary file used for health checks.
14
+ "enabled": None, # boolean - True if this backend is enabled.
15
+ "fall": None, # int64 - Number of consecutive failures before considering the backend unhealthy.
16
+ "health_check_enabled": None, # boolean - True if health checks are enabled for this backend.
17
+ "health_check_results": None, # array(object) - Array of recent health check results.
18
+ "health_check_type": None, # string - Type of health check to perform.
19
+ "id": None, # int64 - Unique identifier for this backend.
20
+ "interval": None, # int64 - Interval in seconds between health checks.
21
+ "min_free_cpu": None, # double - Minimum free CPU percentage required for this backend to be considered healthy.
22
+ "min_free_mem": None, # double - Minimum free memory percentage required for this backend to be considered healthy.
23
+ "priority": None, # int64 - Priority of this backend.
24
+ "remote_path": None, # string - Path on the remote server to treat as the root of this mount.
25
+ "remote_server_id": None, # int64 - The remote server that this backend is associated with.
26
+ "remote_server_mount_id": None, # int64 - The mount ID of the Remote Server Mount that this backend is associated with.
27
+ "rise": None, # int64 - Number of consecutive successes before considering the backend healthy.
28
+ "status": None, # string - Status of this backend.
29
+ "undergoing_maintenance": None, # boolean - True if this backend is undergoing maintenance.
30
+ }
31
+
32
+ def __init__(self, attributes=None, options=None):
33
+ if not isinstance(attributes, dict):
34
+ attributes = {}
35
+ if not isinstance(options, dict):
36
+ options = {}
37
+ self.set_attributes(attributes)
38
+ self.options = options
39
+
40
+ def set_attributes(self, attributes):
41
+ for (
42
+ attribute,
43
+ default_value,
44
+ ) in RemoteMountBackend.default_attributes.items():
45
+ setattr(self, attribute, attributes.get(attribute, default_value))
46
+
47
+ def get_attributes(self):
48
+ return {
49
+ k: getattr(self, k, None)
50
+ for k in RemoteMountBackend.default_attributes
51
+ if getattr(self, k, None) is not None
52
+ }
53
+
54
+ # Reset backend status to healthy
55
+ def reset_status(self, params=None):
56
+ if not isinstance(params, dict):
57
+ params = {}
58
+
59
+ if hasattr(self, "id") and self.id:
60
+ params["id"] = self.id
61
+ else:
62
+ raise MissingParameterError("Current object doesn't have a id")
63
+ if "id" not in params:
64
+ raise MissingParameterError("Parameter missing: id")
65
+ if "id" in params and not isinstance(params["id"], int):
66
+ raise InvalidParameterError("Bad parameter: id must be an int")
67
+ Api.send_request(
68
+ "POST",
69
+ "/remote_mount_backends/{id}/reset_status".format(id=params["id"]),
70
+ params,
71
+ self.options,
72
+ )
73
+
74
+ # Parameters:
75
+ # enabled - boolean - True if this backend is enabled.
76
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
77
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
78
+ # health_check_type - string - Type of health check to perform.
79
+ # interval - int64 - Interval in seconds between health checks.
80
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
81
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
82
+ # priority - int64 - Priority of this backend.
83
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
84
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
85
+ # canary_file_path - string - Path to the canary file used for health checks.
86
+ # remote_server_id - int64 - The remote server that this backend is associated with.
87
+ def update(self, params=None):
88
+ if not isinstance(params, dict):
89
+ params = {}
90
+
91
+ if hasattr(self, "id") and self.id:
92
+ params["id"] = self.id
93
+ else:
94
+ raise MissingParameterError("Current object doesn't have a id")
95
+ if "id" not in params:
96
+ raise MissingParameterError("Parameter missing: id")
97
+ if "id" in params and not isinstance(params["id"], int):
98
+ raise InvalidParameterError("Bad parameter: id must be an int")
99
+ if "fall" in params and not isinstance(params["fall"], int):
100
+ raise InvalidParameterError("Bad parameter: fall must be an int")
101
+ if "health_check_type" in params and not isinstance(
102
+ params["health_check_type"], str
103
+ ):
104
+ raise InvalidParameterError(
105
+ "Bad parameter: health_check_type must be an str"
106
+ )
107
+ if "interval" in params and not isinstance(params["interval"], int):
108
+ raise InvalidParameterError(
109
+ "Bad parameter: interval must be an int"
110
+ )
111
+ if "priority" in params and not isinstance(params["priority"], int):
112
+ raise InvalidParameterError(
113
+ "Bad parameter: priority must be an int"
114
+ )
115
+ if "remote_path" in params and not isinstance(
116
+ params["remote_path"], str
117
+ ):
118
+ raise InvalidParameterError(
119
+ "Bad parameter: remote_path must be an str"
120
+ )
121
+ if "rise" in params and not isinstance(params["rise"], int):
122
+ raise InvalidParameterError("Bad parameter: rise must be an int")
123
+ if "canary_file_path" in params and not isinstance(
124
+ params["canary_file_path"], str
125
+ ):
126
+ raise InvalidParameterError(
127
+ "Bad parameter: canary_file_path must be an str"
128
+ )
129
+ if "remote_server_id" in params and not isinstance(
130
+ params["remote_server_id"], int
131
+ ):
132
+ raise InvalidParameterError(
133
+ "Bad parameter: remote_server_id must be an int"
134
+ )
135
+ response, _options = Api.send_request(
136
+ "PATCH",
137
+ "/remote_mount_backends/{id}".format(id=params["id"]),
138
+ params,
139
+ self.options,
140
+ )
141
+ return response.data
142
+
143
+ def delete(self, params=None):
144
+ if not isinstance(params, dict):
145
+ params = {}
146
+
147
+ if hasattr(self, "id") and self.id:
148
+ params["id"] = self.id
149
+ else:
150
+ raise MissingParameterError("Current object doesn't have a id")
151
+ if "id" not in params:
152
+ raise MissingParameterError("Parameter missing: id")
153
+ if "id" in params and not isinstance(params["id"], int):
154
+ raise InvalidParameterError("Bad parameter: id must be an int")
155
+ Api.send_request(
156
+ "DELETE",
157
+ "/remote_mount_backends/{id}".format(id=params["id"]),
158
+ params,
159
+ self.options,
160
+ )
161
+
162
+ def destroy(self, params=None):
163
+ self.delete(params)
164
+
165
+ def save(self):
166
+ if hasattr(self, "id") and self.id:
167
+ new_obj = self.update(self.get_attributes())
168
+ self.set_attributes(new_obj.get_attributes())
169
+ return True
170
+ else:
171
+ new_obj = create(self.get_attributes(), self.options)
172
+ self.set_attributes(new_obj.get_attributes())
173
+ return True
174
+
175
+
176
+ # Parameters:
177
+ # 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.
178
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
179
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
180
+ def list(params=None, options=None):
181
+ if not isinstance(params, dict):
182
+ params = {}
183
+ if not isinstance(options, dict):
184
+ options = {}
185
+ if "cursor" in params and not isinstance(params["cursor"], str):
186
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
187
+ if "per_page" in params and not isinstance(params["per_page"], int):
188
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
189
+ if "filter" in params and not isinstance(params["filter"], dict):
190
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
191
+ return ListObj(
192
+ RemoteMountBackend, "GET", "/remote_mount_backends", params, options
193
+ )
194
+
195
+
196
+ def all(params=None, options=None):
197
+ list(params, options)
198
+
199
+
200
+ # Parameters:
201
+ # id (required) - int64 - Remote Mount Backend ID.
202
+ def find(id, params=None, options=None):
203
+ if not isinstance(params, dict):
204
+ params = {}
205
+ if not isinstance(options, dict):
206
+ options = {}
207
+ params["id"] = id
208
+ if "id" in params and not isinstance(params["id"], int):
209
+ raise InvalidParameterError("Bad parameter: id must be an int")
210
+ if "id" not in params:
211
+ raise MissingParameterError("Parameter missing: id")
212
+ response, options = Api.send_request(
213
+ "GET",
214
+ "/remote_mount_backends/{id}".format(id=params["id"]),
215
+ params,
216
+ options,
217
+ )
218
+ return RemoteMountBackend(response.data, options)
219
+
220
+
221
+ def get(id, params=None, options=None):
222
+ find(id, params, options)
223
+
224
+
225
+ # Parameters:
226
+ # enabled - boolean - True if this backend is enabled.
227
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
228
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
229
+ # health_check_type - string - Type of health check to perform.
230
+ # interval - int64 - Interval in seconds between health checks.
231
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
232
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
233
+ # priority - int64 - Priority of this backend.
234
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
235
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
236
+ # canary_file_path (required) - string - Path to the canary file used for health checks.
237
+ # remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
238
+ # remote_server_id (required) - int64 - The remote server that this backend is associated with.
239
+ def create(params=None, options=None):
240
+ if not isinstance(params, dict):
241
+ params = {}
242
+ if not isinstance(options, dict):
243
+ options = {}
244
+ if "enabled" in params and not isinstance(params["enabled"], bool):
245
+ raise InvalidParameterError("Bad parameter: enabled must be an bool")
246
+ if "fall" in params and not isinstance(params["fall"], int):
247
+ raise InvalidParameterError("Bad parameter: fall must be an int")
248
+ if "health_check_enabled" in params and not isinstance(
249
+ params["health_check_enabled"], bool
250
+ ):
251
+ raise InvalidParameterError(
252
+ "Bad parameter: health_check_enabled must be an bool"
253
+ )
254
+ if "health_check_type" in params and not isinstance(
255
+ params["health_check_type"], str
256
+ ):
257
+ raise InvalidParameterError(
258
+ "Bad parameter: health_check_type must be an str"
259
+ )
260
+ if "interval" in params and not isinstance(params["interval"], int):
261
+ raise InvalidParameterError("Bad parameter: interval must be an int")
262
+ if "min_free_cpu" in params and not isinstance(
263
+ params["min_free_cpu"], float
264
+ ):
265
+ raise InvalidParameterError(
266
+ "Bad parameter: min_free_cpu must be an float"
267
+ )
268
+ if "min_free_mem" in params and not isinstance(
269
+ params["min_free_mem"], float
270
+ ):
271
+ raise InvalidParameterError(
272
+ "Bad parameter: min_free_mem must be an float"
273
+ )
274
+ if "priority" in params and not isinstance(params["priority"], int):
275
+ raise InvalidParameterError("Bad parameter: priority must be an int")
276
+ if "remote_path" in params and not isinstance(params["remote_path"], str):
277
+ raise InvalidParameterError(
278
+ "Bad parameter: remote_path must be an str"
279
+ )
280
+ if "rise" in params and not isinstance(params["rise"], int):
281
+ raise InvalidParameterError("Bad parameter: rise must be an int")
282
+ if "canary_file_path" in params and not isinstance(
283
+ params["canary_file_path"], str
284
+ ):
285
+ raise InvalidParameterError(
286
+ "Bad parameter: canary_file_path must be an str"
287
+ )
288
+ if "remote_server_mount_id" in params and not isinstance(
289
+ params["remote_server_mount_id"], int
290
+ ):
291
+ raise InvalidParameterError(
292
+ "Bad parameter: remote_server_mount_id must be an int"
293
+ )
294
+ if "remote_server_id" in params and not isinstance(
295
+ params["remote_server_id"], int
296
+ ):
297
+ raise InvalidParameterError(
298
+ "Bad parameter: remote_server_id must be an int"
299
+ )
300
+ if "canary_file_path" not in params:
301
+ raise MissingParameterError("Parameter missing: canary_file_path")
302
+ if "remote_server_mount_id" not in params:
303
+ raise MissingParameterError(
304
+ "Parameter missing: remote_server_mount_id"
305
+ )
306
+ if "remote_server_id" not in params:
307
+ raise MissingParameterError("Parameter missing: remote_server_id")
308
+ response, options = Api.send_request(
309
+ "POST", "/remote_mount_backends", params, options
310
+ )
311
+ return RemoteMountBackend(response.data, options)
312
+
313
+
314
+ # Reset backend status to healthy
315
+ def reset_status(id, params=None, options=None):
316
+ if not isinstance(params, dict):
317
+ params = {}
318
+ if not isinstance(options, dict):
319
+ options = {}
320
+ params["id"] = id
321
+ if "id" in params and not isinstance(params["id"], int):
322
+ raise InvalidParameterError("Bad parameter: id must be an int")
323
+ if "id" not in params:
324
+ raise MissingParameterError("Parameter missing: id")
325
+ Api.send_request(
326
+ "POST",
327
+ "/remote_mount_backends/{id}/reset_status".format(id=params["id"]),
328
+ params,
329
+ options,
330
+ )
331
+
332
+
333
+ # Parameters:
334
+ # enabled - boolean - True if this backend is enabled.
335
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
336
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
337
+ # health_check_type - string - Type of health check to perform.
338
+ # interval - int64 - Interval in seconds between health checks.
339
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
340
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
341
+ # priority - int64 - Priority of this backend.
342
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
343
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
344
+ # canary_file_path - string - Path to the canary file used for health checks.
345
+ # remote_server_id - int64 - The remote server that this backend is associated with.
346
+ def update(id, params=None, options=None):
347
+ if not isinstance(params, dict):
348
+ params = {}
349
+ if not isinstance(options, dict):
350
+ options = {}
351
+ params["id"] = id
352
+ if "id" in params and not isinstance(params["id"], int):
353
+ raise InvalidParameterError("Bad parameter: id must be an int")
354
+ if "enabled" in params and not isinstance(params["enabled"], bool):
355
+ raise InvalidParameterError("Bad parameter: enabled must be an bool")
356
+ if "fall" in params and not isinstance(params["fall"], int):
357
+ raise InvalidParameterError("Bad parameter: fall must be an int")
358
+ if "health_check_enabled" in params and not isinstance(
359
+ params["health_check_enabled"], bool
360
+ ):
361
+ raise InvalidParameterError(
362
+ "Bad parameter: health_check_enabled must be an bool"
363
+ )
364
+ if "health_check_type" in params and not isinstance(
365
+ params["health_check_type"], str
366
+ ):
367
+ raise InvalidParameterError(
368
+ "Bad parameter: health_check_type must be an str"
369
+ )
370
+ if "interval" in params and not isinstance(params["interval"], int):
371
+ raise InvalidParameterError("Bad parameter: interval must be an int")
372
+ if "min_free_cpu" in params and not isinstance(
373
+ params["min_free_cpu"], float
374
+ ):
375
+ raise InvalidParameterError(
376
+ "Bad parameter: min_free_cpu must be an float"
377
+ )
378
+ if "min_free_mem" in params and not isinstance(
379
+ params["min_free_mem"], float
380
+ ):
381
+ raise InvalidParameterError(
382
+ "Bad parameter: min_free_mem must be an float"
383
+ )
384
+ if "priority" in params and not isinstance(params["priority"], int):
385
+ raise InvalidParameterError("Bad parameter: priority must be an int")
386
+ if "remote_path" in params and not isinstance(params["remote_path"], str):
387
+ raise InvalidParameterError(
388
+ "Bad parameter: remote_path must be an str"
389
+ )
390
+ if "rise" in params and not isinstance(params["rise"], int):
391
+ raise InvalidParameterError("Bad parameter: rise must be an int")
392
+ if "canary_file_path" in params and not isinstance(
393
+ params["canary_file_path"], str
394
+ ):
395
+ raise InvalidParameterError(
396
+ "Bad parameter: canary_file_path must be an str"
397
+ )
398
+ if "remote_server_id" in params and not isinstance(
399
+ params["remote_server_id"], int
400
+ ):
401
+ raise InvalidParameterError(
402
+ "Bad parameter: remote_server_id must be an int"
403
+ )
404
+ if "id" not in params:
405
+ raise MissingParameterError("Parameter missing: id")
406
+ response, options = Api.send_request(
407
+ "PATCH",
408
+ "/remote_mount_backends/{id}".format(id=params["id"]),
409
+ params,
410
+ options,
411
+ )
412
+ return RemoteMountBackend(response.data, options)
413
+
414
+
415
+ def delete(id, params=None, options=None):
416
+ if not isinstance(params, dict):
417
+ params = {}
418
+ if not isinstance(options, dict):
419
+ options = {}
420
+ params["id"] = id
421
+ if "id" in params and not isinstance(params["id"], int):
422
+ raise InvalidParameterError("Bad parameter: id must be an int")
423
+ if "id" not in params:
424
+ raise MissingParameterError("Parameter missing: id")
425
+ Api.send_request(
426
+ "DELETE",
427
+ "/remote_mount_backends/{id}".format(id=params["id"]),
428
+ params,
429
+ options,
430
+ )
431
+
432
+
433
+ def destroy(id, params=None, options=None):
434
+ delete(id, params, options)
435
+
436
+
437
+ def new(*args, **kwargs):
438
+ return RemoteMountBackend(*args, **kwargs)