files-com 1.6.121__py3-none-any.whl → 1.6.191__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.
- README.md +1 -0
- _VERSION +1 -1
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/METADATA +2 -1
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/RECORD +36 -31
- files_sdk/__init__.py +11 -1
- files_sdk/error.py +15 -0
- files_sdk/models/__init__.py +5 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +7 -21
- files_sdk/models/as2_incoming_message.py +3 -9
- files_sdk/models/as2_outgoing_message.py +3 -9
- files_sdk/models/as2_partner.py +7 -0
- files_sdk/models/as2_station.py +15 -4
- files_sdk/models/automation.py +10 -2
- files_sdk/models/automation_run.py +2 -1
- files_sdk/models/behavior.py +12 -14
- files_sdk/models/bundle.py +9 -1
- files_sdk/models/file.py +2 -2
- files_sdk/models/folder.py +2 -2
- files_sdk/models/gpg_key.py +51 -24
- files_sdk/models/group.py +10 -2
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/partner.py +12 -1
- files_sdk/models/public_key.py +3 -2
- files_sdk/models/remote_server.py +141 -20
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/restore.py +20 -0
- files_sdk/models/site.py +12 -12
- files_sdk/models/sync.py +14 -0
- files_sdk/models/sync_run.py +3 -2
- files_sdk/models/user.py +26 -2
- files_sdk/models/workspace.py +202 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/WHEEL +0 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/licenses/LICENSE +0 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/top_level.txt +0 -0
files_sdk/models/restore.py
CHANGED
|
@@ -19,8 +19,15 @@ class Restore:
|
|
|
19
19
|
"files_errored": None, # int64 - Number of files that were not able to be restored.
|
|
20
20
|
"files_total": None, # int64 - Total number of files processed.
|
|
21
21
|
"prefix": None, # string - Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash. To restore all deleted items, specify an empty string (`''`) in the prefix field or omit the field from the request.
|
|
22
|
+
"restoration_type": None, # string - Type of restoration to perform. `files` restores deleted filesystem items. `users` restores deleted users and associated access/authentication records.
|
|
22
23
|
"restore_in_place": None, # boolean - If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
|
23
24
|
"restore_deleted_permissions": None, # boolean - If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
|
25
|
+
"users_restored": None, # int64 - Number of users successfully restored (only present for `restoration_type=users`).
|
|
26
|
+
"users_errored": None, # int64 - Number of users that failed to restore (only present for `restoration_type=users`).
|
|
27
|
+
"users_total": None, # int64 - Total number of users processed (only present for `restoration_type=users`).
|
|
28
|
+
"api_keys_restored": None, # int64 - Number of API keys restored (only present for `restoration_type=users`).
|
|
29
|
+
"public_keys_restored": None, # int64 - Number of public keys restored (only present for `restoration_type=users`).
|
|
30
|
+
"two_factor_authentication_methods_restored": None, # int64 - Number of two factor authentication methods restored (only present for `restoration_type=users`).
|
|
24
31
|
"status": None, # string - Status of the restoration process.
|
|
25
32
|
"update_timestamps": None, # boolean - If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
|
|
26
33
|
"error_messages": None, # array(string) - Error messages received while restoring files and/or directories. Only present if there were errors.
|
|
@@ -59,6 +66,8 @@ class Restore:
|
|
|
59
66
|
# Parameters:
|
|
60
67
|
# 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.
|
|
61
68
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
69
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
70
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `restoration_type`.
|
|
62
71
|
def list(params=None, options=None):
|
|
63
72
|
if not isinstance(params, dict):
|
|
64
73
|
params = {}
|
|
@@ -68,6 +77,10 @@ def list(params=None, options=None):
|
|
|
68
77
|
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
69
78
|
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
70
79
|
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
80
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
81
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
82
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
83
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
71
84
|
return ListObj(Restore, "GET", "/restores", params, options)
|
|
72
85
|
|
|
73
86
|
|
|
@@ -78,6 +91,7 @@ def all(params=None, options=None):
|
|
|
78
91
|
# Parameters:
|
|
79
92
|
# earliest_date (required) - string - Restore all files deleted after this date/time. Don't set this earlier than you need. Can not be greater than 365 days prior to the restore request.
|
|
80
93
|
# prefix - string - Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash. To restore all deleted items, specify an empty string (`''`) in the prefix field or omit the field from the request.
|
|
94
|
+
# restoration_type - string - Type of restoration to perform. `files` restores deleted filesystem items. `users` restores deleted users and associated access/authentication records.
|
|
81
95
|
# restore_deleted_permissions - boolean - If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
|
82
96
|
# restore_in_place - boolean - If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
|
83
97
|
# update_timestamps - boolean - If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
|
|
@@ -94,6 +108,12 @@ def create(params=None, options=None):
|
|
|
94
108
|
)
|
|
95
109
|
if "prefix" in params and not isinstance(params["prefix"], str):
|
|
96
110
|
raise InvalidParameterError("Bad parameter: prefix must be an str")
|
|
111
|
+
if "restoration_type" in params and not isinstance(
|
|
112
|
+
params["restoration_type"], str
|
|
113
|
+
):
|
|
114
|
+
raise InvalidParameterError(
|
|
115
|
+
"Bad parameter: restoration_type must be an str"
|
|
116
|
+
)
|
|
97
117
|
if "restore_deleted_permissions" in params and not isinstance(
|
|
98
118
|
params["restore_deleted_permissions"], bool
|
|
99
119
|
):
|
files_sdk/models/site.py
CHANGED
|
@@ -157,7 +157,6 @@ class Site:
|
|
|
157
157
|
"smtp_from": None, # string - From address to use when mailing through custom SMTP
|
|
158
158
|
"smtp_port": None, # int64 - SMTP server port
|
|
159
159
|
"smtp_username": None, # string - SMTP server username
|
|
160
|
-
"session_expiry": None, # double - Session expiry in hours
|
|
161
160
|
"session_expiry_minutes": None, # int64 - Session expiry in minutes
|
|
162
161
|
"snapshot_sharing_enabled": None, # boolean - Allow snapshot share links creation
|
|
163
162
|
"ssl_required": None, # boolean - Is SSL required? Disabling this is insecure.
|
|
@@ -177,6 +176,7 @@ class Site:
|
|
|
177
176
|
"users_can_create_api_keys": None, # boolean - Allow users to create their own API keys?
|
|
178
177
|
"users_can_create_ssh_keys": None, # boolean - Allow users to create their own SSH keys?
|
|
179
178
|
"welcome_custom_text": None, # string - Custom text send in user welcome email
|
|
179
|
+
"email_footer_custom_text": None, # string - Custom footer text for system-generated emails. Supports standard strftime date/time patterns like %Y (4-digit year), %m (month), %d (day).
|
|
180
180
|
"welcome_email_cc": None, # email - Include this email in welcome emails if enabled
|
|
181
181
|
"welcome_email_subject": None, # string - Include this email subject in welcome emails if enabled
|
|
182
182
|
"welcome_email_enabled": None, # boolean - Will the welcome email be sent to new users?
|
|
@@ -268,7 +268,7 @@ def get_usage(params=None, options=None):
|
|
|
268
268
|
# legacy_checksums_mode - boolean - Use legacy checksums mode?
|
|
269
269
|
# migrate_remote_server_sync_to_sync - boolean - If true, we will migrate all remote server syncs to the new Sync model.
|
|
270
270
|
# as2_message_retention_days - int64 - Number of days to retain AS2 messages (incoming and outgoing).
|
|
271
|
-
#
|
|
271
|
+
# session_expiry_minutes - int64 - Session expiry in minutes
|
|
272
272
|
# ssl_required - boolean - Is SSL required? Disabling this is insecure.
|
|
273
273
|
# sftp_insecure_ciphers - boolean - If true, we will allow weak and known insecure ciphers to be used for SFTP connections. Enabling this setting severely weakens the security of your site and it is not recommend, except as a last resort for compatibility.
|
|
274
274
|
# sftp_insecure_diffie_hellman - boolean - If true, we will allow weak Diffie Hellman parameters to be used within ciphers for SFTP that are otherwise on our secure list. This has the effect of making the cipher weaker than our normal threshold for security, but is required to support certain legacy or broken SSH and MFT clients. Enabling this weakens security, but not nearly as much as enabling the full `sftp_insecure_ciphers` option.
|
|
@@ -349,6 +349,7 @@ def get_usage(params=None, options=None):
|
|
|
349
349
|
# site_public_footer - string - Custom site footer text for public pages
|
|
350
350
|
# login_help_text - string - Login help text
|
|
351
351
|
# use_dedicated_ips_for_smtp - boolean - If using custom SMTP, should we use dedicated IPs to deliver emails?
|
|
352
|
+
# email_footer_custom_text - string - Custom footer text for system-generated emails. Supports standard strftime date/time patterns like %Y (4-digit year), %m (month), %d (day).
|
|
352
353
|
# smtp_address - string - SMTP server hostname or IP
|
|
353
354
|
# smtp_authentication - string - SMTP server authentication type
|
|
354
355
|
# smtp_from - string - From address to use when mailing through custom SMTP
|
|
@@ -389,7 +390,6 @@ def get_usage(params=None, options=None):
|
|
|
389
390
|
# ldap_password_change - string - New LDAP password.
|
|
390
391
|
# ldap_password_change_confirmation - string - Confirm new LDAP password.
|
|
391
392
|
# smtp_password - string - Password for SMTP server.
|
|
392
|
-
# session_expiry_minutes - int64 - Session expiry in minutes
|
|
393
393
|
def update(params=None, options=None):
|
|
394
394
|
if not isinstance(params, dict):
|
|
395
395
|
params = {}
|
|
@@ -631,11 +631,11 @@ def update(params=None, options=None):
|
|
|
631
631
|
raise InvalidParameterError(
|
|
632
632
|
"Bad parameter: as2_message_retention_days must be an int"
|
|
633
633
|
)
|
|
634
|
-
if "
|
|
635
|
-
params["
|
|
634
|
+
if "session_expiry_minutes" in params and not isinstance(
|
|
635
|
+
params["session_expiry_minutes"], int
|
|
636
636
|
):
|
|
637
637
|
raise InvalidParameterError(
|
|
638
|
-
"Bad parameter:
|
|
638
|
+
"Bad parameter: session_expiry_minutes must be an int"
|
|
639
639
|
)
|
|
640
640
|
if "ssl_required" in params and not isinstance(
|
|
641
641
|
params["ssl_required"], bool
|
|
@@ -1107,6 +1107,12 @@ def update(params=None, options=None):
|
|
|
1107
1107
|
raise InvalidParameterError(
|
|
1108
1108
|
"Bad parameter: use_dedicated_ips_for_smtp must be an bool"
|
|
1109
1109
|
)
|
|
1110
|
+
if "email_footer_custom_text" in params and not isinstance(
|
|
1111
|
+
params["email_footer_custom_text"], str
|
|
1112
|
+
):
|
|
1113
|
+
raise InvalidParameterError(
|
|
1114
|
+
"Bad parameter: email_footer_custom_text must be an str"
|
|
1115
|
+
)
|
|
1110
1116
|
if "smtp_address" in params and not isinstance(
|
|
1111
1117
|
params["smtp_address"], str
|
|
1112
1118
|
):
|
|
@@ -1275,12 +1281,6 @@ def update(params=None, options=None):
|
|
|
1275
1281
|
raise InvalidParameterError(
|
|
1276
1282
|
"Bad parameter: smtp_password must be an str"
|
|
1277
1283
|
)
|
|
1278
|
-
if "session_expiry_minutes" in params and not isinstance(
|
|
1279
|
-
params["session_expiry_minutes"], int
|
|
1280
|
-
):
|
|
1281
|
-
raise InvalidParameterError(
|
|
1282
|
-
"Bad parameter: session_expiry_minutes must be an int"
|
|
1283
|
-
)
|
|
1284
1284
|
response, options = Api.send_request("PATCH", "/site", params, options)
|
|
1285
1285
|
return Site(response.data, options)
|
|
1286
1286
|
|
files_sdk/models/sync.py
CHANGED
|
@@ -14,6 +14,7 @@ class Sync:
|
|
|
14
14
|
"name": None, # string - Name for this sync job
|
|
15
15
|
"description": None, # string - Description for this sync job
|
|
16
16
|
"site_id": None, # int64 - Site ID this sync belongs to
|
|
17
|
+
"workspace_id": None, # int64 - Workspace ID this sync belongs to
|
|
17
18
|
"user_id": None, # int64 - User who created or owns this sync
|
|
18
19
|
"src_path": None, # string - Absolute source path for the sync
|
|
19
20
|
"dest_path": None, # string - Absolute destination path for the sync
|
|
@@ -251,6 +252,8 @@ class Sync:
|
|
|
251
252
|
# Parameters:
|
|
252
253
|
# 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.
|
|
253
254
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
255
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id` or `name`.
|
|
256
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`, `disabled`, `src_remote_server_id` or `dest_remote_server_id`. Valid field combinations are `[ workspace_id, disabled ]`, `[ workspace_id, src_remote_server_id ]`, `[ workspace_id, dest_remote_server_id ]`, `[ disabled, src_remote_server_id ]`, `[ disabled, dest_remote_server_id ]`, `[ workspace_id, disabled, src_remote_server_id ]` or `[ workspace_id, disabled, dest_remote_server_id ]`.
|
|
254
257
|
def list(params=None, options=None):
|
|
255
258
|
if not isinstance(params, dict):
|
|
256
259
|
params = {}
|
|
@@ -260,6 +263,10 @@ def list(params=None, options=None):
|
|
|
260
263
|
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
261
264
|
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
262
265
|
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
266
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
267
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
268
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
269
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
263
270
|
return ListObj(Sync, "GET", "/syncs", params, options)
|
|
264
271
|
|
|
265
272
|
|
|
@@ -308,6 +315,7 @@ def get(id, params=None, options=None):
|
|
|
308
315
|
# schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
|
309
316
|
# schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
|
|
310
317
|
# schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
|
|
318
|
+
# workspace_id - int64 - Workspace ID this sync belongs to
|
|
311
319
|
def create(params=None, options=None):
|
|
312
320
|
if not isinstance(params, dict):
|
|
313
321
|
params = {}
|
|
@@ -395,6 +403,12 @@ def create(params=None, options=None):
|
|
|
395
403
|
raise InvalidParameterError(
|
|
396
404
|
"Bad parameter: schedule_times_of_day must be an list"
|
|
397
405
|
)
|
|
406
|
+
if "workspace_id" in params and not isinstance(
|
|
407
|
+
params["workspace_id"], int
|
|
408
|
+
):
|
|
409
|
+
raise InvalidParameterError(
|
|
410
|
+
"Bad parameter: workspace_id must be an int"
|
|
411
|
+
)
|
|
398
412
|
response, options = Api.send_request("POST", "/syncs", params, options)
|
|
399
413
|
return Sync(response.data, options)
|
|
400
414
|
|
files_sdk/models/sync_run.py
CHANGED
|
@@ -25,6 +25,7 @@ class SyncRun:
|
|
|
25
25
|
"log_url": None, # string - Link to external log file.
|
|
26
26
|
"runtime": None, # double - Total runtime in seconds
|
|
27
27
|
"site_id": None, # int64 - Site ID
|
|
28
|
+
"workspace_id": None, # int64 - Workspace ID
|
|
28
29
|
"src_remote_server_type": None, # string - Source remote server type, if any
|
|
29
30
|
"status": None, # string - Status of the sync run (success, failure, partial_failure, in_progress, skipped)
|
|
30
31
|
"successful_files": None, # int64 - Number of files successfully synced
|
|
@@ -57,8 +58,8 @@ class SyncRun:
|
|
|
57
58
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
58
59
|
# 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.
|
|
59
60
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
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 ]`.
|
|
61
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id`, `sync_id`, `created_at` or `status`.
|
|
62
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `status`, `dry_run`, `workspace_id`, `src_remote_server_type`, `dest_remote_server_type` or `sync_id`. Valid field combinations are `[ status, created_at ]`, `[ workspace_id, created_at ]`, `[ src_remote_server_type, created_at ]`, `[ dest_remote_server_type, created_at ]`, `[ sync_id, created_at ]`, `[ workspace_id, status ]`, `[ src_remote_server_type, status ]`, `[ dest_remote_server_type, status ]`, `[ sync_id, status ]`, `[ workspace_id, src_remote_server_type ]`, `[ workspace_id, dest_remote_server_type ]`, `[ workspace_id, sync_id ]`, `[ workspace_id, status, created_at ]`, `[ src_remote_server_type, status, created_at ]`, `[ dest_remote_server_type, status, created_at ]`, `[ sync_id, status, created_at ]`, `[ workspace_id, src_remote_server_type, created_at ]`, `[ workspace_id, dest_remote_server_type, created_at ]`, `[ workspace_id, sync_id, created_at ]`, `[ workspace_id, src_remote_server_type, status ]`, `[ workspace_id, dest_remote_server_type, status ]`, `[ workspace_id, sync_id, status ]`, `[ workspace_id, src_remote_server_type, status, created_at ]`, `[ workspace_id, dest_remote_server_type, status, created_at ]` or `[ workspace_id, sync_id, status, created_at ]`.
|
|
62
63
|
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
63
64
|
# 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
65
|
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
files_sdk/models/user.py
CHANGED
|
@@ -67,7 +67,9 @@ class User:
|
|
|
67
67
|
"self_managed": None, # boolean - Does this user manage it's own credentials or is it a shared/bot user?
|
|
68
68
|
"sftp_permission": None, # boolean - Can the user access with SFTP?
|
|
69
69
|
"site_admin": None, # boolean - Is the user an administrator for this site?
|
|
70
|
+
"workspace_admin": None, # boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
|
|
70
71
|
"site_id": None, # int64 - Site ID
|
|
72
|
+
"workspace_id": None, # int64 - Workspace ID
|
|
71
73
|
"skip_welcome_screen": None, # boolean - Skip Welcome page in the UI?
|
|
72
74
|
"ssl_required": None, # string - SSL required setting
|
|
73
75
|
"sso_strategy_id": None, # int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
|
|
@@ -225,6 +227,7 @@ class User:
|
|
|
225
227
|
# time_zone - string - User time zone
|
|
226
228
|
# 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.
|
|
227
229
|
# user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
|
230
|
+
# workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
|
|
228
231
|
# username - string - User's username
|
|
229
232
|
# clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
|
|
230
233
|
# convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
|
|
@@ -438,8 +441,8 @@ class User:
|
|
|
438
441
|
# Parameters:
|
|
439
442
|
# 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.
|
|
440
443
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
441
|
-
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `
|
|
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 `
|
|
444
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id`, `company`, `name`, `disabled`, `authenticate_until`, `username`, `email`, `last_desktop_login_at`, `last_login_at`, `site_admin`, `password_validity_days` or `ssl_required`.
|
|
445
|
+
# 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`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[ company, name ]`, `[ workspace_id, name ]`, `[ workspace_id, email ]`, `[ workspace_id, company ]`, `[ workspace_id, disabled ]`, `[ workspace_id, disabled, username ]` or `[ workspace_id, company, name ]`.
|
|
443
446
|
# 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`.
|
|
444
447
|
# 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`.
|
|
445
448
|
# 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 ]`.
|
|
@@ -569,7 +572,9 @@ def get(id, params=None, options=None):
|
|
|
569
572
|
# time_zone - string - User time zone
|
|
570
573
|
# 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.
|
|
571
574
|
# user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
|
575
|
+
# workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
|
|
572
576
|
# username (required) - string - User's username
|
|
577
|
+
# workspace_id - int64 - Workspace ID
|
|
573
578
|
def create(params=None, options=None):
|
|
574
579
|
if not isinstance(params, dict):
|
|
575
580
|
params = {}
|
|
@@ -805,8 +810,20 @@ def create(params=None, options=None):
|
|
|
805
810
|
raise InvalidParameterError("Bad parameter: user_root must be an str")
|
|
806
811
|
if "user_home" in params and not isinstance(params["user_home"], str):
|
|
807
812
|
raise InvalidParameterError("Bad parameter: user_home must be an str")
|
|
813
|
+
if "workspace_admin" in params and not isinstance(
|
|
814
|
+
params["workspace_admin"], bool
|
|
815
|
+
):
|
|
816
|
+
raise InvalidParameterError(
|
|
817
|
+
"Bad parameter: workspace_admin must be an bool"
|
|
818
|
+
)
|
|
808
819
|
if "username" in params and not isinstance(params["username"], str):
|
|
809
820
|
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
821
|
+
if "workspace_id" in params and not isinstance(
|
|
822
|
+
params["workspace_id"], int
|
|
823
|
+
):
|
|
824
|
+
raise InvalidParameterError(
|
|
825
|
+
"Bad parameter: workspace_id must be an int"
|
|
826
|
+
)
|
|
810
827
|
if "username" not in params:
|
|
811
828
|
raise MissingParameterError("Parameter missing: username")
|
|
812
829
|
response, options = Api.send_request("POST", "/users", params, options)
|
|
@@ -918,6 +935,7 @@ def user_2fa_reset(id, params=None, options=None):
|
|
|
918
935
|
# time_zone - string - User time zone
|
|
919
936
|
# 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.
|
|
920
937
|
# user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
|
938
|
+
# workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
|
|
921
939
|
# username - string - User's username
|
|
922
940
|
# clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
|
|
923
941
|
# convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
|
|
@@ -1159,6 +1177,12 @@ def update(id, params=None, options=None):
|
|
|
1159
1177
|
raise InvalidParameterError("Bad parameter: user_root must be an str")
|
|
1160
1178
|
if "user_home" in params and not isinstance(params["user_home"], str):
|
|
1161
1179
|
raise InvalidParameterError("Bad parameter: user_home must be an str")
|
|
1180
|
+
if "workspace_admin" in params and not isinstance(
|
|
1181
|
+
params["workspace_admin"], bool
|
|
1182
|
+
):
|
|
1183
|
+
raise InvalidParameterError(
|
|
1184
|
+
"Bad parameter: workspace_admin must be an bool"
|
|
1185
|
+
)
|
|
1162
1186
|
if "username" in params and not isinstance(params["username"], str):
|
|
1163
1187
|
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
1164
1188
|
if "clear_2fa" in params and not isinstance(params["clear_2fa"], bool):
|
|
@@ -0,0 +1,202 @@
|
|
|
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 Workspace:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Workspace ID
|
|
14
|
+
"name": None, # string - Workspace name
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def __init__(self, attributes=None, options=None):
|
|
18
|
+
if not isinstance(attributes, dict):
|
|
19
|
+
attributes = {}
|
|
20
|
+
if not isinstance(options, dict):
|
|
21
|
+
options = {}
|
|
22
|
+
self.set_attributes(attributes)
|
|
23
|
+
self.options = options
|
|
24
|
+
|
|
25
|
+
def set_attributes(self, attributes):
|
|
26
|
+
for attribute, default_value in Workspace.default_attributes.items():
|
|
27
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
28
|
+
|
|
29
|
+
def get_attributes(self):
|
|
30
|
+
return {
|
|
31
|
+
k: getattr(self, k, None)
|
|
32
|
+
for k in Workspace.default_attributes
|
|
33
|
+
if getattr(self, k, None) is not None
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# Parameters:
|
|
37
|
+
# name - string - Workspace name
|
|
38
|
+
def update(self, params=None):
|
|
39
|
+
if not isinstance(params, dict):
|
|
40
|
+
params = {}
|
|
41
|
+
|
|
42
|
+
if hasattr(self, "id") and self.id:
|
|
43
|
+
params["id"] = self.id
|
|
44
|
+
else:
|
|
45
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
46
|
+
if "id" not in params:
|
|
47
|
+
raise MissingParameterError("Parameter missing: id")
|
|
48
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
49
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
50
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
51
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
52
|
+
response, _options = Api.send_request(
|
|
53
|
+
"PATCH",
|
|
54
|
+
"/workspaces/{id}".format(id=params["id"]),
|
|
55
|
+
params,
|
|
56
|
+
self.options,
|
|
57
|
+
)
|
|
58
|
+
return response.data
|
|
59
|
+
|
|
60
|
+
def delete(self, params=None):
|
|
61
|
+
if not isinstance(params, dict):
|
|
62
|
+
params = {}
|
|
63
|
+
|
|
64
|
+
if hasattr(self, "id") and self.id:
|
|
65
|
+
params["id"] = self.id
|
|
66
|
+
else:
|
|
67
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
68
|
+
if "id" not in params:
|
|
69
|
+
raise MissingParameterError("Parameter missing: id")
|
|
70
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
72
|
+
Api.send_request(
|
|
73
|
+
"DELETE",
|
|
74
|
+
"/workspaces/{id}".format(id=params["id"]),
|
|
75
|
+
params,
|
|
76
|
+
self.options,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def destroy(self, params=None):
|
|
80
|
+
self.delete(params)
|
|
81
|
+
|
|
82
|
+
def save(self):
|
|
83
|
+
if hasattr(self, "id") and self.id:
|
|
84
|
+
new_obj = self.update(self.get_attributes())
|
|
85
|
+
self.set_attributes(new_obj.get_attributes())
|
|
86
|
+
return True
|
|
87
|
+
else:
|
|
88
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
89
|
+
self.set_attributes(new_obj.get_attributes())
|
|
90
|
+
return True
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# Parameters:
|
|
94
|
+
# 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.
|
|
95
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
96
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
|
|
97
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `name`.
|
|
98
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
|
|
99
|
+
def list(params=None, options=None):
|
|
100
|
+
if not isinstance(params, dict):
|
|
101
|
+
params = {}
|
|
102
|
+
if not isinstance(options, dict):
|
|
103
|
+
options = {}
|
|
104
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
105
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
106
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
107
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
108
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
109
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
110
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
111
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
112
|
+
if "filter_prefix" in params and not isinstance(
|
|
113
|
+
params["filter_prefix"], dict
|
|
114
|
+
):
|
|
115
|
+
raise InvalidParameterError(
|
|
116
|
+
"Bad parameter: filter_prefix must be an dict"
|
|
117
|
+
)
|
|
118
|
+
return ListObj(Workspace, "GET", "/workspaces", params, options)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def all(params=None, options=None):
|
|
122
|
+
list(params, options)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# Parameters:
|
|
126
|
+
# id (required) - int64 - Workspace ID.
|
|
127
|
+
def find(id, params=None, options=None):
|
|
128
|
+
if not isinstance(params, dict):
|
|
129
|
+
params = {}
|
|
130
|
+
if not isinstance(options, dict):
|
|
131
|
+
options = {}
|
|
132
|
+
params["id"] = id
|
|
133
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
134
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
135
|
+
if "id" not in params:
|
|
136
|
+
raise MissingParameterError("Parameter missing: id")
|
|
137
|
+
response, options = Api.send_request(
|
|
138
|
+
"GET", "/workspaces/{id}".format(id=params["id"]), params, options
|
|
139
|
+
)
|
|
140
|
+
return Workspace(response.data, options)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def get(id, params=None, options=None):
|
|
144
|
+
find(id, params, options)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# Parameters:
|
|
148
|
+
# name - string - Workspace name
|
|
149
|
+
def create(params=None, options=None):
|
|
150
|
+
if not isinstance(params, dict):
|
|
151
|
+
params = {}
|
|
152
|
+
if not isinstance(options, dict):
|
|
153
|
+
options = {}
|
|
154
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
155
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
156
|
+
response, options = Api.send_request(
|
|
157
|
+
"POST", "/workspaces", params, options
|
|
158
|
+
)
|
|
159
|
+
return Workspace(response.data, options)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# Parameters:
|
|
163
|
+
# name - string - Workspace name
|
|
164
|
+
def update(id, params=None, options=None):
|
|
165
|
+
if not isinstance(params, dict):
|
|
166
|
+
params = {}
|
|
167
|
+
if not isinstance(options, dict):
|
|
168
|
+
options = {}
|
|
169
|
+
params["id"] = id
|
|
170
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
171
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
172
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
173
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
174
|
+
if "id" not in params:
|
|
175
|
+
raise MissingParameterError("Parameter missing: id")
|
|
176
|
+
response, options = Api.send_request(
|
|
177
|
+
"PATCH", "/workspaces/{id}".format(id=params["id"]), params, options
|
|
178
|
+
)
|
|
179
|
+
return Workspace(response.data, options)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def delete(id, params=None, options=None):
|
|
183
|
+
if not isinstance(params, dict):
|
|
184
|
+
params = {}
|
|
185
|
+
if not isinstance(options, dict):
|
|
186
|
+
options = {}
|
|
187
|
+
params["id"] = id
|
|
188
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
189
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
190
|
+
if "id" not in params:
|
|
191
|
+
raise MissingParameterError("Parameter missing: id")
|
|
192
|
+
Api.send_request(
|
|
193
|
+
"DELETE", "/workspaces/{id}".format(id=params["id"]), params, options
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def destroy(id, params=None, options=None):
|
|
198
|
+
delete(id, params, options)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def new(*args, **kwargs):
|
|
202
|
+
return Workspace(*args, **kwargs)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|