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,255 @@
|
|
|
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 Snapshot:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - The snapshot's unique ID.
|
|
14
|
+
"expires_at": None, # date-time - When the snapshot expires.
|
|
15
|
+
"finalized_at": None, # date-time - When the snapshot was finalized.
|
|
16
|
+
"name": None, # string - A name for the snapshot.
|
|
17
|
+
"user_id": None, # int64 - The user that created this snapshot, if applicable.
|
|
18
|
+
"bundle_id": None, # int64 - The bundle using this snapshot, if applicable.
|
|
19
|
+
"paths": None, # array(string) - An array of paths to add to the snapshot.
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
def __init__(self, attributes=None, options=None):
|
|
23
|
+
if not isinstance(attributes, dict):
|
|
24
|
+
attributes = {}
|
|
25
|
+
if not isinstance(options, dict):
|
|
26
|
+
options = {}
|
|
27
|
+
self.set_attributes(attributes)
|
|
28
|
+
self.options = options
|
|
29
|
+
|
|
30
|
+
def set_attributes(self, attributes):
|
|
31
|
+
for attribute, default_value in Snapshot.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 Snapshot.default_attributes
|
|
38
|
+
if getattr(self, k, None) is not None
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Finalize Snapshot
|
|
42
|
+
def finalize(self, params=None):
|
|
43
|
+
if not isinstance(params, dict):
|
|
44
|
+
params = {}
|
|
45
|
+
|
|
46
|
+
if hasattr(self, "id") and self.id:
|
|
47
|
+
params["id"] = self.id
|
|
48
|
+
else:
|
|
49
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
50
|
+
if "id" not in params:
|
|
51
|
+
raise MissingParameterError("Parameter missing: id")
|
|
52
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
53
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
54
|
+
Api.send_request(
|
|
55
|
+
"POST",
|
|
56
|
+
"/snapshots/{id}/finalize".format(id=params["id"]),
|
|
57
|
+
params,
|
|
58
|
+
self.options,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Parameters:
|
|
62
|
+
# expires_at - string - When the snapshot expires.
|
|
63
|
+
# name - string - A name for the snapshot.
|
|
64
|
+
# paths - array(string) - An array of paths to add to the snapshot.
|
|
65
|
+
def update(self, params=None):
|
|
66
|
+
if not isinstance(params, dict):
|
|
67
|
+
params = {}
|
|
68
|
+
|
|
69
|
+
if hasattr(self, "id") and self.id:
|
|
70
|
+
params["id"] = self.id
|
|
71
|
+
else:
|
|
72
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
73
|
+
if "id" not in params:
|
|
74
|
+
raise MissingParameterError("Parameter missing: id")
|
|
75
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
76
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
77
|
+
if "expires_at" in params and not isinstance(
|
|
78
|
+
params["expires_at"], str
|
|
79
|
+
):
|
|
80
|
+
raise InvalidParameterError(
|
|
81
|
+
"Bad parameter: expires_at must be an str"
|
|
82
|
+
)
|
|
83
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
84
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
85
|
+
if "paths" in params and not isinstance(
|
|
86
|
+
params["paths"], builtins.list
|
|
87
|
+
):
|
|
88
|
+
raise InvalidParameterError("Bad parameter: paths must be an list")
|
|
89
|
+
response, _options = Api.send_request(
|
|
90
|
+
"PATCH",
|
|
91
|
+
"/snapshots/{id}".format(id=params["id"]),
|
|
92
|
+
params,
|
|
93
|
+
self.options,
|
|
94
|
+
)
|
|
95
|
+
return response.data
|
|
96
|
+
|
|
97
|
+
def delete(self, params=None):
|
|
98
|
+
if not isinstance(params, dict):
|
|
99
|
+
params = {}
|
|
100
|
+
|
|
101
|
+
if hasattr(self, "id") and self.id:
|
|
102
|
+
params["id"] = self.id
|
|
103
|
+
else:
|
|
104
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
105
|
+
if "id" not in params:
|
|
106
|
+
raise MissingParameterError("Parameter missing: id")
|
|
107
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
108
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
109
|
+
Api.send_request(
|
|
110
|
+
"DELETE",
|
|
111
|
+
"/snapshots/{id}".format(id=params["id"]),
|
|
112
|
+
params,
|
|
113
|
+
self.options,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def destroy(self, params=None):
|
|
117
|
+
self.delete(params)
|
|
118
|
+
|
|
119
|
+
def save(self):
|
|
120
|
+
if hasattr(self, "id") and self.id:
|
|
121
|
+
new_obj = self.update(self.get_attributes())
|
|
122
|
+
self.set_attributes(new_obj.get_attributes())
|
|
123
|
+
return True
|
|
124
|
+
else:
|
|
125
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
126
|
+
self.set_attributes(new_obj.get_attributes())
|
|
127
|
+
return True
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# Parameters:
|
|
131
|
+
# 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.
|
|
132
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
133
|
+
def list(params=None, options=None):
|
|
134
|
+
if not isinstance(params, dict):
|
|
135
|
+
params = {}
|
|
136
|
+
if not isinstance(options, dict):
|
|
137
|
+
options = {}
|
|
138
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
139
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
140
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
141
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
142
|
+
return ListObj(Snapshot, "GET", "/snapshots", params, options)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def all(params=None, options=None):
|
|
146
|
+
list(params, options)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
# Parameters:
|
|
150
|
+
# id (required) - int64 - Snapshot ID.
|
|
151
|
+
def find(id, params=None, options=None):
|
|
152
|
+
if not isinstance(params, dict):
|
|
153
|
+
params = {}
|
|
154
|
+
if not isinstance(options, dict):
|
|
155
|
+
options = {}
|
|
156
|
+
params["id"] = id
|
|
157
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
158
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
159
|
+
if "id" not in params:
|
|
160
|
+
raise MissingParameterError("Parameter missing: id")
|
|
161
|
+
response, options = Api.send_request(
|
|
162
|
+
"GET", "/snapshots/{id}".format(id=params["id"]), params, options
|
|
163
|
+
)
|
|
164
|
+
return Snapshot(response.data, options)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def get(id, params=None, options=None):
|
|
168
|
+
find(id, params, options)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
# Parameters:
|
|
172
|
+
# expires_at - string - When the snapshot expires.
|
|
173
|
+
# name - string - A name for the snapshot.
|
|
174
|
+
# paths - array(string) - An array of paths to add to the snapshot.
|
|
175
|
+
def create(params=None, options=None):
|
|
176
|
+
if not isinstance(params, dict):
|
|
177
|
+
params = {}
|
|
178
|
+
if not isinstance(options, dict):
|
|
179
|
+
options = {}
|
|
180
|
+
if "expires_at" in params and not isinstance(params["expires_at"], str):
|
|
181
|
+
raise InvalidParameterError("Bad parameter: expires_at must be an str")
|
|
182
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
183
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
184
|
+
if "paths" in params and not isinstance(params["paths"], builtins.list):
|
|
185
|
+
raise InvalidParameterError("Bad parameter: paths must be an list")
|
|
186
|
+
response, options = Api.send_request("POST", "/snapshots", params, options)
|
|
187
|
+
return Snapshot(response.data, options)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
# Finalize Snapshot
|
|
191
|
+
def finalize(id, params=None, options=None):
|
|
192
|
+
if not isinstance(params, dict):
|
|
193
|
+
params = {}
|
|
194
|
+
if not isinstance(options, dict):
|
|
195
|
+
options = {}
|
|
196
|
+
params["id"] = id
|
|
197
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
198
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
199
|
+
if "id" not in params:
|
|
200
|
+
raise MissingParameterError("Parameter missing: id")
|
|
201
|
+
Api.send_request(
|
|
202
|
+
"POST",
|
|
203
|
+
"/snapshots/{id}/finalize".format(id=params["id"]),
|
|
204
|
+
params,
|
|
205
|
+
options,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# Parameters:
|
|
210
|
+
# expires_at - string - When the snapshot expires.
|
|
211
|
+
# name - string - A name for the snapshot.
|
|
212
|
+
# paths - array(string) - An array of paths to add to the snapshot.
|
|
213
|
+
def update(id, params=None, options=None):
|
|
214
|
+
if not isinstance(params, dict):
|
|
215
|
+
params = {}
|
|
216
|
+
if not isinstance(options, dict):
|
|
217
|
+
options = {}
|
|
218
|
+
params["id"] = id
|
|
219
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
220
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
221
|
+
if "expires_at" in params and not isinstance(params["expires_at"], str):
|
|
222
|
+
raise InvalidParameterError("Bad parameter: expires_at must be an str")
|
|
223
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
224
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
225
|
+
if "paths" in params and not isinstance(params["paths"], builtins.list):
|
|
226
|
+
raise InvalidParameterError("Bad parameter: paths must be an list")
|
|
227
|
+
if "id" not in params:
|
|
228
|
+
raise MissingParameterError("Parameter missing: id")
|
|
229
|
+
response, options = Api.send_request(
|
|
230
|
+
"PATCH", "/snapshots/{id}".format(id=params["id"]), params, options
|
|
231
|
+
)
|
|
232
|
+
return Snapshot(response.data, options)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def delete(id, params=None, options=None):
|
|
236
|
+
if not isinstance(params, dict):
|
|
237
|
+
params = {}
|
|
238
|
+
if not isinstance(options, dict):
|
|
239
|
+
options = {}
|
|
240
|
+
params["id"] = id
|
|
241
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
242
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
243
|
+
if "id" not in params:
|
|
244
|
+
raise MissingParameterError("Parameter missing: id")
|
|
245
|
+
Api.send_request(
|
|
246
|
+
"DELETE", "/snapshots/{id}".format(id=params["id"]), params, options
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def destroy(id, params=None, options=None):
|
|
251
|
+
delete(id, params, options)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def new(*args, **kwargs):
|
|
255
|
+
return Snapshot(*args, **kwargs)
|
|
@@ -0,0 +1,168 @@
|
|
|
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 SsoStrategy:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"protocol": None, # string - SSO Protocol
|
|
14
|
+
"provider": None, # string - Provider name
|
|
15
|
+
"label": None, # string - Custom label for the SSO provider on the login page.
|
|
16
|
+
"logo_url": None, # string - URL holding a custom logo for the SSO provider on the login page.
|
|
17
|
+
"id": None, # int64 - ID
|
|
18
|
+
"user_count": None, # int64 - Count of users with this SSO Strategy
|
|
19
|
+
"saml_provider_cert_fingerprint": None, # string - Identity provider sha256 cert fingerprint if saml_provider_metadata_url is not available.
|
|
20
|
+
"saml_provider_issuer_url": None, # string - Identity provider issuer url
|
|
21
|
+
"saml_provider_metadata_content": None, # string - Custom identity provider metadata
|
|
22
|
+
"saml_provider_metadata_url": None, # string - Metadata URL for the SAML identity provider
|
|
23
|
+
"saml_provider_slo_target_url": None, # string - Identity provider SLO endpoint
|
|
24
|
+
"saml_provider_sso_target_url": None, # string - Identity provider SSO endpoint if saml_provider_metadata_url is not available.
|
|
25
|
+
"scim_authentication_method": None, # string - SCIM authentication type.
|
|
26
|
+
"scim_username": None, # string - SCIM username.
|
|
27
|
+
"scim_oauth_access_token": None, # string - SCIM OAuth Access Token.
|
|
28
|
+
"scim_oauth_access_token_expires_at": None, # string - SCIM OAuth Access Token Expiration Time.
|
|
29
|
+
"subdomain": None, # string - Subdomain or domain name for your auth provider. Example: `https://[subdomain].okta.com/`
|
|
30
|
+
"provision_users": None, # boolean - Auto-provision users?
|
|
31
|
+
"provision_groups": None, # boolean - Auto-provision group membership based on group memberships on the SSO side?
|
|
32
|
+
"deprovision_users": None, # boolean - Auto-deprovision users?
|
|
33
|
+
"deprovision_groups": None, # boolean - Auto-deprovision group membership based on group memberships on the SSO side?
|
|
34
|
+
"deprovision_behavior": None, # string - Method used for deprovisioning users.
|
|
35
|
+
"provision_group_default": None, # string - Comma-separated list of group names for groups to automatically add all auto-provisioned users to.
|
|
36
|
+
"provision_group_exclusion": None, # string - Comma-separated list of group names for groups (with optional wildcards) that will be excluded from auto-provisioning.
|
|
37
|
+
"provision_group_inclusion": None, # string - Comma-separated list of group names for groups (with optional wildcards) that will be auto-provisioned.
|
|
38
|
+
"provision_group_required": None, # string - Comma or newline separated list of group names (with optional wildcards) to require membership for user provisioning.
|
|
39
|
+
"provision_email_signup_groups": None, # string - Comma-separated list of group names whose members will be created with email_signup authentication.
|
|
40
|
+
"provision_readonly_site_admin_groups": None, # string - Comma-separated list of group names whose members will be created as Read-Only Site Admins.
|
|
41
|
+
"provision_site_admin_groups": None, # string - Comma-separated list of group names whose members will be created as Site Admins.
|
|
42
|
+
"provision_group_admin_groups": None, # string - Comma-separated list of group names whose members will be provisioned as Group Admins.
|
|
43
|
+
"provision_attachments_permission": None, # boolean
|
|
44
|
+
"provision_dav_permission": None, # boolean - Auto-provisioned users get WebDAV permission?
|
|
45
|
+
"provision_ftp_permission": None, # boolean - Auto-provisioned users get FTP permission?
|
|
46
|
+
"provision_sftp_permission": None, # boolean - Auto-provisioned users get SFTP permission?
|
|
47
|
+
"provision_time_zone": None, # string - Default time zone for auto provisioned users.
|
|
48
|
+
"provision_company": None, # string - Default company for auto provisioned users.
|
|
49
|
+
"provision_require_2fa": None, # string - 2FA required setting for auto provisioned users.
|
|
50
|
+
"provision_filesystem_layout": None, # string - File System layout to use for auto provisioned users.
|
|
51
|
+
"provider_identifier": None, # string - URL-friendly, unique identifier for Azure SAML configuration
|
|
52
|
+
"ldap_base_dn": None, # string - Base DN for looking up users in LDAP server
|
|
53
|
+
"ldap_domain": None, # string - Domain name that will be appended to LDAP usernames
|
|
54
|
+
"enabled": None, # boolean - Is strategy enabled? This may become automatically set to `false` after a high number and duration of failures.
|
|
55
|
+
"ldap_host": None, # string - LDAP host
|
|
56
|
+
"ldap_host_2": None, # string - LDAP backup host
|
|
57
|
+
"ldap_host_3": None, # string - LDAP backup host
|
|
58
|
+
"ldap_port": None, # int64 - LDAP port
|
|
59
|
+
"ldap_secure": None, # boolean - Use secure LDAP?
|
|
60
|
+
"ldap_username": None, # string - Username for signing in to LDAP server.
|
|
61
|
+
"ldap_username_field": None, # string - LDAP username field
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
def __init__(self, attributes=None, options=None):
|
|
65
|
+
if not isinstance(attributes, dict):
|
|
66
|
+
attributes = {}
|
|
67
|
+
if not isinstance(options, dict):
|
|
68
|
+
options = {}
|
|
69
|
+
self.set_attributes(attributes)
|
|
70
|
+
self.options = options
|
|
71
|
+
|
|
72
|
+
def set_attributes(self, attributes):
|
|
73
|
+
for attribute, default_value in SsoStrategy.default_attributes.items():
|
|
74
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
75
|
+
|
|
76
|
+
def get_attributes(self):
|
|
77
|
+
return {
|
|
78
|
+
k: getattr(self, k, None)
|
|
79
|
+
for k in SsoStrategy.default_attributes
|
|
80
|
+
if getattr(self, k, None) is not None
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# Synchronize provisioning data with the SSO remote server
|
|
84
|
+
def sync(self, params=None):
|
|
85
|
+
if not isinstance(params, dict):
|
|
86
|
+
params = {}
|
|
87
|
+
|
|
88
|
+
if hasattr(self, "id") and self.id:
|
|
89
|
+
params["id"] = self.id
|
|
90
|
+
else:
|
|
91
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
92
|
+
if "id" not in params:
|
|
93
|
+
raise MissingParameterError("Parameter missing: id")
|
|
94
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
95
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
96
|
+
Api.send_request(
|
|
97
|
+
"POST",
|
|
98
|
+
"/sso_strategies/{id}/sync".format(id=params["id"]),
|
|
99
|
+
params,
|
|
100
|
+
self.options,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# Parameters:
|
|
105
|
+
# 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.
|
|
106
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
107
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
108
|
+
def list(params=None, options=None):
|
|
109
|
+
if not isinstance(params, dict):
|
|
110
|
+
params = {}
|
|
111
|
+
if not isinstance(options, dict):
|
|
112
|
+
options = {}
|
|
113
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
114
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
115
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
116
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
117
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
118
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
119
|
+
return ListObj(SsoStrategy, "GET", "/sso_strategies", params, options)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def all(params=None, options=None):
|
|
123
|
+
list(params, options)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
# Parameters:
|
|
127
|
+
# id (required) - int64 - Sso Strategy ID.
|
|
128
|
+
def find(id, params=None, options=None):
|
|
129
|
+
if not isinstance(params, dict):
|
|
130
|
+
params = {}
|
|
131
|
+
if not isinstance(options, dict):
|
|
132
|
+
options = {}
|
|
133
|
+
params["id"] = id
|
|
134
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
135
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
136
|
+
if "id" not in params:
|
|
137
|
+
raise MissingParameterError("Parameter missing: id")
|
|
138
|
+
response, options = Api.send_request(
|
|
139
|
+
"GET", "/sso_strategies/{id}".format(id=params["id"]), params, options
|
|
140
|
+
)
|
|
141
|
+
return SsoStrategy(response.data, options)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def get(id, params=None, options=None):
|
|
145
|
+
find(id, params, options)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# Synchronize provisioning data with the SSO remote server
|
|
149
|
+
def sync(id, params=None, options=None):
|
|
150
|
+
if not isinstance(params, dict):
|
|
151
|
+
params = {}
|
|
152
|
+
if not isinstance(options, dict):
|
|
153
|
+
options = {}
|
|
154
|
+
params["id"] = id
|
|
155
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
156
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
157
|
+
if "id" not in params:
|
|
158
|
+
raise MissingParameterError("Parameter missing: id")
|
|
159
|
+
Api.send_request(
|
|
160
|
+
"POST",
|
|
161
|
+
"/sso_strategies/{id}/sync".format(id=params["id"]),
|
|
162
|
+
params,
|
|
163
|
+
options,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def new(*args, **kwargs):
|
|
168
|
+
return SsoStrategy(*args, **kwargs)
|
|
@@ -0,0 +1,42 @@
|
|
|
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 Status:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"code": None, # int64 - Status HTTP code
|
|
13
|
+
"message": None, # string - Error message
|
|
14
|
+
"status": None, # string - Status message
|
|
15
|
+
"data": None, # Auto - Additional data
|
|
16
|
+
"errors": None, # array(object) - A list of api errors
|
|
17
|
+
"clickwrap_id": None, # int64 - Required Clickwrap id
|
|
18
|
+
"clickwrap_body": None, # string - Required Clickwrap body
|
|
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 Status.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 Status.default_attributes
|
|
37
|
+
if getattr(self, k, None) is not None
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def new(*args, **kwargs):
|
|
42
|
+
return Status(*args, **kwargs)
|
|
@@ -0,0 +1,152 @@
|
|
|
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 Style:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - Style ID
|
|
13
|
+
"path": None, # string - Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
14
|
+
"logo": None, # Image - Logo
|
|
15
|
+
"thumbnail": None, # Image - Logo thumbnail
|
|
16
|
+
"file": None, # file - Logo for custom branding.
|
|
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 attribute, default_value in Style.default_attributes.items():
|
|
29
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
30
|
+
|
|
31
|
+
def get_attributes(self):
|
|
32
|
+
return {
|
|
33
|
+
k: getattr(self, k, None)
|
|
34
|
+
for k in Style.default_attributes
|
|
35
|
+
if getattr(self, k, None) is not None
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# Parameters:
|
|
39
|
+
# file (required) - file - Logo for custom branding.
|
|
40
|
+
def update(self, params=None):
|
|
41
|
+
if not isinstance(params, dict):
|
|
42
|
+
params = {}
|
|
43
|
+
|
|
44
|
+
if hasattr(self, "path") and self.path:
|
|
45
|
+
params["path"] = self.path
|
|
46
|
+
else:
|
|
47
|
+
raise MissingParameterError("Current object doesn't have a path")
|
|
48
|
+
if "path" not in params:
|
|
49
|
+
raise MissingParameterError("Parameter missing: path")
|
|
50
|
+
if "file" not in params:
|
|
51
|
+
raise MissingParameterError("Parameter missing: file")
|
|
52
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
53
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
54
|
+
response, _options = Api.send_request(
|
|
55
|
+
"PATCH",
|
|
56
|
+
"/styles/{path}".format(path=params["path"]),
|
|
57
|
+
params,
|
|
58
|
+
self.options,
|
|
59
|
+
)
|
|
60
|
+
return response.data
|
|
61
|
+
|
|
62
|
+
def delete(self, params=None):
|
|
63
|
+
if not isinstance(params, dict):
|
|
64
|
+
params = {}
|
|
65
|
+
|
|
66
|
+
if hasattr(self, "path") and self.path:
|
|
67
|
+
params["path"] = self.path
|
|
68
|
+
else:
|
|
69
|
+
raise MissingParameterError("Current object doesn't have a path")
|
|
70
|
+
if "path" not in params:
|
|
71
|
+
raise MissingParameterError("Parameter missing: path")
|
|
72
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
73
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
74
|
+
Api.send_request(
|
|
75
|
+
"DELETE",
|
|
76
|
+
"/styles/{path}".format(path=params["path"]),
|
|
77
|
+
params,
|
|
78
|
+
self.options,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def destroy(self, params=None):
|
|
82
|
+
self.delete(params)
|
|
83
|
+
|
|
84
|
+
def save(self):
|
|
85
|
+
new_obj = self.update(self.get_attributes())
|
|
86
|
+
self.set_attributes(new_obj.get_attributes())
|
|
87
|
+
return True
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Parameters:
|
|
91
|
+
# path (required) - string - Style path.
|
|
92
|
+
def find(path, params=None, options=None):
|
|
93
|
+
if not isinstance(params, dict):
|
|
94
|
+
params = {}
|
|
95
|
+
if not isinstance(options, dict):
|
|
96
|
+
options = {}
|
|
97
|
+
params["path"] = path
|
|
98
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
99
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
100
|
+
if "path" not in params:
|
|
101
|
+
raise MissingParameterError("Parameter missing: path")
|
|
102
|
+
response, options = Api.send_request(
|
|
103
|
+
"GET", "/styles/{path}".format(path=params["path"]), params, options
|
|
104
|
+
)
|
|
105
|
+
return Style(response.data, options)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def get(path, params=None, options=None):
|
|
109
|
+
find(path, params, options)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# Parameters:
|
|
113
|
+
# file (required) - file - Logo for custom branding.
|
|
114
|
+
def update(path, params=None, options=None):
|
|
115
|
+
if not isinstance(params, dict):
|
|
116
|
+
params = {}
|
|
117
|
+
if not isinstance(options, dict):
|
|
118
|
+
options = {}
|
|
119
|
+
params["path"] = path
|
|
120
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
121
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
122
|
+
if "path" not in params:
|
|
123
|
+
raise MissingParameterError("Parameter missing: path")
|
|
124
|
+
if "file" not in params:
|
|
125
|
+
raise MissingParameterError("Parameter missing: file")
|
|
126
|
+
response, options = Api.send_request(
|
|
127
|
+
"PATCH", "/styles/{path}".format(path=params["path"]), params, options
|
|
128
|
+
)
|
|
129
|
+
return Style(response.data, options)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def delete(path, params=None, options=None):
|
|
133
|
+
if not isinstance(params, dict):
|
|
134
|
+
params = {}
|
|
135
|
+
if not isinstance(options, dict):
|
|
136
|
+
options = {}
|
|
137
|
+
params["path"] = path
|
|
138
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
139
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
140
|
+
if "path" not in params:
|
|
141
|
+
raise MissingParameterError("Parameter missing: path")
|
|
142
|
+
Api.send_request(
|
|
143
|
+
"DELETE", "/styles/{path}".format(path=params["path"]), params, options
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def destroy(path, params=None, options=None):
|
|
148
|
+
delete(path, params, options)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def new(*args, **kwargs):
|
|
152
|
+
return Style(*args, **kwargs)
|