files-com 1.6.208__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of files-com might be problematic. Click here for more details.
- README.md +758 -0
- _VERSION +1 -0
- files_com-1.6.208.dist-info/METADATA +770 -0
- files_com-1.6.208.dist-info/RECORD +126 -0
- files_com-1.6.208.dist-info/WHEEL +5 -0
- files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
- files_com-1.6.208.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +309 -0
- files_sdk/api.py +63 -0
- files_sdk/api_client.py +336 -0
- files_sdk/error.py +2981 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +119 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +153 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +318 -0
- files_sdk/models/api_request_log.py +105 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +117 -0
- files_sdk/models/as2_outgoing_message.py +113 -0
- files_sdk/models/as2_partner.py +415 -0
- files_sdk/models/as2_station.py +282 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +823 -0
- files_sdk/models/automation_log.py +94 -0
- files_sdk/models/automation_run.py +112 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +340 -0
- files_sdk/models/bundle.py +686 -0
- files_sdk/models/bundle_action.py +93 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +252 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +133 -0
- files_sdk/models/bundle_registration.py +82 -0
- files_sdk/models/child_site_management_policy.py +278 -0
- files_sdk/models/clickwrap.py +268 -0
- files_sdk/models/dns_record.py +59 -0
- files_sdk/models/email_incoming_message.py +102 -0
- files_sdk/models/email_log.py +84 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +102 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +851 -0
- files_sdk/models/file_action.py +39 -0
- files_sdk/models/file_comment.py +191 -0
- files_sdk/models/file_comment_reaction.py +125 -0
- files_sdk/models/file_migration.py +69 -0
- files_sdk/models/file_migration_log.py +88 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +186 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +265 -0
- files_sdk/models/ftp_action_log.py +104 -0
- files_sdk/models/gpg_key.py +333 -0
- files_sdk/models/group.py +338 -0
- files_sdk/models/group_user.py +235 -0
- files_sdk/models/history.py +236 -0
- files_sdk/models/history_export.py +238 -0
- files_sdk/models/history_export_result.py +98 -0
- files_sdk/models/holiday_region.py +58 -0
- files_sdk/models/image.py +37 -0
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/inbox_recipient.py +124 -0
- files_sdk/models/inbox_registration.py +79 -0
- files_sdk/models/inbox_upload.py +80 -0
- files_sdk/models/invoice.py +91 -0
- files_sdk/models/invoice_line_item.py +51 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/lock.py +174 -0
- files_sdk/models/message.py +244 -0
- files_sdk/models/message_comment.py +223 -0
- files_sdk/models/message_comment_reaction.py +181 -0
- files_sdk/models/message_reaction.py +170 -0
- files_sdk/models/notification.py +451 -0
- files_sdk/models/outbound_connection_log.py +105 -0
- files_sdk/models/partner.py +307 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +190 -0
- files_sdk/models/preview.py +40 -0
- files_sdk/models/priority.py +63 -0
- files_sdk/models/project.py +205 -0
- files_sdk/models/public_hosting_request_log.py +101 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +269 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_mount_backend.py +438 -0
- files_sdk/models/remote_server.py +1854 -0
- files_sdk/models/remote_server_configuration_file.py +73 -0
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/request.py +184 -0
- files_sdk/models/restore.py +142 -0
- files_sdk/models/scim_log.py +88 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +108 -0
- files_sdk/models/sftp_host_key.py +215 -0
- files_sdk/models/share_group.py +228 -0
- files_sdk/models/share_group_member.py +41 -0
- files_sdk/models/siem_http_destination.py +1074 -0
- files_sdk/models/site.py +1289 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +168 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync.py +588 -0
- files_sdk/models/sync_log.py +86 -0
- files_sdk/models/sync_run.py +124 -0
- files_sdk/models/usage_by_top_level_dir.py +41 -0
- files_sdk/models/usage_daily_snapshot.py +93 -0
- files_sdk/models/usage_snapshot.py +73 -0
- files_sdk/models/user.py +1232 -0
- files_sdk/models/user_cipher_use.py +91 -0
- files_sdk/models/user_lifecycle_rule.py +355 -0
- files_sdk/models/user_request.py +166 -0
- files_sdk/models/user_sftp_client_use.py +68 -0
- files_sdk/models/web_dav_action_log.py +104 -0
- files_sdk/models/webhook_test.py +116 -0
- files_sdk/models/workspace.py +202 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,93 @@
|
|
|
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 BundleAction:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"action": None, # string - Type of action
|
|
14
|
+
"bundle_registration": None, # BundleRegistration - Object that contains bundle registration information
|
|
15
|
+
"created_at": None, # date-time - Action occurrence date/time
|
|
16
|
+
"destination": None, # string - The destination path for this bundle action, if applicable
|
|
17
|
+
"path": None, # string - Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
18
|
+
"source": None, # string - The source path for this bundle action, if applicable
|
|
19
|
+
"bundle_registration_id": None, # int64 - Identifier of the associated bundle registration
|
|
20
|
+
"bundle_registration_name": None, # string - Name of the registrant who performed the action
|
|
21
|
+
"bundle_registration_email": None, # string - Email of the registrant
|
|
22
|
+
"bundle_registration_ip": None, # string - IP address of the registrant
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def __init__(self, attributes=None, options=None):
|
|
26
|
+
if not isinstance(attributes, dict):
|
|
27
|
+
attributes = {}
|
|
28
|
+
if not isinstance(options, dict):
|
|
29
|
+
options = {}
|
|
30
|
+
self.set_attributes(attributes)
|
|
31
|
+
self.options = options
|
|
32
|
+
|
|
33
|
+
def set_attributes(self, attributes):
|
|
34
|
+
for (
|
|
35
|
+
attribute,
|
|
36
|
+
default_value,
|
|
37
|
+
) in BundleAction.default_attributes.items():
|
|
38
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
39
|
+
|
|
40
|
+
def get_attributes(self):
|
|
41
|
+
return {
|
|
42
|
+
k: getattr(self, k, None)
|
|
43
|
+
for k in BundleAction.default_attributes
|
|
44
|
+
if getattr(self, k, None) is not None
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Parameters:
|
|
49
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
50
|
+
# 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.
|
|
51
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
52
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `bundle_registration_id`.
|
|
53
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`.
|
|
54
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
55
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
56
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
57
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
58
|
+
def list(params=None, options=None):
|
|
59
|
+
if not isinstance(params, dict):
|
|
60
|
+
params = {}
|
|
61
|
+
if not isinstance(options, dict):
|
|
62
|
+
options = {}
|
|
63
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
64
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
65
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
66
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
67
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
68
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
69
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
70
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
71
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
72
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
73
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
74
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
75
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
76
|
+
raise InvalidParameterError(
|
|
77
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
78
|
+
)
|
|
79
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
80
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
81
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
82
|
+
raise InvalidParameterError(
|
|
83
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
84
|
+
)
|
|
85
|
+
return ListObj(BundleAction, "GET", "/bundle_actions", params, options)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def all(params=None, options=None):
|
|
89
|
+
list(params, options)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def new(*args, **kwargs):
|
|
93
|
+
return BundleAction(*args, **kwargs)
|
|
@@ -0,0 +1,94 @@
|
|
|
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 BundleDownload:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"bundle_registration": None, # BundleRegistration
|
|
14
|
+
"download_method": None, # string - Download method (file or full_zip)
|
|
15
|
+
"path": None, # string - Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
16
|
+
"created_at": None, # date-time - Download date/time
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def __init__(self, attributes=None, options=None):
|
|
20
|
+
if not isinstance(attributes, dict):
|
|
21
|
+
attributes = {}
|
|
22
|
+
if not isinstance(options, dict):
|
|
23
|
+
options = {}
|
|
24
|
+
self.set_attributes(attributes)
|
|
25
|
+
self.options = options
|
|
26
|
+
|
|
27
|
+
def set_attributes(self, attributes):
|
|
28
|
+
for (
|
|
29
|
+
attribute,
|
|
30
|
+
default_value,
|
|
31
|
+
) in BundleDownload.default_attributes.items():
|
|
32
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
33
|
+
|
|
34
|
+
def get_attributes(self):
|
|
35
|
+
return {
|
|
36
|
+
k: getattr(self, k, None)
|
|
37
|
+
for k in BundleDownload.default_attributes
|
|
38
|
+
if getattr(self, k, None) is not None
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# Parameters:
|
|
43
|
+
# 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.
|
|
44
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
45
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
46
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
|
|
47
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
48
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
49
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
50
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
51
|
+
# bundle_id - int64 - Bundle ID
|
|
52
|
+
# bundle_registration_id - int64 - BundleRegistration ID
|
|
53
|
+
def list(params=None, options=None):
|
|
54
|
+
if not isinstance(params, dict):
|
|
55
|
+
params = {}
|
|
56
|
+
if not isinstance(options, dict):
|
|
57
|
+
options = {}
|
|
58
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
59
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
60
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
62
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
64
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
66
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
68
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
69
|
+
raise InvalidParameterError(
|
|
70
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
71
|
+
)
|
|
72
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
73
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
74
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
75
|
+
raise InvalidParameterError(
|
|
76
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
77
|
+
)
|
|
78
|
+
if "bundle_id" in params and not isinstance(params["bundle_id"], int):
|
|
79
|
+
raise InvalidParameterError("Bad parameter: bundle_id must be an int")
|
|
80
|
+
if "bundle_registration_id" in params and not isinstance(
|
|
81
|
+
params["bundle_registration_id"], int
|
|
82
|
+
):
|
|
83
|
+
raise InvalidParameterError(
|
|
84
|
+
"Bad parameter: bundle_registration_id must be an int"
|
|
85
|
+
)
|
|
86
|
+
return ListObj(BundleDownload, "GET", "/bundle_downloads", params, options)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def all(params=None, options=None):
|
|
90
|
+
list(params, options)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def new(*args, **kwargs):
|
|
94
|
+
return BundleDownload(*args, **kwargs)
|
|
@@ -0,0 +1,252 @@
|
|
|
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 BundleNotification:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"bundle_id": None, # int64 - Bundle ID to notify on
|
|
14
|
+
"id": None, # int64 - Bundle Notification ID
|
|
15
|
+
"notify_on_registration": None, # boolean - Triggers bundle notification when a registration action occurs for it.
|
|
16
|
+
"notify_on_upload": None, # boolean - Triggers bundle notification when a upload action occurs for it.
|
|
17
|
+
"notify_user_id": None, # int64 - The id of the user to notify.
|
|
18
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def __init__(self, attributes=None, options=None):
|
|
22
|
+
if not isinstance(attributes, dict):
|
|
23
|
+
attributes = {}
|
|
24
|
+
if not isinstance(options, dict):
|
|
25
|
+
options = {}
|
|
26
|
+
self.set_attributes(attributes)
|
|
27
|
+
self.options = options
|
|
28
|
+
|
|
29
|
+
def set_attributes(self, attributes):
|
|
30
|
+
for (
|
|
31
|
+
attribute,
|
|
32
|
+
default_value,
|
|
33
|
+
) in BundleNotification.default_attributes.items():
|
|
34
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
35
|
+
|
|
36
|
+
def get_attributes(self):
|
|
37
|
+
return {
|
|
38
|
+
k: getattr(self, k, None)
|
|
39
|
+
for k in BundleNotification.default_attributes
|
|
40
|
+
if getattr(self, k, None) is not None
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Parameters:
|
|
44
|
+
# notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
45
|
+
# notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
|
46
|
+
def update(self, params=None):
|
|
47
|
+
if not isinstance(params, dict):
|
|
48
|
+
params = {}
|
|
49
|
+
|
|
50
|
+
if hasattr(self, "id") and self.id:
|
|
51
|
+
params["id"] = self.id
|
|
52
|
+
else:
|
|
53
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
54
|
+
if "id" not in params:
|
|
55
|
+
raise MissingParameterError("Parameter missing: id")
|
|
56
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
57
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
58
|
+
response, _options = Api.send_request(
|
|
59
|
+
"PATCH",
|
|
60
|
+
"/bundle_notifications/{id}".format(id=params["id"]),
|
|
61
|
+
params,
|
|
62
|
+
self.options,
|
|
63
|
+
)
|
|
64
|
+
return response.data
|
|
65
|
+
|
|
66
|
+
def delete(self, params=None):
|
|
67
|
+
if not isinstance(params, dict):
|
|
68
|
+
params = {}
|
|
69
|
+
|
|
70
|
+
if hasattr(self, "id") and self.id:
|
|
71
|
+
params["id"] = self.id
|
|
72
|
+
else:
|
|
73
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
74
|
+
if "id" not in params:
|
|
75
|
+
raise MissingParameterError("Parameter missing: id")
|
|
76
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
77
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
78
|
+
Api.send_request(
|
|
79
|
+
"DELETE",
|
|
80
|
+
"/bundle_notifications/{id}".format(id=params["id"]),
|
|
81
|
+
params,
|
|
82
|
+
self.options,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def destroy(self, params=None):
|
|
86
|
+
self.delete(params)
|
|
87
|
+
|
|
88
|
+
def save(self):
|
|
89
|
+
if hasattr(self, "id") and self.id:
|
|
90
|
+
new_obj = self.update(self.get_attributes())
|
|
91
|
+
self.set_attributes(new_obj.get_attributes())
|
|
92
|
+
return True
|
|
93
|
+
else:
|
|
94
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
95
|
+
self.set_attributes(new_obj.get_attributes())
|
|
96
|
+
return True
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# Parameters:
|
|
100
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
101
|
+
# 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.
|
|
102
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
103
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
|
|
104
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `bundle_id`.
|
|
105
|
+
def list(params=None, options=None):
|
|
106
|
+
if not isinstance(params, dict):
|
|
107
|
+
params = {}
|
|
108
|
+
if not isinstance(options, dict):
|
|
109
|
+
options = {}
|
|
110
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
111
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
112
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
113
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
114
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
115
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
116
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
117
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
118
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
119
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
120
|
+
return ListObj(
|
|
121
|
+
BundleNotification, "GET", "/bundle_notifications", params, options
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def all(params=None, options=None):
|
|
126
|
+
list(params, options)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# Parameters:
|
|
130
|
+
# id (required) - int64 - Bundle Notification ID.
|
|
131
|
+
def find(id, params=None, options=None):
|
|
132
|
+
if not isinstance(params, dict):
|
|
133
|
+
params = {}
|
|
134
|
+
if not isinstance(options, dict):
|
|
135
|
+
options = {}
|
|
136
|
+
params["id"] = id
|
|
137
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
138
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
139
|
+
if "id" not in params:
|
|
140
|
+
raise MissingParameterError("Parameter missing: id")
|
|
141
|
+
response, options = Api.send_request(
|
|
142
|
+
"GET",
|
|
143
|
+
"/bundle_notifications/{id}".format(id=params["id"]),
|
|
144
|
+
params,
|
|
145
|
+
options,
|
|
146
|
+
)
|
|
147
|
+
return BundleNotification(response.data, options)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def get(id, params=None, options=None):
|
|
151
|
+
find(id, params, options)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# Parameters:
|
|
155
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
156
|
+
# bundle_id (required) - int64 - Bundle ID to notify on
|
|
157
|
+
# notify_user_id - int64 - The id of the user to notify.
|
|
158
|
+
# notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
159
|
+
# notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
|
160
|
+
def create(params=None, options=None):
|
|
161
|
+
if not isinstance(params, dict):
|
|
162
|
+
params = {}
|
|
163
|
+
if not isinstance(options, dict):
|
|
164
|
+
options = {}
|
|
165
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
166
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
167
|
+
if "bundle_id" in params and not isinstance(params["bundle_id"], int):
|
|
168
|
+
raise InvalidParameterError("Bad parameter: bundle_id must be an int")
|
|
169
|
+
if "notify_user_id" in params and not isinstance(
|
|
170
|
+
params["notify_user_id"], int
|
|
171
|
+
):
|
|
172
|
+
raise InvalidParameterError(
|
|
173
|
+
"Bad parameter: notify_user_id must be an int"
|
|
174
|
+
)
|
|
175
|
+
if "notify_on_registration" in params and not isinstance(
|
|
176
|
+
params["notify_on_registration"], bool
|
|
177
|
+
):
|
|
178
|
+
raise InvalidParameterError(
|
|
179
|
+
"Bad parameter: notify_on_registration must be an bool"
|
|
180
|
+
)
|
|
181
|
+
if "notify_on_upload" in params and not isinstance(
|
|
182
|
+
params["notify_on_upload"], bool
|
|
183
|
+
):
|
|
184
|
+
raise InvalidParameterError(
|
|
185
|
+
"Bad parameter: notify_on_upload must be an bool"
|
|
186
|
+
)
|
|
187
|
+
if "bundle_id" not in params:
|
|
188
|
+
raise MissingParameterError("Parameter missing: bundle_id")
|
|
189
|
+
response, options = Api.send_request(
|
|
190
|
+
"POST", "/bundle_notifications", params, options
|
|
191
|
+
)
|
|
192
|
+
return BundleNotification(response.data, options)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
# Parameters:
|
|
196
|
+
# notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
197
|
+
# notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
|
198
|
+
def update(id, params=None, options=None):
|
|
199
|
+
if not isinstance(params, dict):
|
|
200
|
+
params = {}
|
|
201
|
+
if not isinstance(options, dict):
|
|
202
|
+
options = {}
|
|
203
|
+
params["id"] = id
|
|
204
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
205
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
206
|
+
if "notify_on_registration" in params and not isinstance(
|
|
207
|
+
params["notify_on_registration"], bool
|
|
208
|
+
):
|
|
209
|
+
raise InvalidParameterError(
|
|
210
|
+
"Bad parameter: notify_on_registration must be an bool"
|
|
211
|
+
)
|
|
212
|
+
if "notify_on_upload" in params and not isinstance(
|
|
213
|
+
params["notify_on_upload"], bool
|
|
214
|
+
):
|
|
215
|
+
raise InvalidParameterError(
|
|
216
|
+
"Bad parameter: notify_on_upload must be an bool"
|
|
217
|
+
)
|
|
218
|
+
if "id" not in params:
|
|
219
|
+
raise MissingParameterError("Parameter missing: id")
|
|
220
|
+
response, options = Api.send_request(
|
|
221
|
+
"PATCH",
|
|
222
|
+
"/bundle_notifications/{id}".format(id=params["id"]),
|
|
223
|
+
params,
|
|
224
|
+
options,
|
|
225
|
+
)
|
|
226
|
+
return BundleNotification(response.data, options)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def delete(id, params=None, options=None):
|
|
230
|
+
if not isinstance(params, dict):
|
|
231
|
+
params = {}
|
|
232
|
+
if not isinstance(options, dict):
|
|
233
|
+
options = {}
|
|
234
|
+
params["id"] = id
|
|
235
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
236
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
237
|
+
if "id" not in params:
|
|
238
|
+
raise MissingParameterError("Parameter missing: id")
|
|
239
|
+
Api.send_request(
|
|
240
|
+
"DELETE",
|
|
241
|
+
"/bundle_notifications/{id}".format(id=params["id"]),
|
|
242
|
+
params,
|
|
243
|
+
options,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def destroy(id, params=None, options=None):
|
|
248
|
+
delete(id, params, options)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def new(*args, **kwargs):
|
|
252
|
+
return BundleNotification(*args, **kwargs)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BundlePath:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"recursive": None, # boolean - Allow access to subfolders content?
|
|
13
|
+
"path": None, # string - The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def __init__(self, attributes=None, options=None):
|
|
17
|
+
if not isinstance(attributes, dict):
|
|
18
|
+
attributes = {}
|
|
19
|
+
if not isinstance(options, dict):
|
|
20
|
+
options = {}
|
|
21
|
+
self.set_attributes(attributes)
|
|
22
|
+
self.options = options
|
|
23
|
+
|
|
24
|
+
def set_attributes(self, attributes):
|
|
25
|
+
for attribute, default_value in BundlePath.default_attributes.items():
|
|
26
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
27
|
+
|
|
28
|
+
def get_attributes(self):
|
|
29
|
+
return {
|
|
30
|
+
k: getattr(self, k, None)
|
|
31
|
+
for k in BundlePath.default_attributes
|
|
32
|
+
if getattr(self, k, None) is not None
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def new(*args, **kwargs):
|
|
37
|
+
return BundlePath(*args, **kwargs)
|
|
@@ -0,0 +1,133 @@
|
|
|
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 BundleRecipient:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"company": None, # string - The recipient's company.
|
|
14
|
+
"name": None, # string - The recipient's name.
|
|
15
|
+
"note": None, # string - A note sent to the recipient with the bundle.
|
|
16
|
+
"recipient": None, # string - The recipient's email address.
|
|
17
|
+
"sent_at": None, # date-time - When the Bundle was shared with this recipient.
|
|
18
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
19
|
+
"bundle_id": None, # int64 - Bundle to share.
|
|
20
|
+
"share_after_create": None, # boolean - Set to true to share the link with the recipient upon creation.
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
def __init__(self, attributes=None, options=None):
|
|
24
|
+
if not isinstance(attributes, dict):
|
|
25
|
+
attributes = {}
|
|
26
|
+
if not isinstance(options, dict):
|
|
27
|
+
options = {}
|
|
28
|
+
self.set_attributes(attributes)
|
|
29
|
+
self.options = options
|
|
30
|
+
|
|
31
|
+
def set_attributes(self, attributes):
|
|
32
|
+
for (
|
|
33
|
+
attribute,
|
|
34
|
+
default_value,
|
|
35
|
+
) in BundleRecipient.default_attributes.items():
|
|
36
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
37
|
+
|
|
38
|
+
def get_attributes(self):
|
|
39
|
+
return {
|
|
40
|
+
k: getattr(self, k, None)
|
|
41
|
+
for k in BundleRecipient.default_attributes
|
|
42
|
+
if getattr(self, k, None) is not None
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
def save(self):
|
|
46
|
+
if hasattr(self, "id") and self.id:
|
|
47
|
+
raise NotImplementedError(
|
|
48
|
+
"The BundleRecipient object doesn't support updates."
|
|
49
|
+
)
|
|
50
|
+
else:
|
|
51
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
52
|
+
self.set_attributes(new_obj.get_attributes())
|
|
53
|
+
return True
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Parameters:
|
|
57
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
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.
|
|
59
|
+
# 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 .
|
|
61
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`.
|
|
62
|
+
# bundle_id (required) - int64 - List recipients for the bundle with this ID.
|
|
63
|
+
def list(params=None, options=None):
|
|
64
|
+
if not isinstance(params, dict):
|
|
65
|
+
params = {}
|
|
66
|
+
if not isinstance(options, dict):
|
|
67
|
+
options = {}
|
|
68
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
69
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
70
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
72
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
73
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
74
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
75
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
76
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
77
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
78
|
+
if "bundle_id" in params and not isinstance(params["bundle_id"], int):
|
|
79
|
+
raise InvalidParameterError("Bad parameter: bundle_id must be an int")
|
|
80
|
+
if "bundle_id" not in params:
|
|
81
|
+
raise MissingParameterError("Parameter missing: bundle_id")
|
|
82
|
+
return ListObj(
|
|
83
|
+
BundleRecipient, "GET", "/bundle_recipients", params, options
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def all(params=None, options=None):
|
|
88
|
+
list(params, options)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# Parameters:
|
|
92
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
93
|
+
# bundle_id (required) - int64 - Bundle to share.
|
|
94
|
+
# recipient (required) - string - Email addresses to share this bundle with.
|
|
95
|
+
# name - string - Name of recipient.
|
|
96
|
+
# company - string - Company of recipient.
|
|
97
|
+
# note - string - Note to include in email.
|
|
98
|
+
# share_after_create - boolean - Set to true to share the link with the recipient upon creation.
|
|
99
|
+
def create(params=None, options=None):
|
|
100
|
+
if not isinstance(params, dict):
|
|
101
|
+
params = {}
|
|
102
|
+
if not isinstance(options, dict):
|
|
103
|
+
options = {}
|
|
104
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
105
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
106
|
+
if "bundle_id" in params and not isinstance(params["bundle_id"], int):
|
|
107
|
+
raise InvalidParameterError("Bad parameter: bundle_id must be an int")
|
|
108
|
+
if "recipient" in params and not isinstance(params["recipient"], str):
|
|
109
|
+
raise InvalidParameterError("Bad parameter: recipient must be an str")
|
|
110
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
111
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
112
|
+
if "company" in params and not isinstance(params["company"], str):
|
|
113
|
+
raise InvalidParameterError("Bad parameter: company must be an str")
|
|
114
|
+
if "note" in params and not isinstance(params["note"], str):
|
|
115
|
+
raise InvalidParameterError("Bad parameter: note must be an str")
|
|
116
|
+
if "share_after_create" in params and not isinstance(
|
|
117
|
+
params["share_after_create"], bool
|
|
118
|
+
):
|
|
119
|
+
raise InvalidParameterError(
|
|
120
|
+
"Bad parameter: share_after_create must be an bool"
|
|
121
|
+
)
|
|
122
|
+
if "bundle_id" not in params:
|
|
123
|
+
raise MissingParameterError("Parameter missing: bundle_id")
|
|
124
|
+
if "recipient" not in params:
|
|
125
|
+
raise MissingParameterError("Parameter missing: recipient")
|
|
126
|
+
response, options = Api.send_request(
|
|
127
|
+
"POST", "/bundle_recipients", params, options
|
|
128
|
+
)
|
|
129
|
+
return BundleRecipient(response.data, options)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def new(*args, **kwargs):
|
|
133
|
+
return BundleRecipient(*args, **kwargs)
|