files-com 1.6.7__py3-none-any.whl → 1.6.113__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 +80 -18
- _VERSION +1 -1
- {files_com-1.6.7.dist-info → files_com-1.6.113.dist-info}/METADATA +81 -19
- {files_com-1.6.7.dist-info → files_com-1.6.113.dist-info}/RECORD +53 -46
- files_sdk/__init__.py +17 -1
- files_sdk/error.py +98 -23
- files_sdk/models/__init__.py +9 -0
- files_sdk/models/api_key.py +10 -0
- files_sdk/models/api_request_log.py +21 -3
- files_sdk/models/as2_partner.py +31 -9
- files_sdk/models/as2_station.py +1 -1
- files_sdk/models/automation.py +65 -5
- files_sdk/models/automation_log.py +20 -3
- files_sdk/models/behavior.py +2 -16
- 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 +17 -7
- files_sdk/models/exavault_api_request_log.py +20 -3
- files_sdk/models/file.py +8 -0
- files_sdk/models/file_migration_log.py +17 -7
- files_sdk/models/folder.py +11 -1
- files_sdk/models/ftp_action_log.py +20 -3
- files_sdk/models/gpg_key.py +61 -9
- files_sdk/models/history_export.py +4 -4
- files_sdk/models/history_export_result.py +2 -2
- files_sdk/models/holiday_region.py +58 -0
- files_sdk/models/inbox_registration.py +1 -1
- files_sdk/models/invoice_line_item.py +5 -0
- files_sdk/models/outbound_connection_log.py +20 -3
- files_sdk/models/partner.py +296 -0
- files_sdk/models/permission.py +10 -2
- files_sdk/models/public_hosting_request_log.py +27 -8
- files_sdk/models/public_key.py +59 -3
- files_sdk/models/remote_mount_backend.py +438 -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 +20 -3
- files_sdk/models/siem_http_destination.py +98 -19
- files_sdk/models/site.py +37 -31
- files_sdk/models/sso_strategy.py +2 -1
- files_sdk/models/sync.py +574 -0
- files_sdk/models/sync_log.py +19 -8
- files_sdk/models/sync_run.py +123 -0
- files_sdk/models/user.py +105 -12
- files_sdk/models/user_cipher_use.py +24 -1
- files_sdk/models/user_lifecycle_rule.py +94 -39
- files_sdk/models/web_dav_action_log.py +20 -3
- {files_com-1.6.7.dist-info → files_com-1.6.113.dist-info}/WHEEL +0 -0
- {files_com-1.6.7.dist-info → files_com-1.6.113.dist-info}/licenses/LICENSE +0 -0
- {files_com-1.6.7.dist-info → files_com-1.6.113.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):
|
|
@@ -10,14 +10,17 @@ from files_sdk.error import ( # noqa: F401
|
|
|
10
10
|
|
|
11
11
|
class PublicHostingRequestLog:
|
|
12
12
|
default_attributes = {
|
|
13
|
-
"timestamp": None, # date-time - Start Time of Action
|
|
14
|
-
"remote_ip": None, # string - IP Address of Public Hosting Client
|
|
15
|
-
"server_ip": None, # string - IP Address of Public Hosting Server
|
|
16
|
-
"hostname": None, # string - HTTP Request Hostname
|
|
13
|
+
"timestamp": None, # date-time - Start Time of Action. Deprecrated: Use created_at.
|
|
14
|
+
"remote_ip": None, # string - IP Address of Public Hosting Client.
|
|
15
|
+
"server_ip": None, # string - IP Address of Public Hosting Server.
|
|
16
|
+
"hostname": None, # string - HTTP Request Hostname.
|
|
17
17
|
"path": None, # string - HTTP Request Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
18
|
-
"responseCode": None, # int64 - HTTP Response Code
|
|
18
|
+
"responseCode": None, # int64 - HTTP Response Code.
|
|
19
19
|
"success": None, # boolean - Whether SFTP Action was successful.
|
|
20
|
-
"duration_ms": None, # int64 - Duration (in milliseconds)
|
|
20
|
+
"duration_ms": None, # int64 - Duration (in milliseconds).
|
|
21
|
+
"created_at": None, # date-time - Start Time of Action.
|
|
22
|
+
"bytes_transferred": None, # int64 - The number of bytes transferred for file downloads.
|
|
23
|
+
"http_method": None, # string - Method of the HTTP call.
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
def __init__(self, attributes=None, options=None):
|
|
@@ -46,8 +49,12 @@ class PublicHostingRequestLog:
|
|
|
46
49
|
# Parameters:
|
|
47
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.
|
|
48
51
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
49
|
-
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `
|
|
50
|
-
#
|
|
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 ]`.
|
|
51
58
|
def list(params=None, options=None):
|
|
52
59
|
if not isinstance(params, dict):
|
|
53
60
|
params = {}
|
|
@@ -59,12 +66,24 @@ def list(params=None, options=None):
|
|
|
59
66
|
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
60
67
|
if "filter" in params and not isinstance(params["filter"], dict):
|
|
61
68
|
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
69
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
70
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
71
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
72
|
+
raise InvalidParameterError(
|
|
73
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
74
|
+
)
|
|
62
75
|
if "filter_prefix" in params and not isinstance(
|
|
63
76
|
params["filter_prefix"], dict
|
|
64
77
|
):
|
|
65
78
|
raise InvalidParameterError(
|
|
66
79
|
"Bad parameter: filter_prefix must be an dict"
|
|
67
80
|
)
|
|
81
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
82
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
83
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
84
|
+
raise InvalidParameterError(
|
|
85
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
86
|
+
)
|
|
68
87
|
return ListObj(
|
|
69
88
|
PublicHostingRequestLog,
|
|
70
89
|
"GET",
|
files_sdk/models/public_key.py
CHANGED
|
@@ -15,9 +15,17 @@ 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 - Only returned when generating keys. Can be invalid, not_generated, generating, complete
|
|
19
|
+
"last_login_at": None, # date-time - Key's most recent login time via SFTP
|
|
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.
|
|
18
22
|
"username": None, # string - Username of the user this public key is associated with
|
|
19
23
|
"user_id": None, # int64 - User ID this public key is associated with
|
|
20
24
|
"public_key": None, # string - Actual contents of SSH key.
|
|
25
|
+
"generate_keypair": None, # boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
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.
|
|
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.
|
|
28
|
+
"generate_length": None, # int64 - Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
def __init__(self, attributes=None, options=None):
|
|
@@ -102,6 +110,12 @@ class PublicKey:
|
|
|
102
110
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
103
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.
|
|
104
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`.
|
|
114
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`.
|
|
115
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
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`.
|
|
117
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
118
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
105
119
|
def list(params=None, options=None):
|
|
106
120
|
if not isinstance(params, dict):
|
|
107
121
|
params = {}
|
|
@@ -113,6 +127,22 @@ def list(params=None, options=None):
|
|
|
113
127
|
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
114
128
|
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
115
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")
|
|
132
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
133
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
134
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
135
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
136
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
137
|
+
raise InvalidParameterError(
|
|
138
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
139
|
+
)
|
|
140
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
141
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
142
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
143
|
+
raise InvalidParameterError(
|
|
144
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
145
|
+
)
|
|
116
146
|
return ListObj(PublicKey, "GET", "/public_keys", params, options)
|
|
117
147
|
|
|
118
148
|
|
|
@@ -145,7 +175,11 @@ def get(id, params=None, options=None):
|
|
|
145
175
|
# Parameters:
|
|
146
176
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
147
177
|
# title (required) - string - Internal reference for key.
|
|
148
|
-
# public_key
|
|
178
|
+
# public_key - string - Actual contents of SSH key.
|
|
179
|
+
# generate_keypair - boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
180
|
+
# generate_private_key_password - string - Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
181
|
+
# generate_algorithm - 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.
|
|
182
|
+
# generate_length - int64 - Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
149
183
|
def create(params=None, options=None):
|
|
150
184
|
if not isinstance(params, dict):
|
|
151
185
|
params = {}
|
|
@@ -157,10 +191,32 @@ def create(params=None, options=None):
|
|
|
157
191
|
raise InvalidParameterError("Bad parameter: title must be an str")
|
|
158
192
|
if "public_key" in params and not isinstance(params["public_key"], str):
|
|
159
193
|
raise InvalidParameterError("Bad parameter: public_key must be an str")
|
|
194
|
+
if "generate_keypair" in params and not isinstance(
|
|
195
|
+
params["generate_keypair"], bool
|
|
196
|
+
):
|
|
197
|
+
raise InvalidParameterError(
|
|
198
|
+
"Bad parameter: generate_keypair must be an bool"
|
|
199
|
+
)
|
|
200
|
+
if "generate_private_key_password" in params and not isinstance(
|
|
201
|
+
params["generate_private_key_password"], str
|
|
202
|
+
):
|
|
203
|
+
raise InvalidParameterError(
|
|
204
|
+
"Bad parameter: generate_private_key_password must be an str"
|
|
205
|
+
)
|
|
206
|
+
if "generate_algorithm" in params and not isinstance(
|
|
207
|
+
params["generate_algorithm"], str
|
|
208
|
+
):
|
|
209
|
+
raise InvalidParameterError(
|
|
210
|
+
"Bad parameter: generate_algorithm must be an str"
|
|
211
|
+
)
|
|
212
|
+
if "generate_length" in params and not isinstance(
|
|
213
|
+
params["generate_length"], int
|
|
214
|
+
):
|
|
215
|
+
raise InvalidParameterError(
|
|
216
|
+
"Bad parameter: generate_length must be an int"
|
|
217
|
+
)
|
|
160
218
|
if "title" not in params:
|
|
161
219
|
raise MissingParameterError("Parameter missing: title")
|
|
162
|
-
if "public_key" not in params:
|
|
163
|
-
raise MissingParameterError("Parameter missing: public_key")
|
|
164
220
|
response, options = Api.send_request(
|
|
165
221
|
"POST", "/public_keys", params, options
|
|
166
222
|
)
|