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,82 @@
|
|
|
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 BundleRegistration:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"code": None, # string - Registration cookie code
|
|
14
|
+
"name": None, # string - Registrant name
|
|
15
|
+
"company": None, # string - Registrant company name
|
|
16
|
+
"email": None, # string - Registrant email address
|
|
17
|
+
"ip": None, # string - Registrant IP Address
|
|
18
|
+
"inbox_code": None, # string - InboxRegistration cookie code, if there is an associated InboxRegistration
|
|
19
|
+
"clickwrap_body": None, # string - Clickwrap text that was shown to the registrant
|
|
20
|
+
"form_field_set_id": None, # int64 - Id of associated form field set
|
|
21
|
+
"form_field_data": None, # object - Data for form field set with form field ids as keys and user data as values
|
|
22
|
+
"bundle_code": None, # string - Bundle URL code
|
|
23
|
+
"bundle_id": None, # int64 - Id of associated bundle
|
|
24
|
+
"bundle_recipient_id": None, # int64 - Id of associated bundle recipient
|
|
25
|
+
"created_at": None, # date-time - Registration creation date/time
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def __init__(self, attributes=None, options=None):
|
|
29
|
+
if not isinstance(attributes, dict):
|
|
30
|
+
attributes = {}
|
|
31
|
+
if not isinstance(options, dict):
|
|
32
|
+
options = {}
|
|
33
|
+
self.set_attributes(attributes)
|
|
34
|
+
self.options = options
|
|
35
|
+
|
|
36
|
+
def set_attributes(self, attributes):
|
|
37
|
+
for (
|
|
38
|
+
attribute,
|
|
39
|
+
default_value,
|
|
40
|
+
) in BundleRegistration.default_attributes.items():
|
|
41
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
42
|
+
|
|
43
|
+
def get_attributes(self):
|
|
44
|
+
return {
|
|
45
|
+
k: getattr(self, k, None)
|
|
46
|
+
for k in BundleRegistration.default_attributes
|
|
47
|
+
if getattr(self, k, None) is not None
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Parameters:
|
|
52
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
53
|
+
# 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.
|
|
54
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
55
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id` and `created_at`.
|
|
56
|
+
# bundle_id - int64 - ID of the associated Bundle
|
|
57
|
+
def list(params=None, options=None):
|
|
58
|
+
if not isinstance(params, dict):
|
|
59
|
+
params = {}
|
|
60
|
+
if not isinstance(options, dict):
|
|
61
|
+
options = {}
|
|
62
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
64
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
66
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
68
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
69
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
70
|
+
if "bundle_id" in params and not isinstance(params["bundle_id"], int):
|
|
71
|
+
raise InvalidParameterError("Bad parameter: bundle_id must be an int")
|
|
72
|
+
return ListObj(
|
|
73
|
+
BundleRegistration, "GET", "/bundle_registrations", params, options
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def all(params=None, options=None):
|
|
78
|
+
list(params, options)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def new(*args, **kwargs):
|
|
82
|
+
return BundleRegistration(*args, **kwargs)
|
|
@@ -0,0 +1,278 @@
|
|
|
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 ChildSiteManagementPolicy:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Policy ID.
|
|
14
|
+
"policy_type": None, # string - Type of policy. Valid values: `settings`.
|
|
15
|
+
"name": None, # string - Name for this policy.
|
|
16
|
+
"description": None, # string - Description for this policy.
|
|
17
|
+
"value": None, # object - Policy configuration data. Attributes differ by policy type. For more information, refer to the Value Hash section of the developer documentation.
|
|
18
|
+
"applied_child_site_ids": None, # array(int64) - IDs of child sites that this policy has been applied to. This field is read-only.
|
|
19
|
+
"skip_child_site_ids": None, # array(int64) - IDs of child sites that this policy has been exempted from. If `skip_child_site_ids` is empty, the policy will be applied to all child sites. To apply a policy to a child site that has been exempted, remove it from `skip_child_site_ids` or set it to an empty array (`[]`).
|
|
20
|
+
"created_at": None, # date-time - When this policy was created.
|
|
21
|
+
"updated_at": None, # date-time - When this policy was last updated.
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def __init__(self, attributes=None, options=None):
|
|
25
|
+
if not isinstance(attributes, dict):
|
|
26
|
+
attributes = {}
|
|
27
|
+
if not isinstance(options, dict):
|
|
28
|
+
options = {}
|
|
29
|
+
self.set_attributes(attributes)
|
|
30
|
+
self.options = options
|
|
31
|
+
|
|
32
|
+
def set_attributes(self, attributes):
|
|
33
|
+
for (
|
|
34
|
+
attribute,
|
|
35
|
+
default_value,
|
|
36
|
+
) in ChildSiteManagementPolicy.default_attributes.items():
|
|
37
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
38
|
+
|
|
39
|
+
def get_attributes(self):
|
|
40
|
+
return {
|
|
41
|
+
k: getattr(self, k, None)
|
|
42
|
+
for k in ChildSiteManagementPolicy.default_attributes
|
|
43
|
+
if getattr(self, k, None) is not None
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# Parameters:
|
|
47
|
+
# value - object - Policy configuration data. Attributes differ by policy type. For more information, refer to the Value Hash section of the developer documentation.
|
|
48
|
+
# skip_child_site_ids - array(int64) - IDs of child sites that this policy has been exempted from. If `skip_child_site_ids` is empty, the policy will be applied to all child sites. To apply a policy to a child site that has been exempted, remove it from `skip_child_site_ids` or set it to an empty array (`[]`).
|
|
49
|
+
# policy_type - string - Type of policy. Valid values: `settings`.
|
|
50
|
+
# name - string - Name for this policy.
|
|
51
|
+
# description - string - Description for this policy.
|
|
52
|
+
def update(self, params=None):
|
|
53
|
+
if not isinstance(params, dict):
|
|
54
|
+
params = {}
|
|
55
|
+
|
|
56
|
+
if hasattr(self, "id") and self.id:
|
|
57
|
+
params["id"] = self.id
|
|
58
|
+
else:
|
|
59
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
60
|
+
if "id" not in params:
|
|
61
|
+
raise MissingParameterError("Parameter missing: id")
|
|
62
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
64
|
+
if "skip_child_site_ids" in params and not isinstance(
|
|
65
|
+
params["skip_child_site_ids"], builtins.list
|
|
66
|
+
):
|
|
67
|
+
raise InvalidParameterError(
|
|
68
|
+
"Bad parameter: skip_child_site_ids must be an list"
|
|
69
|
+
)
|
|
70
|
+
if "policy_type" in params and not isinstance(
|
|
71
|
+
params["policy_type"], str
|
|
72
|
+
):
|
|
73
|
+
raise InvalidParameterError(
|
|
74
|
+
"Bad parameter: policy_type must be an str"
|
|
75
|
+
)
|
|
76
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
77
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
78
|
+
if "description" in params and not isinstance(
|
|
79
|
+
params["description"], str
|
|
80
|
+
):
|
|
81
|
+
raise InvalidParameterError(
|
|
82
|
+
"Bad parameter: description must be an str"
|
|
83
|
+
)
|
|
84
|
+
response, _options = Api.send_request(
|
|
85
|
+
"PATCH",
|
|
86
|
+
"/child_site_management_policies/{id}".format(id=params["id"]),
|
|
87
|
+
params,
|
|
88
|
+
self.options,
|
|
89
|
+
)
|
|
90
|
+
return response.data
|
|
91
|
+
|
|
92
|
+
def delete(self, params=None):
|
|
93
|
+
if not isinstance(params, dict):
|
|
94
|
+
params = {}
|
|
95
|
+
|
|
96
|
+
if hasattr(self, "id") and self.id:
|
|
97
|
+
params["id"] = self.id
|
|
98
|
+
else:
|
|
99
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
100
|
+
if "id" not in params:
|
|
101
|
+
raise MissingParameterError("Parameter missing: id")
|
|
102
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
103
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
104
|
+
Api.send_request(
|
|
105
|
+
"DELETE",
|
|
106
|
+
"/child_site_management_policies/{id}".format(id=params["id"]),
|
|
107
|
+
params,
|
|
108
|
+
self.options,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
def destroy(self, params=None):
|
|
112
|
+
self.delete(params)
|
|
113
|
+
|
|
114
|
+
def save(self):
|
|
115
|
+
if hasattr(self, "id") and self.id:
|
|
116
|
+
new_obj = self.update(self.get_attributes())
|
|
117
|
+
self.set_attributes(new_obj.get_attributes())
|
|
118
|
+
return True
|
|
119
|
+
else:
|
|
120
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
121
|
+
self.set_attributes(new_obj.get_attributes())
|
|
122
|
+
return True
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# Parameters:
|
|
126
|
+
# 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.
|
|
127
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
128
|
+
def list(params=None, options=None):
|
|
129
|
+
if not isinstance(params, dict):
|
|
130
|
+
params = {}
|
|
131
|
+
if not isinstance(options, dict):
|
|
132
|
+
options = {}
|
|
133
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
134
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
135
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
136
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
137
|
+
return ListObj(
|
|
138
|
+
ChildSiteManagementPolicy,
|
|
139
|
+
"GET",
|
|
140
|
+
"/child_site_management_policies",
|
|
141
|
+
params,
|
|
142
|
+
options,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def all(params=None, options=None):
|
|
147
|
+
list(params, options)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# Parameters:
|
|
151
|
+
# id (required) - int64 - Child Site Management Policy ID.
|
|
152
|
+
def find(id, params=None, options=None):
|
|
153
|
+
if not isinstance(params, dict):
|
|
154
|
+
params = {}
|
|
155
|
+
if not isinstance(options, dict):
|
|
156
|
+
options = {}
|
|
157
|
+
params["id"] = id
|
|
158
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
159
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
160
|
+
if "id" not in params:
|
|
161
|
+
raise MissingParameterError("Parameter missing: id")
|
|
162
|
+
response, options = Api.send_request(
|
|
163
|
+
"GET",
|
|
164
|
+
"/child_site_management_policies/{id}".format(id=params["id"]),
|
|
165
|
+
params,
|
|
166
|
+
options,
|
|
167
|
+
)
|
|
168
|
+
return ChildSiteManagementPolicy(response.data, options)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def get(id, params=None, options=None):
|
|
172
|
+
find(id, params, options)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
# Parameters:
|
|
176
|
+
# value - object - Policy configuration data. Attributes differ by policy type. For more information, refer to the Value Hash section of the developer documentation.
|
|
177
|
+
# skip_child_site_ids - array(int64) - IDs of child sites that this policy has been exempted from. If `skip_child_site_ids` is empty, the policy will be applied to all child sites. To apply a policy to a child site that has been exempted, remove it from `skip_child_site_ids` or set it to an empty array (`[]`).
|
|
178
|
+
# policy_type (required) - string - Type of policy. Valid values: `settings`.
|
|
179
|
+
# name - string - Name for this policy.
|
|
180
|
+
# description - string - Description for this policy.
|
|
181
|
+
def create(params=None, options=None):
|
|
182
|
+
if not isinstance(params, dict):
|
|
183
|
+
params = {}
|
|
184
|
+
if not isinstance(options, dict):
|
|
185
|
+
options = {}
|
|
186
|
+
if "value" in params and not isinstance(params["value"], dict):
|
|
187
|
+
raise InvalidParameterError("Bad parameter: value must be an dict")
|
|
188
|
+
if "skip_child_site_ids" in params and not isinstance(
|
|
189
|
+
params["skip_child_site_ids"], builtins.list
|
|
190
|
+
):
|
|
191
|
+
raise InvalidParameterError(
|
|
192
|
+
"Bad parameter: skip_child_site_ids must be an list"
|
|
193
|
+
)
|
|
194
|
+
if "policy_type" in params and not isinstance(params["policy_type"], str):
|
|
195
|
+
raise InvalidParameterError(
|
|
196
|
+
"Bad parameter: policy_type must be an str"
|
|
197
|
+
)
|
|
198
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
199
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
200
|
+
if "description" in params and not isinstance(params["description"], str):
|
|
201
|
+
raise InvalidParameterError(
|
|
202
|
+
"Bad parameter: description must be an str"
|
|
203
|
+
)
|
|
204
|
+
if "policy_type" not in params:
|
|
205
|
+
raise MissingParameterError("Parameter missing: policy_type")
|
|
206
|
+
response, options = Api.send_request(
|
|
207
|
+
"POST", "/child_site_management_policies", params, options
|
|
208
|
+
)
|
|
209
|
+
return ChildSiteManagementPolicy(response.data, options)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
# Parameters:
|
|
213
|
+
# value - object - Policy configuration data. Attributes differ by policy type. For more information, refer to the Value Hash section of the developer documentation.
|
|
214
|
+
# skip_child_site_ids - array(int64) - IDs of child sites that this policy has been exempted from. If `skip_child_site_ids` is empty, the policy will be applied to all child sites. To apply a policy to a child site that has been exempted, remove it from `skip_child_site_ids` or set it to an empty array (`[]`).
|
|
215
|
+
# policy_type - string - Type of policy. Valid values: `settings`.
|
|
216
|
+
# name - string - Name for this policy.
|
|
217
|
+
# description - string - Description for this policy.
|
|
218
|
+
def update(id, params=None, options=None):
|
|
219
|
+
if not isinstance(params, dict):
|
|
220
|
+
params = {}
|
|
221
|
+
if not isinstance(options, dict):
|
|
222
|
+
options = {}
|
|
223
|
+
params["id"] = id
|
|
224
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
225
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
226
|
+
if "value" in params and not isinstance(params["value"], dict):
|
|
227
|
+
raise InvalidParameterError("Bad parameter: value must be an dict")
|
|
228
|
+
if "skip_child_site_ids" in params and not isinstance(
|
|
229
|
+
params["skip_child_site_ids"], builtins.list
|
|
230
|
+
):
|
|
231
|
+
raise InvalidParameterError(
|
|
232
|
+
"Bad parameter: skip_child_site_ids must be an list"
|
|
233
|
+
)
|
|
234
|
+
if "policy_type" in params and not isinstance(params["policy_type"], str):
|
|
235
|
+
raise InvalidParameterError(
|
|
236
|
+
"Bad parameter: policy_type must be an str"
|
|
237
|
+
)
|
|
238
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
239
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
240
|
+
if "description" in params and not isinstance(params["description"], str):
|
|
241
|
+
raise InvalidParameterError(
|
|
242
|
+
"Bad parameter: description must be an str"
|
|
243
|
+
)
|
|
244
|
+
if "id" not in params:
|
|
245
|
+
raise MissingParameterError("Parameter missing: id")
|
|
246
|
+
response, options = Api.send_request(
|
|
247
|
+
"PATCH",
|
|
248
|
+
"/child_site_management_policies/{id}".format(id=params["id"]),
|
|
249
|
+
params,
|
|
250
|
+
options,
|
|
251
|
+
)
|
|
252
|
+
return ChildSiteManagementPolicy(response.data, options)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def delete(id, params=None, options=None):
|
|
256
|
+
if not isinstance(params, dict):
|
|
257
|
+
params = {}
|
|
258
|
+
if not isinstance(options, dict):
|
|
259
|
+
options = {}
|
|
260
|
+
params["id"] = id
|
|
261
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
262
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
263
|
+
if "id" not in params:
|
|
264
|
+
raise MissingParameterError("Parameter missing: id")
|
|
265
|
+
Api.send_request(
|
|
266
|
+
"DELETE",
|
|
267
|
+
"/child_site_management_policies/{id}".format(id=params["id"]),
|
|
268
|
+
params,
|
|
269
|
+
options,
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def destroy(id, params=None, options=None):
|
|
274
|
+
delete(id, params, options)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def new(*args, **kwargs):
|
|
278
|
+
return ChildSiteManagementPolicy(*args, **kwargs)
|
|
@@ -0,0 +1,268 @@
|
|
|
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 Clickwrap:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Clickwrap ID
|
|
14
|
+
"name": None, # string - Name of the Clickwrap agreement (used when selecting from multiple Clickwrap agreements.)
|
|
15
|
+
"body": None, # string - Body text of Clickwrap (supports Markdown formatting).
|
|
16
|
+
"use_with_users": None, # string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
|
17
|
+
"use_with_bundles": None, # string - Use this Clickwrap for Bundles?
|
|
18
|
+
"use_with_inboxes": None, # string - Use this Clickwrap for Inboxes?
|
|
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 attribute, default_value in Clickwrap.default_attributes.items():
|
|
31
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
32
|
+
|
|
33
|
+
def get_attributes(self):
|
|
34
|
+
return {
|
|
35
|
+
k: getattr(self, k, None)
|
|
36
|
+
for k in Clickwrap.default_attributes
|
|
37
|
+
if getattr(self, k, None) is not None
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Parameters:
|
|
41
|
+
# name - string - Name of the Clickwrap agreement (used when selecting from multiple Clickwrap agreements.)
|
|
42
|
+
# body - string - Body text of Clickwrap (supports Markdown formatting).
|
|
43
|
+
# use_with_bundles - string - Use this Clickwrap for Bundles?
|
|
44
|
+
# use_with_inboxes - string - Use this Clickwrap for Inboxes?
|
|
45
|
+
# use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
|
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
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
59
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
60
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
62
|
+
if "use_with_bundles" in params and not isinstance(
|
|
63
|
+
params["use_with_bundles"], str
|
|
64
|
+
):
|
|
65
|
+
raise InvalidParameterError(
|
|
66
|
+
"Bad parameter: use_with_bundles must be an str"
|
|
67
|
+
)
|
|
68
|
+
if "use_with_inboxes" in params and not isinstance(
|
|
69
|
+
params["use_with_inboxes"], str
|
|
70
|
+
):
|
|
71
|
+
raise InvalidParameterError(
|
|
72
|
+
"Bad parameter: use_with_inboxes must be an str"
|
|
73
|
+
)
|
|
74
|
+
if "use_with_users" in params and not isinstance(
|
|
75
|
+
params["use_with_users"], str
|
|
76
|
+
):
|
|
77
|
+
raise InvalidParameterError(
|
|
78
|
+
"Bad parameter: use_with_users must be an str"
|
|
79
|
+
)
|
|
80
|
+
response, _options = Api.send_request(
|
|
81
|
+
"PATCH",
|
|
82
|
+
"/clickwraps/{id}".format(id=params["id"]),
|
|
83
|
+
params,
|
|
84
|
+
self.options,
|
|
85
|
+
)
|
|
86
|
+
return response.data
|
|
87
|
+
|
|
88
|
+
def delete(self, params=None):
|
|
89
|
+
if not isinstance(params, dict):
|
|
90
|
+
params = {}
|
|
91
|
+
|
|
92
|
+
if hasattr(self, "id") and self.id:
|
|
93
|
+
params["id"] = self.id
|
|
94
|
+
else:
|
|
95
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
96
|
+
if "id" not in params:
|
|
97
|
+
raise MissingParameterError("Parameter missing: id")
|
|
98
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
99
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
100
|
+
Api.send_request(
|
|
101
|
+
"DELETE",
|
|
102
|
+
"/clickwraps/{id}".format(id=params["id"]),
|
|
103
|
+
params,
|
|
104
|
+
self.options,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def destroy(self, params=None):
|
|
108
|
+
self.delete(params)
|
|
109
|
+
|
|
110
|
+
def save(self):
|
|
111
|
+
if hasattr(self, "id") and self.id:
|
|
112
|
+
new_obj = self.update(self.get_attributes())
|
|
113
|
+
self.set_attributes(new_obj.get_attributes())
|
|
114
|
+
return True
|
|
115
|
+
else:
|
|
116
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
117
|
+
self.set_attributes(new_obj.get_attributes())
|
|
118
|
+
return True
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# Parameters:
|
|
122
|
+
# 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.
|
|
123
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
124
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
125
|
+
def list(params=None, options=None):
|
|
126
|
+
if not isinstance(params, dict):
|
|
127
|
+
params = {}
|
|
128
|
+
if not isinstance(options, dict):
|
|
129
|
+
options = {}
|
|
130
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
131
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
132
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
133
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
134
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
135
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
136
|
+
return ListObj(Clickwrap, "GET", "/clickwraps", params, options)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def all(params=None, options=None):
|
|
140
|
+
list(params, options)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
# Parameters:
|
|
144
|
+
# id (required) - int64 - Clickwrap ID.
|
|
145
|
+
def find(id, params=None, options=None):
|
|
146
|
+
if not isinstance(params, dict):
|
|
147
|
+
params = {}
|
|
148
|
+
if not isinstance(options, dict):
|
|
149
|
+
options = {}
|
|
150
|
+
params["id"] = id
|
|
151
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
152
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
153
|
+
if "id" not in params:
|
|
154
|
+
raise MissingParameterError("Parameter missing: id")
|
|
155
|
+
response, options = Api.send_request(
|
|
156
|
+
"GET", "/clickwraps/{id}".format(id=params["id"]), params, options
|
|
157
|
+
)
|
|
158
|
+
return Clickwrap(response.data, options)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def get(id, params=None, options=None):
|
|
162
|
+
find(id, params, options)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# Parameters:
|
|
166
|
+
# name - string - Name of the Clickwrap agreement (used when selecting from multiple Clickwrap agreements.)
|
|
167
|
+
# body - string - Body text of Clickwrap (supports Markdown formatting).
|
|
168
|
+
# use_with_bundles - string - Use this Clickwrap for Bundles?
|
|
169
|
+
# use_with_inboxes - string - Use this Clickwrap for Inboxes?
|
|
170
|
+
# use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
|
171
|
+
def create(params=None, options=None):
|
|
172
|
+
if not isinstance(params, dict):
|
|
173
|
+
params = {}
|
|
174
|
+
if not isinstance(options, dict):
|
|
175
|
+
options = {}
|
|
176
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
177
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
178
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
179
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
180
|
+
if "use_with_bundles" in params and not isinstance(
|
|
181
|
+
params["use_with_bundles"], str
|
|
182
|
+
):
|
|
183
|
+
raise InvalidParameterError(
|
|
184
|
+
"Bad parameter: use_with_bundles must be an str"
|
|
185
|
+
)
|
|
186
|
+
if "use_with_inboxes" in params and not isinstance(
|
|
187
|
+
params["use_with_inboxes"], str
|
|
188
|
+
):
|
|
189
|
+
raise InvalidParameterError(
|
|
190
|
+
"Bad parameter: use_with_inboxes must be an str"
|
|
191
|
+
)
|
|
192
|
+
if "use_with_users" in params and not isinstance(
|
|
193
|
+
params["use_with_users"], str
|
|
194
|
+
):
|
|
195
|
+
raise InvalidParameterError(
|
|
196
|
+
"Bad parameter: use_with_users must be an str"
|
|
197
|
+
)
|
|
198
|
+
response, options = Api.send_request(
|
|
199
|
+
"POST", "/clickwraps", params, options
|
|
200
|
+
)
|
|
201
|
+
return Clickwrap(response.data, options)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
# Parameters:
|
|
205
|
+
# name - string - Name of the Clickwrap agreement (used when selecting from multiple Clickwrap agreements.)
|
|
206
|
+
# body - string - Body text of Clickwrap (supports Markdown formatting).
|
|
207
|
+
# use_with_bundles - string - Use this Clickwrap for Bundles?
|
|
208
|
+
# use_with_inboxes - string - Use this Clickwrap for Inboxes?
|
|
209
|
+
# use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
|
210
|
+
def update(id, params=None, options=None):
|
|
211
|
+
if not isinstance(params, dict):
|
|
212
|
+
params = {}
|
|
213
|
+
if not isinstance(options, dict):
|
|
214
|
+
options = {}
|
|
215
|
+
params["id"] = id
|
|
216
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
217
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
218
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
219
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
220
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
221
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
222
|
+
if "use_with_bundles" in params and not isinstance(
|
|
223
|
+
params["use_with_bundles"], str
|
|
224
|
+
):
|
|
225
|
+
raise InvalidParameterError(
|
|
226
|
+
"Bad parameter: use_with_bundles must be an str"
|
|
227
|
+
)
|
|
228
|
+
if "use_with_inboxes" in params and not isinstance(
|
|
229
|
+
params["use_with_inboxes"], str
|
|
230
|
+
):
|
|
231
|
+
raise InvalidParameterError(
|
|
232
|
+
"Bad parameter: use_with_inboxes must be an str"
|
|
233
|
+
)
|
|
234
|
+
if "use_with_users" in params and not isinstance(
|
|
235
|
+
params["use_with_users"], str
|
|
236
|
+
):
|
|
237
|
+
raise InvalidParameterError(
|
|
238
|
+
"Bad parameter: use_with_users must be an str"
|
|
239
|
+
)
|
|
240
|
+
if "id" not in params:
|
|
241
|
+
raise MissingParameterError("Parameter missing: id")
|
|
242
|
+
response, options = Api.send_request(
|
|
243
|
+
"PATCH", "/clickwraps/{id}".format(id=params["id"]), params, options
|
|
244
|
+
)
|
|
245
|
+
return Clickwrap(response.data, options)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def delete(id, params=None, options=None):
|
|
249
|
+
if not isinstance(params, dict):
|
|
250
|
+
params = {}
|
|
251
|
+
if not isinstance(options, dict):
|
|
252
|
+
options = {}
|
|
253
|
+
params["id"] = id
|
|
254
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
255
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
256
|
+
if "id" not in params:
|
|
257
|
+
raise MissingParameterError("Parameter missing: id")
|
|
258
|
+
Api.send_request(
|
|
259
|
+
"DELETE", "/clickwraps/{id}".format(id=params["id"]), params, options
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def destroy(id, params=None, options=None):
|
|
264
|
+
delete(id, params, options)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
def new(*args, **kwargs):
|
|
268
|
+
return Clickwrap(*args, **kwargs)
|