files-com 1.6.32__py3-none-any.whl → 1.6.101__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.
Files changed (50) hide show
  1. README.md +80 -18
  2. _VERSION +1 -1
  3. {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/METADATA +81 -19
  4. {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/RECORD +50 -47
  5. files_sdk/__init__.py +9 -1
  6. files_sdk/error.py +98 -23
  7. files_sdk/models/__init__.py +5 -0
  8. files_sdk/models/api_key.py +10 -0
  9. files_sdk/models/api_request_log.py +6 -6
  10. files_sdk/models/automation.py +48 -5
  11. files_sdk/models/automation_log.py +6 -6
  12. files_sdk/models/behavior.py +2 -2
  13. files_sdk/models/bundle.py +1 -1
  14. files_sdk/models/bundle_action.py +5 -1
  15. files_sdk/models/bundle_registration.py +1 -1
  16. files_sdk/models/child_site_management_policy.py +278 -0
  17. files_sdk/models/email_log.py +6 -6
  18. files_sdk/models/exavault_api_request_log.py +6 -6
  19. files_sdk/models/file.py +8 -0
  20. files_sdk/models/file_migration_log.py +6 -6
  21. files_sdk/models/folder.py +11 -1
  22. files_sdk/models/ftp_action_log.py +6 -6
  23. files_sdk/models/gpg_key.py +29 -9
  24. files_sdk/models/history_export.py +4 -4
  25. files_sdk/models/history_export_result.py +2 -2
  26. files_sdk/models/inbox_registration.py +1 -1
  27. files_sdk/models/invoice_line_item.py +5 -0
  28. files_sdk/models/outbound_connection_log.py +6 -6
  29. files_sdk/models/partner.py +296 -0
  30. files_sdk/models/permission.py +10 -2
  31. files_sdk/models/public_hosting_request_log.py +6 -6
  32. files_sdk/models/public_key.py +7 -3
  33. files_sdk/models/remote_mount_backend.py +1 -0
  34. files_sdk/models/remote_server.py +19 -91
  35. files_sdk/models/remote_server_configuration_file.py +1 -0
  36. files_sdk/models/scim_log.py +88 -0
  37. files_sdk/models/sftp_action_log.py +6 -6
  38. files_sdk/models/siem_http_destination.py +16 -16
  39. files_sdk/models/site.py +29 -12
  40. files_sdk/models/sso_strategy.py +2 -1
  41. files_sdk/models/sync.py +74 -10
  42. files_sdk/models/sync_log.py +8 -7
  43. files_sdk/models/sync_run.py +31 -17
  44. files_sdk/models/user.py +80 -3
  45. files_sdk/models/user_cipher_use.py +24 -1
  46. files_sdk/models/user_lifecycle_rule.py +81 -40
  47. files_sdk/models/web_dav_action_log.py +6 -6
  48. {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/WHEEL +0 -0
  49. {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/licenses/LICENSE +0 -0
  50. {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/top_level.txt +0 -0
@@ -11,22 +11,25 @@ from files_sdk.error import ( # noqa: F401
11
11
  class SyncRun:
12
12
  default_attributes = {
13
13
  "id": None, # int64 - SyncRun ID
14
- "sync_id": None, # int64 - ID of the Sync this run belongs to
15
- "site_id": None, # int64 - Site ID
16
- "status": None, # string - Status of the sync run (success, failure, partial_failure, in_progress, skipped)
17
- "remote_server_type": None, # string - Type of remote server used, if any
18
14
  "body": None, # string - Log or summary body for this run
19
- "event_errors": None, # array(string) - Array of errors encountered during the run
20
15
  "bytes_synced": None, # int64 - Total bytes synced in this run
21
16
  "compared_files": None, # int64 - Number of files compared
22
17
  "compared_folders": None, # int64 - Number of folders compared
23
- "errored_files": None, # int64 - Number of files that errored
24
- "successful_files": None, # int64 - Number of files successfully synced
25
- "runtime": None, # double - Total runtime in seconds
26
- "log_url": None, # string - Link to external log file.
27
18
  "completed_at": None, # date-time - When this run was completed
28
- "notified": None, # boolean - Whether notifications were sent for this run
29
19
  "created_at": None, # date-time - When this run was created
20
+ "dest_remote_server_type": None, # string - Destination remote server type, if any
21
+ "dry_run": None, # boolean - Whether this run was a dry run (no actual changes made)
22
+ "errored_files": None, # int64 - Number of files that errored
23
+ "estimated_bytes_count": None, # int64 - Estimated bytes count for this run
24
+ "event_errors": None, # array(string) - Array of errors encountered during the run
25
+ "log_url": None, # string - Link to external log file.
26
+ "runtime": None, # double - Total runtime in seconds
27
+ "site_id": None, # int64 - Site ID
28
+ "src_remote_server_type": None, # string - Source remote server type, if any
29
+ "status": None, # string - Status of the sync run (success, failure, partial_failure, in_progress, skipped)
30
+ "successful_files": None, # int64 - Number of files successfully synced
31
+ "sync_id": None, # int64 - ID of the Sync this run belongs to
32
+ "sync_name": None, # string - Name of the Sync this run belongs to
30
33
  "updated_at": None, # date-time - When this run was last updated
31
34
  }
32
35
 
@@ -54,9 +57,12 @@ class SyncRun:
54
57
  # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
55
58
  # 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.
56
59
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
57
- # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `sync_id`, `created_at` or `status`.
58
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `sync_id`. Valid field combinations are `[ sync_id, status ]`.
59
- # sync_id (required) - int64 - ID of the Sync this run belongs to
60
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `sync_id`, `created_at` or `status`.
61
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `status`, `dry_run`, `src_remote_server_type`, `dest_remote_server_type` or `sync_id`. Valid field combinations are `[ status, created_at ]`, `[ src_remote_server_type, created_at ]`, `[ dest_remote_server_type, created_at ]`, `[ sync_id, created_at ]`, `[ src_remote_server_type, status ]`, `[ dest_remote_server_type, status ]`, `[ sync_id, status ]`, `[ src_remote_server_type, status, created_at ]`, `[ dest_remote_server_type, status, created_at ]` or `[ sync_id, status, created_at ]`.
62
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
63
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
64
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
65
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
60
66
  def list(params=None, options=None):
61
67
  if not isinstance(params, dict):
62
68
  params = {}
@@ -72,10 +78,18 @@ def list(params=None, options=None):
72
78
  raise InvalidParameterError("Bad parameter: sort_by must be an dict")
73
79
  if "filter" in params and not isinstance(params["filter"], dict):
74
80
  raise InvalidParameterError("Bad parameter: filter must be an dict")
75
- if "sync_id" in params and not isinstance(params["sync_id"], int):
76
- raise InvalidParameterError("Bad parameter: sync_id must be an int")
77
- if "sync_id" not in params:
78
- raise MissingParameterError("Parameter missing: sync_id")
81
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
82
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
83
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
84
+ raise InvalidParameterError(
85
+ "Bad parameter: filter_gteq must be an dict"
86
+ )
87
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
88
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
89
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
90
+ raise InvalidParameterError(
91
+ "Bad parameter: filter_lteq must be an dict"
92
+ )
79
93
  return ListObj(SyncRun, "GET", "/sync_runs", params, options)
80
94
 
81
95
 
files_sdk/models/user.py CHANGED
@@ -28,6 +28,7 @@ class User:
28
28
  "disabled": None, # boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
29
29
  "disabled_expired_or_inactive": None, # boolean - Computed property that returns true if user disabled or expired or inactive.
30
30
  "email": None, # email - User email address
31
+ "filesystem_layout": None, # string - File system layout
31
32
  "first_login_at": None, # date-time - User's first login time
32
33
  "ftp_permission": None, # boolean - Can the user access with FTP/FTPS?
33
34
  "group_ids": None, # string - Comma-separated list of group IDs of which this user is a member
@@ -49,6 +50,9 @@ class User:
49
50
  "notes": None, # string - Any internal notes on the user
50
51
  "notification_daily_send_time": None, # int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
51
52
  "office_integration_enabled": None, # boolean - Enable integration with Office for the web?
53
+ "partner_admin": None, # boolean - Is this user a Partner administrator?
54
+ "partner_id": None, # int64 - Partner ID if this user belongs to a Partner
55
+ "partner_name": None, # string - Name of the Partner if this user belongs to a Partner
52
56
  "password_set_at": None, # date-time - Last time the user's password was set
53
57
  "password_validity_days": None, # int64 - Number of days to allow user to use the same password
54
58
  "public_keys_count": None, # int64 - Number of public keys associated with this user
@@ -69,6 +73,7 @@ class User:
69
73
  "sso_strategy_id": None, # int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
70
74
  "subscribe_to_newsletter": None, # boolean - Is the user subscribed to the newsletter?
71
75
  "externally_managed": None, # boolean - Is this user managed by a SsoStrategy?
76
+ "tags": None, # string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
72
77
  "time_zone": None, # string - User time zone
73
78
  "type_of_2fa": None, # string - Type(s) of 2FA methods in use, for programmatic use. Will be either `sms`, `totp`, `webauthn`, `yubi`, `email`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
74
79
  "type_of_2fa_for_display": None, # string - Type(s) of 2FA methods in use, formatted for displaying in the UI. Unlike `type_of_2fa`, this value will make clear when a user has more than 1 of the same type of method.
@@ -86,6 +91,8 @@ class User:
86
91
  "password": None, # string - User password.
87
92
  "password_confirmation": None, # string - Optional, but if provided, we will ensure that it matches the value sent in `password`.
88
93
  "announcements_read": None, # boolean - Signifies that the user has read all the announcements in the UI.
94
+ "clear_2fa": None, # boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
95
+ "convert_to_partner_user": None, # boolean - If true, convert this user to a partner user by assigning the partner_id provided.
89
96
  }
90
97
 
91
98
  def __init__(self, attributes=None, options=None):
@@ -189,6 +196,7 @@ class User:
189
196
  # bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
190
197
  # dav_permission - boolean - Can the user connect with WebDAV?
191
198
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
199
+ # filesystem_layout - string - File system layout
192
200
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
193
201
  # header_text - string - Text to display to the user in the header of the UI
194
202
  # language - string - Preferred language
@@ -197,6 +205,8 @@ class User:
197
205
  # company - string - User's company
198
206
  # notes - string - Any internal notes on the user
199
207
  # office_integration_enabled - boolean - Enable integration with Office for the web?
208
+ # partner_admin - boolean - Is this user a Partner administrator?
209
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
200
210
  # password_validity_days - int64 - Number of days to allow user to use the same password
201
211
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
202
212
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -211,10 +221,13 @@ class User:
211
221
  # sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
212
222
  # subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
213
223
  # require_2fa - string - 2FA required setting
224
+ # tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
214
225
  # time_zone - string - User time zone
215
226
  # user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
216
227
  # user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
217
228
  # username - string - User's username
229
+ # clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
230
+ # convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
218
231
  def update(self, params=None):
219
232
  if not isinstance(params, dict):
220
233
  params = {}
@@ -289,6 +302,12 @@ class User:
289
302
  raise InvalidParameterError(
290
303
  "Bad parameter: authentication_method must be an str"
291
304
  )
305
+ if "filesystem_layout" in params and not isinstance(
306
+ params["filesystem_layout"], str
307
+ ):
308
+ raise InvalidParameterError(
309
+ "Bad parameter: filesystem_layout must be an str"
310
+ )
292
311
  if "header_text" in params and not isinstance(
293
312
  params["header_text"], str
294
313
  ):
@@ -313,6 +332,12 @@ class User:
313
332
  )
314
333
  if "notes" in params and not isinstance(params["notes"], str):
315
334
  raise InvalidParameterError("Bad parameter: notes must be an str")
335
+ if "partner_id" in params and not isinstance(
336
+ params["partner_id"], int
337
+ ):
338
+ raise InvalidParameterError(
339
+ "Bad parameter: partner_id must be an int"
340
+ )
316
341
  if "password_validity_days" in params and not isinstance(
317
342
  params["password_validity_days"], int
318
343
  ):
@@ -343,6 +368,8 @@ class User:
343
368
  raise InvalidParameterError(
344
369
  "Bad parameter: require_2fa must be an str"
345
370
  )
371
+ if "tags" in params and not isinstance(params["tags"], str):
372
+ raise InvalidParameterError("Bad parameter: tags must be an str")
346
373
  if "time_zone" in params and not isinstance(params["time_zone"], str):
347
374
  raise InvalidParameterError(
348
375
  "Bad parameter: time_zone must be an str"
@@ -411,11 +438,11 @@ class User:
411
438
  # Parameters:
412
439
  # 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.
413
440
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
414
- # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `name`, `company`, `password_validity_days`, `ssl_required`, `username` or `site_admin`.
415
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]` or `[ company, name ]`.
441
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `name`, `company`, `password_validity_days`, `ssl_required`, `username`, `site_admin` or `disabled`.
442
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled` or `partner_id`. Valid field combinations are `[ site_admin, username ]`.
416
443
  # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
417
444
  # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
418
- # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`. Valid field combinations are `[ company, name ]`.
445
+ # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`.
419
446
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
420
447
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
421
448
  # ids - string - comma-separated list of User IDs
@@ -513,6 +540,7 @@ def get(id, params=None, options=None):
513
540
  # bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
514
541
  # dav_permission - boolean - Can the user connect with WebDAV?
515
542
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
543
+ # filesystem_layout - string - File system layout
516
544
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
517
545
  # header_text - string - Text to display to the user in the header of the UI
518
546
  # language - string - Preferred language
@@ -521,6 +549,8 @@ def get(id, params=None, options=None):
521
549
  # company - string - User's company
522
550
  # notes - string - Any internal notes on the user
523
551
  # office_integration_enabled - boolean - Enable integration with Office for the web?
552
+ # partner_admin - boolean - Is this user a Partner administrator?
553
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
524
554
  # password_validity_days - int64 - Number of days to allow user to use the same password
525
555
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
526
556
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -535,6 +565,7 @@ def get(id, params=None, options=None):
535
565
  # sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
536
566
  # subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
537
567
  # require_2fa - string - 2FA required setting
568
+ # tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
538
569
  # time_zone - string - User time zone
539
570
  # user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
540
571
  # user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
@@ -642,6 +673,12 @@ def create(params=None, options=None):
642
673
  )
643
674
  if "disabled" in params and not isinstance(params["disabled"], bool):
644
675
  raise InvalidParameterError("Bad parameter: disabled must be an bool")
676
+ if "filesystem_layout" in params and not isinstance(
677
+ params["filesystem_layout"], str
678
+ ):
679
+ raise InvalidParameterError(
680
+ "Bad parameter: filesystem_layout must be an str"
681
+ )
645
682
  if "ftp_permission" in params and not isinstance(
646
683
  params["ftp_permission"], bool
647
684
  ):
@@ -672,6 +709,14 @@ def create(params=None, options=None):
672
709
  raise InvalidParameterError(
673
710
  "Bad parameter: office_integration_enabled must be an bool"
674
711
  )
712
+ if "partner_admin" in params and not isinstance(
713
+ params["partner_admin"], bool
714
+ ):
715
+ raise InvalidParameterError(
716
+ "Bad parameter: partner_admin must be an bool"
717
+ )
718
+ if "partner_id" in params and not isinstance(params["partner_id"], int):
719
+ raise InvalidParameterError("Bad parameter: partner_id must be an int")
675
720
  if "password_validity_days" in params and not isinstance(
676
721
  params["password_validity_days"], int
677
722
  ):
@@ -752,6 +797,8 @@ def create(params=None, options=None):
752
797
  raise InvalidParameterError(
753
798
  "Bad parameter: require_2fa must be an str"
754
799
  )
800
+ if "tags" in params and not isinstance(params["tags"], str):
801
+ raise InvalidParameterError("Bad parameter: tags must be an str")
755
802
  if "time_zone" in params and not isinstance(params["time_zone"], str):
756
803
  raise InvalidParameterError("Bad parameter: time_zone must be an str")
757
804
  if "user_root" in params and not isinstance(params["user_root"], str):
@@ -842,6 +889,7 @@ def user_2fa_reset(id, params=None, options=None):
842
889
  # bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
843
890
  # dav_permission - boolean - Can the user connect with WebDAV?
844
891
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
892
+ # filesystem_layout - string - File system layout
845
893
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
846
894
  # header_text - string - Text to display to the user in the header of the UI
847
895
  # language - string - Preferred language
@@ -850,6 +898,8 @@ def user_2fa_reset(id, params=None, options=None):
850
898
  # company - string - User's company
851
899
  # notes - string - Any internal notes on the user
852
900
  # office_integration_enabled - boolean - Enable integration with Office for the web?
901
+ # partner_admin - boolean - Is this user a Partner administrator?
902
+ # partner_id - int64 - Partner ID if this user belongs to a Partner
853
903
  # password_validity_days - int64 - Number of days to allow user to use the same password
854
904
  # readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
855
905
  # receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
@@ -864,10 +914,13 @@ def user_2fa_reset(id, params=None, options=None):
864
914
  # sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
865
915
  # subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
866
916
  # require_2fa - string - 2FA required setting
917
+ # tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
867
918
  # time_zone - string - User time zone
868
919
  # user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
869
920
  # user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
870
921
  # username - string - User's username
922
+ # clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
923
+ # convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
871
924
  def update(id, params=None, options=None):
872
925
  if not isinstance(params, dict):
873
926
  params = {}
@@ -974,6 +1027,12 @@ def update(id, params=None, options=None):
974
1027
  )
975
1028
  if "disabled" in params and not isinstance(params["disabled"], bool):
976
1029
  raise InvalidParameterError("Bad parameter: disabled must be an bool")
1030
+ if "filesystem_layout" in params and not isinstance(
1031
+ params["filesystem_layout"], str
1032
+ ):
1033
+ raise InvalidParameterError(
1034
+ "Bad parameter: filesystem_layout must be an str"
1035
+ )
977
1036
  if "ftp_permission" in params and not isinstance(
978
1037
  params["ftp_permission"], bool
979
1038
  ):
@@ -1004,6 +1063,14 @@ def update(id, params=None, options=None):
1004
1063
  raise InvalidParameterError(
1005
1064
  "Bad parameter: office_integration_enabled must be an bool"
1006
1065
  )
1066
+ if "partner_admin" in params and not isinstance(
1067
+ params["partner_admin"], bool
1068
+ ):
1069
+ raise InvalidParameterError(
1070
+ "Bad parameter: partner_admin must be an bool"
1071
+ )
1072
+ if "partner_id" in params and not isinstance(params["partner_id"], int):
1073
+ raise InvalidParameterError("Bad parameter: partner_id must be an int")
1007
1074
  if "password_validity_days" in params and not isinstance(
1008
1075
  params["password_validity_days"], int
1009
1076
  ):
@@ -1084,6 +1151,8 @@ def update(id, params=None, options=None):
1084
1151
  raise InvalidParameterError(
1085
1152
  "Bad parameter: require_2fa must be an str"
1086
1153
  )
1154
+ if "tags" in params and not isinstance(params["tags"], str):
1155
+ raise InvalidParameterError("Bad parameter: tags must be an str")
1087
1156
  if "time_zone" in params and not isinstance(params["time_zone"], str):
1088
1157
  raise InvalidParameterError("Bad parameter: time_zone must be an str")
1089
1158
  if "user_root" in params and not isinstance(params["user_root"], str):
@@ -1092,6 +1161,14 @@ def update(id, params=None, options=None):
1092
1161
  raise InvalidParameterError("Bad parameter: user_home must be an str")
1093
1162
  if "username" in params and not isinstance(params["username"], str):
1094
1163
  raise InvalidParameterError("Bad parameter: username must be an str")
1164
+ if "clear_2fa" in params and not isinstance(params["clear_2fa"], bool):
1165
+ raise InvalidParameterError("Bad parameter: clear_2fa must be an bool")
1166
+ if "convert_to_partner_user" in params and not isinstance(
1167
+ params["convert_to_partner_user"], bool
1168
+ ):
1169
+ raise InvalidParameterError(
1170
+ "Bad parameter: convert_to_partner_user must be an bool"
1171
+ )
1095
1172
  if "id" not in params:
1096
1173
  raise MissingParameterError("Parameter missing: id")
1097
1174
  response, options = Api.send_request(
@@ -11,12 +11,13 @@ from files_sdk.error import ( # noqa: F401
11
11
  class UserCipherUse:
12
12
  default_attributes = {
13
13
  "id": None, # int64 - UserCipherUse ID
14
+ "user_id": None, # int64 - ID of the user who performed this access
15
+ "username": None, # string - Username of the user who performed this access
14
16
  "protocol_cipher": None, # string - The protocol and cipher employed
15
17
  "created_at": None, # date-time - The earliest recorded use of this combination of interface and protocol and cipher (for this user)
16
18
  "insecure": None, # boolean - Is this cipher considered insecure?
17
19
  "interface": None, # string - The interface accessed
18
20
  "updated_at": None, # date-time - The most recent use of this combination of interface and protocol and cipher (for this user)
19
- "user_id": None, # int64 - ID of the user who performed this access
20
21
  }
21
22
 
22
23
  def __init__(self, attributes=None, options=None):
@@ -46,6 +47,12 @@ class UserCipherUse:
46
47
  # user_id - int64 - User ID. If provided, will return uses for this user.
47
48
  # 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.
48
49
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
50
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `updated_at`.
51
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `insecure` and `updated_at`. Valid field combinations are `[ insecure, updated_at ]`.
52
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `updated_at`.
53
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `updated_at`.
54
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `updated_at`.
55
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `updated_at`.
49
56
  def list(params=None, options=None):
50
57
  if not isinstance(params, dict):
51
58
  params = {}
@@ -57,6 +64,22 @@ def list(params=None, options=None):
57
64
  raise InvalidParameterError("Bad parameter: cursor must be an str")
58
65
  if "per_page" in params and not isinstance(params["per_page"], int):
59
66
  raise InvalidParameterError("Bad parameter: per_page must be an int")
67
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
68
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
69
+ if "filter" in params and not isinstance(params["filter"], dict):
70
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
71
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
72
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
73
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
74
+ raise InvalidParameterError(
75
+ "Bad parameter: filter_gteq must be an dict"
76
+ )
77
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
78
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
79
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
80
+ raise InvalidParameterError(
81
+ "Bad parameter: filter_lteq must be an dict"
82
+ )
60
83
  return ListObj(UserCipherUse, "GET", "/user_cipher_uses", params, options)
61
84
 
62
85
 
@@ -11,13 +11,17 @@ from files_sdk.error import ( # noqa: F401
11
11
  class UserLifecycleRule:
12
12
  default_attributes = {
13
13
  "id": None, # int64 - User Lifecycle Rule ID
14
- "authentication_method": None, # string - User authentication method for the rule
15
- "inactivity_days": None, # int64 - Number of days of inactivity before the rule applies
16
- "include_folder_admins": None, # boolean - Include folder admins in the rule
17
- "include_site_admins": None, # boolean - Include site admins in the rule
14
+ "authentication_method": None, # string - User authentication method for which the rule will apply.
15
+ "group_ids": None, # array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
18
16
  "action": None, # string - Action to take on inactive users (disable or delete)
19
- "user_state": None, # string - State of the users to apply the rule to (inactive or disabled)
17
+ "inactivity_days": None, # int64 - Number of days of inactivity before the rule applies
18
+ "include_folder_admins": None, # boolean - If true, the rule will apply to folder admins.
19
+ "include_site_admins": None, # boolean - If true, the rule will apply to site admins.
20
+ "name": None, # string - User Lifecycle Rule name
21
+ "partner_tag": None, # string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
20
22
  "site_id": None, # int64 - Site ID
23
+ "user_state": None, # string - State of the users to apply the rule to (inactive or disabled)
24
+ "user_tag": None, # string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
21
25
  }
22
26
 
23
27
  def __init__(self, attributes=None, options=None):
@@ -43,12 +47,16 @@ class UserLifecycleRule:
43
47
  }
44
48
 
45
49
  # Parameters:
46
- # action (required) - string - Action to take on inactive users (disable or delete)
47
- # authentication_method (required) - string - User authentication method for the rule
48
- # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
49
- # include_site_admins - boolean - Include site admins in the rule
50
- # include_folder_admins - boolean - Include folder admins in the rule
50
+ # action - string - Action to take on inactive users (disable or delete)
51
+ # authentication_method - string - User authentication method for which the rule will apply.
52
+ # group_ids - array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
53
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies
54
+ # include_site_admins - boolean - If true, the rule will apply to site admins.
55
+ # include_folder_admins - boolean - If true, the rule will apply to folder admins.
56
+ # name - string - User Lifecycle Rule name
57
+ # partner_tag - string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
51
58
  # user_state - string - State of the users to apply the rule to (inactive or disabled)
59
+ # user_tag - string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
52
60
  def update(self, params=None):
53
61
  if not isinstance(params, dict):
54
62
  params = {}
@@ -59,14 +67,6 @@ class UserLifecycleRule:
59
67
  raise MissingParameterError("Current object doesn't have a id")
60
68
  if "id" not in params:
61
69
  raise MissingParameterError("Parameter missing: id")
62
- if "action" not in params:
63
- raise MissingParameterError("Parameter missing: action")
64
- if "authentication_method" not in params:
65
- raise MissingParameterError(
66
- "Parameter missing: authentication_method"
67
- )
68
- if "inactivity_days" not in params:
69
- raise MissingParameterError("Parameter missing: inactivity_days")
70
70
  if "id" in params and not isinstance(params["id"], int):
71
71
  raise InvalidParameterError("Bad parameter: id must be an int")
72
72
  if "action" in params and not isinstance(params["action"], str):
@@ -77,18 +77,36 @@ class UserLifecycleRule:
77
77
  raise InvalidParameterError(
78
78
  "Bad parameter: authentication_method must be an str"
79
79
  )
80
+ if "group_ids" in params and not isinstance(
81
+ params["group_ids"], builtins.list
82
+ ):
83
+ raise InvalidParameterError(
84
+ "Bad parameter: group_ids must be an list"
85
+ )
80
86
  if "inactivity_days" in params and not isinstance(
81
87
  params["inactivity_days"], int
82
88
  ):
83
89
  raise InvalidParameterError(
84
90
  "Bad parameter: inactivity_days must be an int"
85
91
  )
92
+ if "name" in params and not isinstance(params["name"], str):
93
+ raise InvalidParameterError("Bad parameter: name must be an str")
94
+ if "partner_tag" in params and not isinstance(
95
+ params["partner_tag"], str
96
+ ):
97
+ raise InvalidParameterError(
98
+ "Bad parameter: partner_tag must be an str"
99
+ )
86
100
  if "user_state" in params and not isinstance(
87
101
  params["user_state"], str
88
102
  ):
89
103
  raise InvalidParameterError(
90
104
  "Bad parameter: user_state must be an str"
91
105
  )
106
+ if "user_tag" in params and not isinstance(params["user_tag"], str):
107
+ raise InvalidParameterError(
108
+ "Bad parameter: user_tag must be an str"
109
+ )
92
110
  response, _options = Api.send_request(
93
111
  "PATCH",
94
112
  "/user_lifecycle_rules/{id}".format(id=params["id"]),
@@ -133,6 +151,7 @@ class UserLifecycleRule:
133
151
  # Parameters:
134
152
  # 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.
135
153
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
154
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`.
136
155
  def list(params=None, options=None):
137
156
  if not isinstance(params, dict):
138
157
  params = {}
@@ -142,6 +161,8 @@ def list(params=None, options=None):
142
161
  raise InvalidParameterError("Bad parameter: cursor must be an str")
143
162
  if "per_page" in params and not isinstance(params["per_page"], int):
144
163
  raise InvalidParameterError("Bad parameter: per_page must be an int")
164
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
165
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
145
166
  return ListObj(
146
167
  UserLifecycleRule, "GET", "/user_lifecycle_rules", params, options
147
168
  )
@@ -177,12 +198,16 @@ def get(id, params=None, options=None):
177
198
 
178
199
 
179
200
  # Parameters:
180
- # action (required) - string - Action to take on inactive users (disable or delete)
181
- # authentication_method (required) - string - User authentication method for the rule
182
- # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
183
- # include_site_admins - boolean - Include site admins in the rule
184
- # include_folder_admins - boolean - Include folder admins in the rule
201
+ # action - string - Action to take on inactive users (disable or delete)
202
+ # authentication_method - string - User authentication method for which the rule will apply.
203
+ # group_ids - array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
204
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies
205
+ # include_site_admins - boolean - If true, the rule will apply to site admins.
206
+ # include_folder_admins - boolean - If true, the rule will apply to folder admins.
207
+ # name - string - User Lifecycle Rule name
208
+ # partner_tag - string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
185
209
  # user_state - string - State of the users to apply the rule to (inactive or disabled)
210
+ # user_tag - string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
186
211
  def create(params=None, options=None):
187
212
  if not isinstance(params, dict):
188
213
  params = {}
@@ -196,6 +221,10 @@ def create(params=None, options=None):
196
221
  raise InvalidParameterError(
197
222
  "Bad parameter: authentication_method must be an str"
198
223
  )
224
+ if "group_ids" in params and not isinstance(
225
+ params["group_ids"], builtins.list
226
+ ):
227
+ raise InvalidParameterError("Bad parameter: group_ids must be an list")
199
228
  if "inactivity_days" in params and not isinstance(
200
229
  params["inactivity_days"], int
201
230
  ):
@@ -214,14 +243,16 @@ def create(params=None, options=None):
214
243
  raise InvalidParameterError(
215
244
  "Bad parameter: include_folder_admins must be an bool"
216
245
  )
246
+ if "name" in params and not isinstance(params["name"], str):
247
+ raise InvalidParameterError("Bad parameter: name must be an str")
248
+ if "partner_tag" in params and not isinstance(params["partner_tag"], str):
249
+ raise InvalidParameterError(
250
+ "Bad parameter: partner_tag must be an str"
251
+ )
217
252
  if "user_state" in params and not isinstance(params["user_state"], str):
218
253
  raise InvalidParameterError("Bad parameter: user_state must be an str")
219
- if "action" not in params:
220
- raise MissingParameterError("Parameter missing: action")
221
- if "authentication_method" not in params:
222
- raise MissingParameterError("Parameter missing: authentication_method")
223
- if "inactivity_days" not in params:
224
- raise MissingParameterError("Parameter missing: inactivity_days")
254
+ if "user_tag" in params and not isinstance(params["user_tag"], str):
255
+ raise InvalidParameterError("Bad parameter: user_tag must be an str")
225
256
  response, options = Api.send_request(
226
257
  "POST", "/user_lifecycle_rules", params, options
227
258
  )
@@ -229,12 +260,16 @@ def create(params=None, options=None):
229
260
 
230
261
 
231
262
  # Parameters:
232
- # action (required) - string - Action to take on inactive users (disable or delete)
233
- # authentication_method (required) - string - User authentication method for the rule
234
- # inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
235
- # include_site_admins - boolean - Include site admins in the rule
236
- # include_folder_admins - boolean - Include folder admins in the rule
263
+ # action - string - Action to take on inactive users (disable or delete)
264
+ # authentication_method - string - User authentication method for which the rule will apply.
265
+ # group_ids - array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
266
+ # inactivity_days - int64 - Number of days of inactivity before the rule applies
267
+ # include_site_admins - boolean - If true, the rule will apply to site admins.
268
+ # include_folder_admins - boolean - If true, the rule will apply to folder admins.
269
+ # name - string - User Lifecycle Rule name
270
+ # partner_tag - string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
237
271
  # user_state - string - State of the users to apply the rule to (inactive or disabled)
272
+ # user_tag - string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
238
273
  def update(id, params=None, options=None):
239
274
  if not isinstance(params, dict):
240
275
  params = {}
@@ -251,6 +286,10 @@ def update(id, params=None, options=None):
251
286
  raise InvalidParameterError(
252
287
  "Bad parameter: authentication_method must be an str"
253
288
  )
289
+ if "group_ids" in params and not isinstance(
290
+ params["group_ids"], builtins.list
291
+ ):
292
+ raise InvalidParameterError("Bad parameter: group_ids must be an list")
254
293
  if "inactivity_days" in params and not isinstance(
255
294
  params["inactivity_days"], int
256
295
  ):
@@ -269,16 +308,18 @@ def update(id, params=None, options=None):
269
308
  raise InvalidParameterError(
270
309
  "Bad parameter: include_folder_admins must be an bool"
271
310
  )
311
+ if "name" in params and not isinstance(params["name"], str):
312
+ raise InvalidParameterError("Bad parameter: name must be an str")
313
+ if "partner_tag" in params and not isinstance(params["partner_tag"], str):
314
+ raise InvalidParameterError(
315
+ "Bad parameter: partner_tag must be an str"
316
+ )
272
317
  if "user_state" in params and not isinstance(params["user_state"], str):
273
318
  raise InvalidParameterError("Bad parameter: user_state must be an str")
319
+ if "user_tag" in params and not isinstance(params["user_tag"], str):
320
+ raise InvalidParameterError("Bad parameter: user_tag must be an str")
274
321
  if "id" not in params:
275
322
  raise MissingParameterError("Parameter missing: id")
276
- if "action" not in params:
277
- raise MissingParameterError("Parameter missing: action")
278
- if "authentication_method" not in params:
279
- raise MissingParameterError("Parameter missing: authentication_method")
280
- if "inactivity_days" not in params:
281
- raise MissingParameterError("Parameter missing: inactivity_days")
282
323
  response, options = Api.send_request(
283
324
  "PATCH",
284
325
  "/user_lifecycle_rules/{id}".format(id=params["id"]),