files-com 1.6.32__py3-none-any.whl → 1.6.101__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- README.md +80 -18
- _VERSION +1 -1
- {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/METADATA +81 -19
- {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/RECORD +50 -47
- files_sdk/__init__.py +9 -1
- files_sdk/error.py +98 -23
- files_sdk/models/__init__.py +5 -0
- files_sdk/models/api_key.py +10 -0
- files_sdk/models/api_request_log.py +6 -6
- files_sdk/models/automation.py +48 -5
- files_sdk/models/automation_log.py +6 -6
- files_sdk/models/behavior.py +2 -2
- files_sdk/models/bundle.py +1 -1
- files_sdk/models/bundle_action.py +5 -1
- files_sdk/models/bundle_registration.py +1 -1
- files_sdk/models/child_site_management_policy.py +278 -0
- files_sdk/models/email_log.py +6 -6
- files_sdk/models/exavault_api_request_log.py +6 -6
- files_sdk/models/file.py +8 -0
- files_sdk/models/file_migration_log.py +6 -6
- files_sdk/models/folder.py +11 -1
- files_sdk/models/ftp_action_log.py +6 -6
- files_sdk/models/gpg_key.py +29 -9
- files_sdk/models/history_export.py +4 -4
- files_sdk/models/history_export_result.py +2 -2
- files_sdk/models/inbox_registration.py +1 -1
- files_sdk/models/invoice_line_item.py +5 -0
- files_sdk/models/outbound_connection_log.py +6 -6
- files_sdk/models/partner.py +296 -0
- files_sdk/models/permission.py +10 -2
- files_sdk/models/public_hosting_request_log.py +6 -6
- files_sdk/models/public_key.py +7 -3
- files_sdk/models/remote_mount_backend.py +1 -0
- files_sdk/models/remote_server.py +19 -91
- files_sdk/models/remote_server_configuration_file.py +1 -0
- files_sdk/models/scim_log.py +88 -0
- files_sdk/models/sftp_action_log.py +6 -6
- files_sdk/models/siem_http_destination.py +16 -16
- files_sdk/models/site.py +29 -12
- files_sdk/models/sso_strategy.py +2 -1
- files_sdk/models/sync.py +74 -10
- files_sdk/models/sync_log.py +8 -7
- files_sdk/models/sync_run.py +31 -17
- files_sdk/models/user.py +80 -3
- files_sdk/models/user_cipher_use.py +24 -1
- files_sdk/models/user_lifecycle_rule.py +81 -40
- files_sdk/models/web_dav_action_log.py +6 -6
- {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/WHEEL +0 -0
- {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/licenses/LICENSE +0 -0
- {files_com-1.6.32.dist-info → files_com-1.6.101.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
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 Partner:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"allow_bypassing_2fa_policies": None, # boolean - Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
|
|
14
|
+
"allow_credential_changes": None, # boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
15
|
+
"allow_providing_gpg_keys": None, # boolean - Allow Partner Admins to provide GPG keys.
|
|
16
|
+
"allow_user_creation": None, # boolean - Allow Partner Admins to create users.
|
|
17
|
+
"id": None, # int64 - The unique ID of the Partner.
|
|
18
|
+
"name": None, # string - The name of the Partner.
|
|
19
|
+
"notes": None, # string - Notes about this Partner.
|
|
20
|
+
"partner_admin_ids": None, # array(int64) - Array of User IDs that are Partner Admins for this Partner.
|
|
21
|
+
"root_folder": None, # string - The root folder path for this Partner.
|
|
22
|
+
"tags": None, # string - Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
23
|
+
"user_ids": None, # array(int64) - Array of User IDs that belong to this Partner.
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def __init__(self, attributes=None, options=None):
|
|
27
|
+
if not isinstance(attributes, dict):
|
|
28
|
+
attributes = {}
|
|
29
|
+
if not isinstance(options, dict):
|
|
30
|
+
options = {}
|
|
31
|
+
self.set_attributes(attributes)
|
|
32
|
+
self.options = options
|
|
33
|
+
|
|
34
|
+
def set_attributes(self, attributes):
|
|
35
|
+
for attribute, default_value in Partner.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 Partner.default_attributes
|
|
42
|
+
if getattr(self, k, None) is not None
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Parameters:
|
|
46
|
+
# allow_bypassing_2fa_policies - boolean - Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
|
|
47
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
48
|
+
# allow_providing_gpg_keys - boolean - Allow Partner Admins to provide GPG keys.
|
|
49
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
50
|
+
# notes - string - Notes about this Partner.
|
|
51
|
+
# root_folder - string - The root folder path for this Partner.
|
|
52
|
+
# tags - string - Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
53
|
+
# name - string - The name of the Partner.
|
|
54
|
+
def update(self, params=None):
|
|
55
|
+
if not isinstance(params, dict):
|
|
56
|
+
params = {}
|
|
57
|
+
|
|
58
|
+
if hasattr(self, "id") and self.id:
|
|
59
|
+
params["id"] = self.id
|
|
60
|
+
else:
|
|
61
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
62
|
+
if "id" not in params:
|
|
63
|
+
raise MissingParameterError("Parameter missing: id")
|
|
64
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
66
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
68
|
+
if "root_folder" in params and not isinstance(
|
|
69
|
+
params["root_folder"], str
|
|
70
|
+
):
|
|
71
|
+
raise InvalidParameterError(
|
|
72
|
+
"Bad parameter: root_folder must be an str"
|
|
73
|
+
)
|
|
74
|
+
if "tags" in params and not isinstance(params["tags"], str):
|
|
75
|
+
raise InvalidParameterError("Bad parameter: tags must be an str")
|
|
76
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
77
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
78
|
+
response, _options = Api.send_request(
|
|
79
|
+
"PATCH",
|
|
80
|
+
"/partners/{id}".format(id=params["id"]),
|
|
81
|
+
params,
|
|
82
|
+
self.options,
|
|
83
|
+
)
|
|
84
|
+
return response.data
|
|
85
|
+
|
|
86
|
+
def delete(self, params=None):
|
|
87
|
+
if not isinstance(params, dict):
|
|
88
|
+
params = {}
|
|
89
|
+
|
|
90
|
+
if hasattr(self, "id") and self.id:
|
|
91
|
+
params["id"] = self.id
|
|
92
|
+
else:
|
|
93
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
94
|
+
if "id" not in params:
|
|
95
|
+
raise MissingParameterError("Parameter missing: id")
|
|
96
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
97
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
98
|
+
Api.send_request(
|
|
99
|
+
"DELETE",
|
|
100
|
+
"/partners/{id}".format(id=params["id"]),
|
|
101
|
+
params,
|
|
102
|
+
self.options,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
def destroy(self, params=None):
|
|
106
|
+
self.delete(params)
|
|
107
|
+
|
|
108
|
+
def save(self):
|
|
109
|
+
if hasattr(self, "id") and self.id:
|
|
110
|
+
new_obj = self.update(self.get_attributes())
|
|
111
|
+
self.set_attributes(new_obj.get_attributes())
|
|
112
|
+
return True
|
|
113
|
+
else:
|
|
114
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
115
|
+
self.set_attributes(new_obj.get_attributes())
|
|
116
|
+
return True
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# Parameters:
|
|
120
|
+
# 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.
|
|
121
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
122
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`.
|
|
123
|
+
def list(params=None, options=None):
|
|
124
|
+
if not isinstance(params, dict):
|
|
125
|
+
params = {}
|
|
126
|
+
if not isinstance(options, dict):
|
|
127
|
+
options = {}
|
|
128
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
129
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
130
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
131
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
132
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
133
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
134
|
+
return ListObj(Partner, "GET", "/partners", params, options)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def all(params=None, options=None):
|
|
138
|
+
list(params, options)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# Parameters:
|
|
142
|
+
# id (required) - int64 - Partner ID.
|
|
143
|
+
def find(id, params=None, options=None):
|
|
144
|
+
if not isinstance(params, dict):
|
|
145
|
+
params = {}
|
|
146
|
+
if not isinstance(options, dict):
|
|
147
|
+
options = {}
|
|
148
|
+
params["id"] = id
|
|
149
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
150
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
151
|
+
if "id" not in params:
|
|
152
|
+
raise MissingParameterError("Parameter missing: id")
|
|
153
|
+
response, options = Api.send_request(
|
|
154
|
+
"GET", "/partners/{id}".format(id=params["id"]), params, options
|
|
155
|
+
)
|
|
156
|
+
return Partner(response.data, options)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def get(id, params=None, options=None):
|
|
160
|
+
find(id, params, options)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# Parameters:
|
|
164
|
+
# allow_bypassing_2fa_policies - boolean - Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
|
|
165
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
166
|
+
# allow_providing_gpg_keys - boolean - Allow Partner Admins to provide GPG keys.
|
|
167
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
168
|
+
# notes - string - Notes about this Partner.
|
|
169
|
+
# root_folder - string - The root folder path for this Partner.
|
|
170
|
+
# tags - string - Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
171
|
+
# name (required) - string - The name of the Partner.
|
|
172
|
+
def create(params=None, options=None):
|
|
173
|
+
if not isinstance(params, dict):
|
|
174
|
+
params = {}
|
|
175
|
+
if not isinstance(options, dict):
|
|
176
|
+
options = {}
|
|
177
|
+
if "allow_bypassing_2fa_policies" in params and not isinstance(
|
|
178
|
+
params["allow_bypassing_2fa_policies"], bool
|
|
179
|
+
):
|
|
180
|
+
raise InvalidParameterError(
|
|
181
|
+
"Bad parameter: allow_bypassing_2fa_policies must be an bool"
|
|
182
|
+
)
|
|
183
|
+
if "allow_credential_changes" in params and not isinstance(
|
|
184
|
+
params["allow_credential_changes"], bool
|
|
185
|
+
):
|
|
186
|
+
raise InvalidParameterError(
|
|
187
|
+
"Bad parameter: allow_credential_changes must be an bool"
|
|
188
|
+
)
|
|
189
|
+
if "allow_providing_gpg_keys" in params and not isinstance(
|
|
190
|
+
params["allow_providing_gpg_keys"], bool
|
|
191
|
+
):
|
|
192
|
+
raise InvalidParameterError(
|
|
193
|
+
"Bad parameter: allow_providing_gpg_keys must be an bool"
|
|
194
|
+
)
|
|
195
|
+
if "allow_user_creation" in params and not isinstance(
|
|
196
|
+
params["allow_user_creation"], bool
|
|
197
|
+
):
|
|
198
|
+
raise InvalidParameterError(
|
|
199
|
+
"Bad parameter: allow_user_creation must be an bool"
|
|
200
|
+
)
|
|
201
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
202
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
203
|
+
if "root_folder" in params and not isinstance(params["root_folder"], str):
|
|
204
|
+
raise InvalidParameterError(
|
|
205
|
+
"Bad parameter: root_folder must be an str"
|
|
206
|
+
)
|
|
207
|
+
if "tags" in params and not isinstance(params["tags"], str):
|
|
208
|
+
raise InvalidParameterError("Bad parameter: tags must be an str")
|
|
209
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
210
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
211
|
+
if "name" not in params:
|
|
212
|
+
raise MissingParameterError("Parameter missing: name")
|
|
213
|
+
response, options = Api.send_request("POST", "/partners", params, options)
|
|
214
|
+
return Partner(response.data, options)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
# Parameters:
|
|
218
|
+
# allow_bypassing_2fa_policies - boolean - Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
|
|
219
|
+
# allow_credential_changes - boolean - Allow Partner Admins to change or reset credentials for users belonging to this Partner.
|
|
220
|
+
# allow_providing_gpg_keys - boolean - Allow Partner Admins to provide GPG keys.
|
|
221
|
+
# allow_user_creation - boolean - Allow Partner Admins to create users.
|
|
222
|
+
# notes - string - Notes about this Partner.
|
|
223
|
+
# root_folder - string - The root folder path for this Partner.
|
|
224
|
+
# tags - string - Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
225
|
+
# name - string - The name of the Partner.
|
|
226
|
+
def update(id, params=None, options=None):
|
|
227
|
+
if not isinstance(params, dict):
|
|
228
|
+
params = {}
|
|
229
|
+
if not isinstance(options, dict):
|
|
230
|
+
options = {}
|
|
231
|
+
params["id"] = id
|
|
232
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
233
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
234
|
+
if "allow_bypassing_2fa_policies" in params and not isinstance(
|
|
235
|
+
params["allow_bypassing_2fa_policies"], bool
|
|
236
|
+
):
|
|
237
|
+
raise InvalidParameterError(
|
|
238
|
+
"Bad parameter: allow_bypassing_2fa_policies must be an bool"
|
|
239
|
+
)
|
|
240
|
+
if "allow_credential_changes" in params and not isinstance(
|
|
241
|
+
params["allow_credential_changes"], bool
|
|
242
|
+
):
|
|
243
|
+
raise InvalidParameterError(
|
|
244
|
+
"Bad parameter: allow_credential_changes must be an bool"
|
|
245
|
+
)
|
|
246
|
+
if "allow_providing_gpg_keys" in params and not isinstance(
|
|
247
|
+
params["allow_providing_gpg_keys"], bool
|
|
248
|
+
):
|
|
249
|
+
raise InvalidParameterError(
|
|
250
|
+
"Bad parameter: allow_providing_gpg_keys must be an bool"
|
|
251
|
+
)
|
|
252
|
+
if "allow_user_creation" in params and not isinstance(
|
|
253
|
+
params["allow_user_creation"], bool
|
|
254
|
+
):
|
|
255
|
+
raise InvalidParameterError(
|
|
256
|
+
"Bad parameter: allow_user_creation must be an bool"
|
|
257
|
+
)
|
|
258
|
+
if "notes" in params and not isinstance(params["notes"], str):
|
|
259
|
+
raise InvalidParameterError("Bad parameter: notes must be an str")
|
|
260
|
+
if "root_folder" in params and not isinstance(params["root_folder"], str):
|
|
261
|
+
raise InvalidParameterError(
|
|
262
|
+
"Bad parameter: root_folder must be an str"
|
|
263
|
+
)
|
|
264
|
+
if "tags" in params and not isinstance(params["tags"], str):
|
|
265
|
+
raise InvalidParameterError("Bad parameter: tags must be an str")
|
|
266
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
267
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
268
|
+
if "id" not in params:
|
|
269
|
+
raise MissingParameterError("Parameter missing: id")
|
|
270
|
+
response, options = Api.send_request(
|
|
271
|
+
"PATCH", "/partners/{id}".format(id=params["id"]), params, options
|
|
272
|
+
)
|
|
273
|
+
return Partner(response.data, options)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def delete(id, params=None, options=None):
|
|
277
|
+
if not isinstance(params, dict):
|
|
278
|
+
params = {}
|
|
279
|
+
if not isinstance(options, dict):
|
|
280
|
+
options = {}
|
|
281
|
+
params["id"] = id
|
|
282
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
283
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
284
|
+
if "id" not in params:
|
|
285
|
+
raise MissingParameterError("Parameter missing: id")
|
|
286
|
+
Api.send_request(
|
|
287
|
+
"DELETE", "/partners/{id}".format(id=params["id"]), params, options
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def destroy(id, params=None, options=None):
|
|
292
|
+
delete(id, params, options)
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def new(*args, **kwargs):
|
|
296
|
+
return Partner(*args, **kwargs)
|
files_sdk/models/permission.py
CHANGED
|
@@ -16,6 +16,8 @@ class Permission:
|
|
|
16
16
|
"username": None, # string - Username (if applicable)
|
|
17
17
|
"group_id": None, # int64 - Group ID
|
|
18
18
|
"group_name": None, # string - Group name (if applicable)
|
|
19
|
+
"partner_id": None, # int64 - Partner ID (if applicable)
|
|
20
|
+
"partner_name": None, # string - Partner name (if applicable)
|
|
19
21
|
"permission": None, # string - Permission type. See the table referenced in the documentation for an explanation of each permission.
|
|
20
22
|
"recursive": None, # boolean - Recursive: does this permission apply to subfolders?
|
|
21
23
|
"site_id": None, # int64 - Site ID
|
|
@@ -76,12 +78,13 @@ class Permission:
|
|
|
76
78
|
# Parameters:
|
|
77
79
|
# 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.
|
|
78
80
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
79
|
-
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path` or `
|
|
80
|
-
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ user_id, path ]` or `[ user_id, group_id ]`.
|
|
81
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path`, `user_id`, `partner_id` or `id`.
|
|
82
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id`, `partner_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ partner_id, path ]`, `[ user_id, path ]`, `[ user_id, group_id ]`, `[ user_id, group_id, path ]`, `[ user_id, group_id, partner_id ]` or `[ user_id, group_id, partner_id, path ]`.
|
|
81
83
|
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
|
|
82
84
|
# path - string - Permission path. If provided, will scope all permissions(including upward) to this path.
|
|
83
85
|
# include_groups - boolean - If searching by user or group, also include user's permissions that are inherited from its groups?
|
|
84
86
|
# group_id - string
|
|
87
|
+
# partner_id - string
|
|
85
88
|
# user_id - string
|
|
86
89
|
def list(params=None, options=None):
|
|
87
90
|
if not isinstance(params, dict):
|
|
@@ -112,6 +115,8 @@ def list(params=None, options=None):
|
|
|
112
115
|
)
|
|
113
116
|
if "group_id" in params and not isinstance(params["group_id"], str):
|
|
114
117
|
raise InvalidParameterError("Bad parameter: group_id must be an str")
|
|
118
|
+
if "partner_id" in params and not isinstance(params["partner_id"], str):
|
|
119
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an str")
|
|
115
120
|
if "user_id" in params and not isinstance(params["user_id"], str):
|
|
116
121
|
raise InvalidParameterError("Bad parameter: user_id must be an str")
|
|
117
122
|
return ListObj(Permission, "GET", "/permissions", params, options)
|
|
@@ -126,6 +131,7 @@ def all(params=None, options=None):
|
|
|
126
131
|
# group_id - int64 - Group ID. Provide `group_name` or `group_id`
|
|
127
132
|
# permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
|
|
128
133
|
# recursive - boolean - Apply to subfolders recursively?
|
|
134
|
+
# partner_id - int64 - Partner ID if this Permission belongs to a partner.
|
|
129
135
|
# user_id - int64 - User ID. Provide `username` or `user_id`
|
|
130
136
|
# username - string - User username. Provide `username` or `user_id`
|
|
131
137
|
# group_name - string - Group name. Provide `group_name` or `group_id`
|
|
@@ -143,6 +149,8 @@ def create(params=None, options=None):
|
|
|
143
149
|
raise InvalidParameterError("Bad parameter: permission must be an str")
|
|
144
150
|
if "recursive" in params and not isinstance(params["recursive"], bool):
|
|
145
151
|
raise InvalidParameterError("Bad parameter: recursive must be an bool")
|
|
152
|
+
if "partner_id" in params and not isinstance(params["partner_id"], int):
|
|
153
|
+
raise InvalidParameterError("Bad parameter: partner_id must be an int")
|
|
146
154
|
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
147
155
|
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
148
156
|
if "username" in params and not isinstance(params["username"], str):
|
|
@@ -49,12 +49,12 @@ class PublicHostingRequestLog:
|
|
|
49
49
|
# Parameters:
|
|
50
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
51
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
52
|
-
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `
|
|
53
|
-
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[
|
|
54
|
-
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[
|
|
55
|
-
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`. Valid field combinations are `[
|
|
56
|
-
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[
|
|
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`. Valid field combinations are `[
|
|
52
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `remote_ip`, `success` or `created_at`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, created_at ]`.
|
|
53
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, created_at ]`.
|
|
54
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, created_at ]`.
|
|
55
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, 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`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, 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`. Valid field combinations are `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ created_at ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ path, created_at ]`, `[ remote_ip, success ]`, `[ remote_ip, created_at ]`, `[ success, created_at ]`, `[ path, remote_ip, success ]`, `[ path, remote_ip, created_at ]`, `[ path, success, created_at ]`, `[ remote_ip, success, created_at ]` or `[ path, remote_ip, success, created_at ]`.
|
|
58
58
|
def list(params=None, options=None):
|
|
59
59
|
if not isinstance(params, dict):
|
|
60
60
|
params = {}
|
files_sdk/models/public_key.py
CHANGED
|
@@ -15,12 +15,13 @@ class PublicKey:
|
|
|
15
15
|
"created_at": None, # date-time - Public key created at date/time
|
|
16
16
|
"fingerprint": None, # string - Public key fingerprint (MD5)
|
|
17
17
|
"fingerprint_sha256": None, # string - Public key fingerprint (SHA256)
|
|
18
|
-
"status": None, # string - Can be invalid, not_generated, generating, complete
|
|
18
|
+
"status": None, # string - Only returned when generating keys. Can be invalid, not_generated, generating, complete
|
|
19
19
|
"last_login_at": None, # date-time - Key's most recent login time via SFTP
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"generated_private_key": None, # string - Only returned when generating keys. Private key generated for the user.
|
|
21
|
+
"generated_public_key": None, # string - Only returned when generating keys. Public key generated for the user.
|
|
22
22
|
"username": None, # string - Username of the user this public key is associated with
|
|
23
23
|
"user_id": None, # int64 - User ID this public key is associated with
|
|
24
|
+
"public_key": None, # string - Actual contents of SSH key.
|
|
24
25
|
"generate_keypair": None, # boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
25
26
|
"generate_private_key_password": None, # string - Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
26
27
|
"generate_algorithm": None, # string - Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
@@ -109,6 +110,7 @@ class PublicKey:
|
|
|
109
110
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
110
111
|
# 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.
|
|
111
112
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
113
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `title`, `created_at` or `user_id`.
|
|
112
114
|
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
|
|
113
115
|
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
114
116
|
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
@@ -125,6 +127,8 @@ def list(params=None, options=None):
|
|
|
125
127
|
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
126
128
|
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
127
129
|
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
130
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
131
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
128
132
|
if "filter" in params and not isinstance(params["filter"], dict):
|
|
129
133
|
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
130
134
|
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
@@ -14,6 +14,7 @@ class RemoteMountBackend:
|
|
|
14
14
|
"enabled": None, # boolean - True if this backend is enabled.
|
|
15
15
|
"fall": None, # int64 - Number of consecutive failures before considering the backend unhealthy.
|
|
16
16
|
"health_check_enabled": None, # boolean - True if health checks are enabled for this backend.
|
|
17
|
+
"health_check_results": None, # array(object) - Array of recent health check results.
|
|
17
18
|
"health_check_type": None, # string - Type of health check to perform.
|
|
18
19
|
"id": None, # int64 - Unique identifier for this backend.
|
|
19
20
|
"interval": None, # int64 - Interval in seconds between health checks.
|