files-com 1.6.121__py3-none-any.whl → 1.6.191__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 +1 -0
- _VERSION +1 -1
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/METADATA +2 -1
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/RECORD +36 -31
- files_sdk/__init__.py +11 -1
- files_sdk/error.py +15 -0
- files_sdk/models/__init__.py +5 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +7 -21
- files_sdk/models/as2_incoming_message.py +3 -9
- files_sdk/models/as2_outgoing_message.py +3 -9
- files_sdk/models/as2_partner.py +7 -0
- files_sdk/models/as2_station.py +15 -4
- files_sdk/models/automation.py +10 -2
- files_sdk/models/automation_run.py +2 -1
- files_sdk/models/behavior.py +12 -14
- files_sdk/models/bundle.py +9 -1
- files_sdk/models/file.py +2 -2
- files_sdk/models/folder.py +2 -2
- files_sdk/models/gpg_key.py +51 -24
- files_sdk/models/group.py +10 -2
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/partner.py +12 -1
- files_sdk/models/public_key.py +3 -2
- files_sdk/models/remote_server.py +141 -20
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/restore.py +20 -0
- files_sdk/models/site.py +12 -12
- files_sdk/models/sync.py +14 -0
- files_sdk/models/sync_run.py +3 -2
- files_sdk/models/user.py +26 -2
- files_sdk/models/workspace.py +202 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/WHEEL +0 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/licenses/LICENSE +0 -0
- {files_com-1.6.121.dist-info → files_com-1.6.191.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,855 @@
|
|
|
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 RemoteServerCredential:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Remote Server Credential ID
|
|
14
|
+
"workspace_id": None, # int64 - Workspace ID (0 for default workspace)
|
|
15
|
+
"name": None, # string - Internal name for your reference
|
|
16
|
+
"description": None, # string - Internal description for your reference
|
|
17
|
+
"server_type": None, # string - Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
|
|
18
|
+
"aws_access_key": None, # string - AWS Access Key.
|
|
19
|
+
"google_cloud_storage_s3_compatible_access_key": None, # string - Google Cloud Storage: S3-compatible Access Key.
|
|
20
|
+
"wasabi_access_key": None, # string - Wasabi: Access Key.
|
|
21
|
+
"azure_blob_storage_account": None, # string - Azure Blob Storage: Account name
|
|
22
|
+
"azure_files_storage_account": None, # string - Azure Files: Storage Account name
|
|
23
|
+
"s3_compatible_access_key": None, # string - S3-compatible: Access Key
|
|
24
|
+
"filebase_access_key": None, # string - Filebase: Access Key.
|
|
25
|
+
"cloudflare_access_key": None, # string - Cloudflare: Access Key.
|
|
26
|
+
"linode_access_key": None, # string - Linode: Access Key
|
|
27
|
+
"username": None, # string - Remote server username.
|
|
28
|
+
"password": None, # string - Password, if needed.
|
|
29
|
+
"private_key": None, # string - Private key, if needed.
|
|
30
|
+
"private_key_passphrase": None, # string - Passphrase for private key if needed.
|
|
31
|
+
"aws_secret_key": None, # string - AWS: secret key.
|
|
32
|
+
"azure_blob_storage_access_key": None, # string - Azure Blob Storage: Access Key
|
|
33
|
+
"azure_blob_storage_sas_token": None, # string - Azure Blob Storage: Shared Access Signature (SAS) token
|
|
34
|
+
"azure_files_storage_access_key": None, # string - Azure File Storage: Access Key
|
|
35
|
+
"azure_files_storage_sas_token": None, # string - Azure File Storage: Shared Access Signature (SAS) token
|
|
36
|
+
"backblaze_b2_application_key": None, # string - Backblaze B2 Cloud Storage: applicationKey
|
|
37
|
+
"backblaze_b2_key_id": None, # string - Backblaze B2 Cloud Storage: keyID
|
|
38
|
+
"cloudflare_secret_key": None, # string - Cloudflare: Secret Key
|
|
39
|
+
"filebase_secret_key": None, # string - Filebase: Secret Key
|
|
40
|
+
"google_cloud_storage_credentials_json": None, # string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
41
|
+
"google_cloud_storage_s3_compatible_secret_key": None, # string - Google Cloud Storage: S3-compatible secret key
|
|
42
|
+
"linode_secret_key": None, # string - Linode: Secret Key
|
|
43
|
+
"s3_compatible_secret_key": None, # string - S3-compatible: Secret Key
|
|
44
|
+
"wasabi_secret_key": None, # string - Wasabi: Secret Key
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
def __init__(self, attributes=None, options=None):
|
|
48
|
+
if not isinstance(attributes, dict):
|
|
49
|
+
attributes = {}
|
|
50
|
+
if not isinstance(options, dict):
|
|
51
|
+
options = {}
|
|
52
|
+
self.set_attributes(attributes)
|
|
53
|
+
self.options = options
|
|
54
|
+
|
|
55
|
+
def set_attributes(self, attributes):
|
|
56
|
+
for (
|
|
57
|
+
attribute,
|
|
58
|
+
default_value,
|
|
59
|
+
) in RemoteServerCredential.default_attributes.items():
|
|
60
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
61
|
+
|
|
62
|
+
def get_attributes(self):
|
|
63
|
+
return {
|
|
64
|
+
k: getattr(self, k, None)
|
|
65
|
+
for k in RemoteServerCredential.default_attributes
|
|
66
|
+
if getattr(self, k, None) is not None
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# Parameters:
|
|
70
|
+
# name - string - Internal name for your reference
|
|
71
|
+
# description - string - Internal description for your reference
|
|
72
|
+
# server_type - string - Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
|
|
73
|
+
# aws_access_key - string - AWS Access Key.
|
|
74
|
+
# azure_blob_storage_account - string - Azure Blob Storage: Account name
|
|
75
|
+
# azure_files_storage_account - string - Azure Files: Storage Account name
|
|
76
|
+
# cloudflare_access_key - string - Cloudflare: Access Key.
|
|
77
|
+
# filebase_access_key - string - Filebase: Access Key.
|
|
78
|
+
# google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
|
|
79
|
+
# linode_access_key - string - Linode: Access Key
|
|
80
|
+
# s3_compatible_access_key - string - S3-compatible: Access Key
|
|
81
|
+
# username - string - Remote server username.
|
|
82
|
+
# wasabi_access_key - string - Wasabi: Access Key.
|
|
83
|
+
# password - string - Password, if needed.
|
|
84
|
+
# private_key - string - Private key, if needed.
|
|
85
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
86
|
+
# aws_secret_key - string - AWS: secret key.
|
|
87
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
|
|
88
|
+
# azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
|
|
89
|
+
# azure_files_storage_access_key - string - Azure File Storage: Access Key
|
|
90
|
+
# azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
|
|
91
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
|
|
92
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
|
|
93
|
+
# cloudflare_secret_key - string - Cloudflare: Secret Key
|
|
94
|
+
# filebase_secret_key - string - Filebase: Secret Key
|
|
95
|
+
# google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
96
|
+
# google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
|
|
97
|
+
# linode_secret_key - string - Linode: Secret Key
|
|
98
|
+
# s3_compatible_secret_key - string - S3-compatible: Secret Key
|
|
99
|
+
# wasabi_secret_key - string - Wasabi: Secret Key
|
|
100
|
+
def update(self, params=None):
|
|
101
|
+
if not isinstance(params, dict):
|
|
102
|
+
params = {}
|
|
103
|
+
|
|
104
|
+
if hasattr(self, "id") and self.id:
|
|
105
|
+
params["id"] = self.id
|
|
106
|
+
else:
|
|
107
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
108
|
+
if "id" not in params:
|
|
109
|
+
raise MissingParameterError("Parameter missing: id")
|
|
110
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
111
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
112
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
113
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
114
|
+
if "description" in params and not isinstance(
|
|
115
|
+
params["description"], str
|
|
116
|
+
):
|
|
117
|
+
raise InvalidParameterError(
|
|
118
|
+
"Bad parameter: description must be an str"
|
|
119
|
+
)
|
|
120
|
+
if "server_type" in params and not isinstance(
|
|
121
|
+
params["server_type"], str
|
|
122
|
+
):
|
|
123
|
+
raise InvalidParameterError(
|
|
124
|
+
"Bad parameter: server_type must be an str"
|
|
125
|
+
)
|
|
126
|
+
if "aws_access_key" in params and not isinstance(
|
|
127
|
+
params["aws_access_key"], str
|
|
128
|
+
):
|
|
129
|
+
raise InvalidParameterError(
|
|
130
|
+
"Bad parameter: aws_access_key must be an str"
|
|
131
|
+
)
|
|
132
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
133
|
+
params["azure_blob_storage_account"], str
|
|
134
|
+
):
|
|
135
|
+
raise InvalidParameterError(
|
|
136
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
137
|
+
)
|
|
138
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
139
|
+
params["azure_files_storage_account"], str
|
|
140
|
+
):
|
|
141
|
+
raise InvalidParameterError(
|
|
142
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
143
|
+
)
|
|
144
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
145
|
+
params["cloudflare_access_key"], str
|
|
146
|
+
):
|
|
147
|
+
raise InvalidParameterError(
|
|
148
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
149
|
+
)
|
|
150
|
+
if "filebase_access_key" in params and not isinstance(
|
|
151
|
+
params["filebase_access_key"], str
|
|
152
|
+
):
|
|
153
|
+
raise InvalidParameterError(
|
|
154
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
155
|
+
)
|
|
156
|
+
if (
|
|
157
|
+
"google_cloud_storage_s3_compatible_access_key" in params
|
|
158
|
+
and not isinstance(
|
|
159
|
+
params["google_cloud_storage_s3_compatible_access_key"], str
|
|
160
|
+
)
|
|
161
|
+
):
|
|
162
|
+
raise InvalidParameterError(
|
|
163
|
+
"Bad parameter: google_cloud_storage_s3_compatible_access_key must be an str"
|
|
164
|
+
)
|
|
165
|
+
if "linode_access_key" in params and not isinstance(
|
|
166
|
+
params["linode_access_key"], str
|
|
167
|
+
):
|
|
168
|
+
raise InvalidParameterError(
|
|
169
|
+
"Bad parameter: linode_access_key must be an str"
|
|
170
|
+
)
|
|
171
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
172
|
+
params["s3_compatible_access_key"], str
|
|
173
|
+
):
|
|
174
|
+
raise InvalidParameterError(
|
|
175
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
176
|
+
)
|
|
177
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
178
|
+
raise InvalidParameterError(
|
|
179
|
+
"Bad parameter: username must be an str"
|
|
180
|
+
)
|
|
181
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
182
|
+
params["wasabi_access_key"], str
|
|
183
|
+
):
|
|
184
|
+
raise InvalidParameterError(
|
|
185
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
186
|
+
)
|
|
187
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
188
|
+
raise InvalidParameterError(
|
|
189
|
+
"Bad parameter: password must be an str"
|
|
190
|
+
)
|
|
191
|
+
if "private_key" in params and not isinstance(
|
|
192
|
+
params["private_key"], str
|
|
193
|
+
):
|
|
194
|
+
raise InvalidParameterError(
|
|
195
|
+
"Bad parameter: private_key must be an str"
|
|
196
|
+
)
|
|
197
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
198
|
+
params["private_key_passphrase"], str
|
|
199
|
+
):
|
|
200
|
+
raise InvalidParameterError(
|
|
201
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
202
|
+
)
|
|
203
|
+
if "aws_secret_key" in params and not isinstance(
|
|
204
|
+
params["aws_secret_key"], str
|
|
205
|
+
):
|
|
206
|
+
raise InvalidParameterError(
|
|
207
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
208
|
+
)
|
|
209
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
210
|
+
params["azure_blob_storage_access_key"], str
|
|
211
|
+
):
|
|
212
|
+
raise InvalidParameterError(
|
|
213
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
214
|
+
)
|
|
215
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
216
|
+
params["azure_blob_storage_sas_token"], str
|
|
217
|
+
):
|
|
218
|
+
raise InvalidParameterError(
|
|
219
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
220
|
+
)
|
|
221
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
222
|
+
params["azure_files_storage_access_key"], str
|
|
223
|
+
):
|
|
224
|
+
raise InvalidParameterError(
|
|
225
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
226
|
+
)
|
|
227
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
228
|
+
params["azure_files_storage_sas_token"], str
|
|
229
|
+
):
|
|
230
|
+
raise InvalidParameterError(
|
|
231
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
232
|
+
)
|
|
233
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
234
|
+
params["backblaze_b2_application_key"], str
|
|
235
|
+
):
|
|
236
|
+
raise InvalidParameterError(
|
|
237
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
238
|
+
)
|
|
239
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
240
|
+
params["backblaze_b2_key_id"], str
|
|
241
|
+
):
|
|
242
|
+
raise InvalidParameterError(
|
|
243
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
244
|
+
)
|
|
245
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
246
|
+
params["cloudflare_secret_key"], str
|
|
247
|
+
):
|
|
248
|
+
raise InvalidParameterError(
|
|
249
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
250
|
+
)
|
|
251
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
252
|
+
params["filebase_secret_key"], str
|
|
253
|
+
):
|
|
254
|
+
raise InvalidParameterError(
|
|
255
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
256
|
+
)
|
|
257
|
+
if (
|
|
258
|
+
"google_cloud_storage_credentials_json" in params
|
|
259
|
+
and not isinstance(
|
|
260
|
+
params["google_cloud_storage_credentials_json"], str
|
|
261
|
+
)
|
|
262
|
+
):
|
|
263
|
+
raise InvalidParameterError(
|
|
264
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
265
|
+
)
|
|
266
|
+
if (
|
|
267
|
+
"google_cloud_storage_s3_compatible_secret_key" in params
|
|
268
|
+
and not isinstance(
|
|
269
|
+
params["google_cloud_storage_s3_compatible_secret_key"], str
|
|
270
|
+
)
|
|
271
|
+
):
|
|
272
|
+
raise InvalidParameterError(
|
|
273
|
+
"Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an str"
|
|
274
|
+
)
|
|
275
|
+
if "linode_secret_key" in params and not isinstance(
|
|
276
|
+
params["linode_secret_key"], str
|
|
277
|
+
):
|
|
278
|
+
raise InvalidParameterError(
|
|
279
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
280
|
+
)
|
|
281
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
282
|
+
params["s3_compatible_secret_key"], str
|
|
283
|
+
):
|
|
284
|
+
raise InvalidParameterError(
|
|
285
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
286
|
+
)
|
|
287
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
288
|
+
params["wasabi_secret_key"], str
|
|
289
|
+
):
|
|
290
|
+
raise InvalidParameterError(
|
|
291
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
292
|
+
)
|
|
293
|
+
response, _options = Api.send_request(
|
|
294
|
+
"PATCH",
|
|
295
|
+
"/remote_server_credentials/{id}".format(id=params["id"]),
|
|
296
|
+
params,
|
|
297
|
+
self.options,
|
|
298
|
+
)
|
|
299
|
+
return response.data
|
|
300
|
+
|
|
301
|
+
def delete(self, params=None):
|
|
302
|
+
if not isinstance(params, dict):
|
|
303
|
+
params = {}
|
|
304
|
+
|
|
305
|
+
if hasattr(self, "id") and self.id:
|
|
306
|
+
params["id"] = self.id
|
|
307
|
+
else:
|
|
308
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
309
|
+
if "id" not in params:
|
|
310
|
+
raise MissingParameterError("Parameter missing: id")
|
|
311
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
312
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
313
|
+
Api.send_request(
|
|
314
|
+
"DELETE",
|
|
315
|
+
"/remote_server_credentials/{id}".format(id=params["id"]),
|
|
316
|
+
params,
|
|
317
|
+
self.options,
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
def destroy(self, params=None):
|
|
321
|
+
self.delete(params)
|
|
322
|
+
|
|
323
|
+
def save(self):
|
|
324
|
+
if hasattr(self, "id") and self.id:
|
|
325
|
+
new_obj = self.update(self.get_attributes())
|
|
326
|
+
self.set_attributes(new_obj.get_attributes())
|
|
327
|
+
return True
|
|
328
|
+
else:
|
|
329
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
330
|
+
self.set_attributes(new_obj.get_attributes())
|
|
331
|
+
return True
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
# Parameters:
|
|
335
|
+
# 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.
|
|
336
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
337
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `id`.
|
|
338
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id` and `name`. Valid field combinations are `[ workspace_id, name ]`.
|
|
339
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
|
|
340
|
+
def list(params=None, options=None):
|
|
341
|
+
if not isinstance(params, dict):
|
|
342
|
+
params = {}
|
|
343
|
+
if not isinstance(options, dict):
|
|
344
|
+
options = {}
|
|
345
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
346
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
347
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
348
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
349
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
350
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
351
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
352
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
353
|
+
if "filter_prefix" in params and not isinstance(
|
|
354
|
+
params["filter_prefix"], dict
|
|
355
|
+
):
|
|
356
|
+
raise InvalidParameterError(
|
|
357
|
+
"Bad parameter: filter_prefix must be an dict"
|
|
358
|
+
)
|
|
359
|
+
return ListObj(
|
|
360
|
+
RemoteServerCredential,
|
|
361
|
+
"GET",
|
|
362
|
+
"/remote_server_credentials",
|
|
363
|
+
params,
|
|
364
|
+
options,
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def all(params=None, options=None):
|
|
369
|
+
list(params, options)
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
# Parameters:
|
|
373
|
+
# id (required) - int64 - Remote Server Credential ID.
|
|
374
|
+
def find(id, params=None, options=None):
|
|
375
|
+
if not isinstance(params, dict):
|
|
376
|
+
params = {}
|
|
377
|
+
if not isinstance(options, dict):
|
|
378
|
+
options = {}
|
|
379
|
+
params["id"] = id
|
|
380
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
381
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
382
|
+
if "id" not in params:
|
|
383
|
+
raise MissingParameterError("Parameter missing: id")
|
|
384
|
+
response, options = Api.send_request(
|
|
385
|
+
"GET",
|
|
386
|
+
"/remote_server_credentials/{id}".format(id=params["id"]),
|
|
387
|
+
params,
|
|
388
|
+
options,
|
|
389
|
+
)
|
|
390
|
+
return RemoteServerCredential(response.data, options)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def get(id, params=None, options=None):
|
|
394
|
+
find(id, params, options)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
# Parameters:
|
|
398
|
+
# name - string - Internal name for your reference
|
|
399
|
+
# description - string - Internal description for your reference
|
|
400
|
+
# server_type - string - Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
|
|
401
|
+
# aws_access_key - string - AWS Access Key.
|
|
402
|
+
# azure_blob_storage_account - string - Azure Blob Storage: Account name
|
|
403
|
+
# azure_files_storage_account - string - Azure Files: Storage Account name
|
|
404
|
+
# cloudflare_access_key - string - Cloudflare: Access Key.
|
|
405
|
+
# filebase_access_key - string - Filebase: Access Key.
|
|
406
|
+
# google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
|
|
407
|
+
# linode_access_key - string - Linode: Access Key
|
|
408
|
+
# s3_compatible_access_key - string - S3-compatible: Access Key
|
|
409
|
+
# username - string - Remote server username.
|
|
410
|
+
# wasabi_access_key - string - Wasabi: Access Key.
|
|
411
|
+
# password - string - Password, if needed.
|
|
412
|
+
# private_key - string - Private key, if needed.
|
|
413
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
414
|
+
# aws_secret_key - string - AWS: secret key.
|
|
415
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
|
|
416
|
+
# azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
|
|
417
|
+
# azure_files_storage_access_key - string - Azure File Storage: Access Key
|
|
418
|
+
# azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
|
|
419
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
|
|
420
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
|
|
421
|
+
# cloudflare_secret_key - string - Cloudflare: Secret Key
|
|
422
|
+
# filebase_secret_key - string - Filebase: Secret Key
|
|
423
|
+
# google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
424
|
+
# google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
|
|
425
|
+
# linode_secret_key - string - Linode: Secret Key
|
|
426
|
+
# s3_compatible_secret_key - string - S3-compatible: Secret Key
|
|
427
|
+
# wasabi_secret_key - string - Wasabi: Secret Key
|
|
428
|
+
# workspace_id - int64 - Workspace ID (0 for default workspace)
|
|
429
|
+
def create(params=None, options=None):
|
|
430
|
+
if not isinstance(params, dict):
|
|
431
|
+
params = {}
|
|
432
|
+
if not isinstance(options, dict):
|
|
433
|
+
options = {}
|
|
434
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
435
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
436
|
+
if "description" in params and not isinstance(params["description"], str):
|
|
437
|
+
raise InvalidParameterError(
|
|
438
|
+
"Bad parameter: description must be an str"
|
|
439
|
+
)
|
|
440
|
+
if "server_type" in params and not isinstance(params["server_type"], str):
|
|
441
|
+
raise InvalidParameterError(
|
|
442
|
+
"Bad parameter: server_type must be an str"
|
|
443
|
+
)
|
|
444
|
+
if "aws_access_key" in params and not isinstance(
|
|
445
|
+
params["aws_access_key"], str
|
|
446
|
+
):
|
|
447
|
+
raise InvalidParameterError(
|
|
448
|
+
"Bad parameter: aws_access_key must be an str"
|
|
449
|
+
)
|
|
450
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
451
|
+
params["azure_blob_storage_account"], str
|
|
452
|
+
):
|
|
453
|
+
raise InvalidParameterError(
|
|
454
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
455
|
+
)
|
|
456
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
457
|
+
params["azure_files_storage_account"], str
|
|
458
|
+
):
|
|
459
|
+
raise InvalidParameterError(
|
|
460
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
461
|
+
)
|
|
462
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
463
|
+
params["cloudflare_access_key"], str
|
|
464
|
+
):
|
|
465
|
+
raise InvalidParameterError(
|
|
466
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
467
|
+
)
|
|
468
|
+
if "filebase_access_key" in params and not isinstance(
|
|
469
|
+
params["filebase_access_key"], str
|
|
470
|
+
):
|
|
471
|
+
raise InvalidParameterError(
|
|
472
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
473
|
+
)
|
|
474
|
+
if (
|
|
475
|
+
"google_cloud_storage_s3_compatible_access_key" in params
|
|
476
|
+
and not isinstance(
|
|
477
|
+
params["google_cloud_storage_s3_compatible_access_key"], str
|
|
478
|
+
)
|
|
479
|
+
):
|
|
480
|
+
raise InvalidParameterError(
|
|
481
|
+
"Bad parameter: google_cloud_storage_s3_compatible_access_key must be an str"
|
|
482
|
+
)
|
|
483
|
+
if "linode_access_key" in params and not isinstance(
|
|
484
|
+
params["linode_access_key"], str
|
|
485
|
+
):
|
|
486
|
+
raise InvalidParameterError(
|
|
487
|
+
"Bad parameter: linode_access_key must be an str"
|
|
488
|
+
)
|
|
489
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
490
|
+
params["s3_compatible_access_key"], str
|
|
491
|
+
):
|
|
492
|
+
raise InvalidParameterError(
|
|
493
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
494
|
+
)
|
|
495
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
496
|
+
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
497
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
498
|
+
params["wasabi_access_key"], str
|
|
499
|
+
):
|
|
500
|
+
raise InvalidParameterError(
|
|
501
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
502
|
+
)
|
|
503
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
504
|
+
raise InvalidParameterError("Bad parameter: password must be an str")
|
|
505
|
+
if "private_key" in params and not isinstance(params["private_key"], str):
|
|
506
|
+
raise InvalidParameterError(
|
|
507
|
+
"Bad parameter: private_key must be an str"
|
|
508
|
+
)
|
|
509
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
510
|
+
params["private_key_passphrase"], str
|
|
511
|
+
):
|
|
512
|
+
raise InvalidParameterError(
|
|
513
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
514
|
+
)
|
|
515
|
+
if "aws_secret_key" in params and not isinstance(
|
|
516
|
+
params["aws_secret_key"], str
|
|
517
|
+
):
|
|
518
|
+
raise InvalidParameterError(
|
|
519
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
520
|
+
)
|
|
521
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
522
|
+
params["azure_blob_storage_access_key"], str
|
|
523
|
+
):
|
|
524
|
+
raise InvalidParameterError(
|
|
525
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
526
|
+
)
|
|
527
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
528
|
+
params["azure_blob_storage_sas_token"], str
|
|
529
|
+
):
|
|
530
|
+
raise InvalidParameterError(
|
|
531
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
532
|
+
)
|
|
533
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
534
|
+
params["azure_files_storage_access_key"], str
|
|
535
|
+
):
|
|
536
|
+
raise InvalidParameterError(
|
|
537
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
538
|
+
)
|
|
539
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
540
|
+
params["azure_files_storage_sas_token"], str
|
|
541
|
+
):
|
|
542
|
+
raise InvalidParameterError(
|
|
543
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
544
|
+
)
|
|
545
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
546
|
+
params["backblaze_b2_application_key"], str
|
|
547
|
+
):
|
|
548
|
+
raise InvalidParameterError(
|
|
549
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
550
|
+
)
|
|
551
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
552
|
+
params["backblaze_b2_key_id"], str
|
|
553
|
+
):
|
|
554
|
+
raise InvalidParameterError(
|
|
555
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
556
|
+
)
|
|
557
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
558
|
+
params["cloudflare_secret_key"], str
|
|
559
|
+
):
|
|
560
|
+
raise InvalidParameterError(
|
|
561
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
562
|
+
)
|
|
563
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
564
|
+
params["filebase_secret_key"], str
|
|
565
|
+
):
|
|
566
|
+
raise InvalidParameterError(
|
|
567
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
568
|
+
)
|
|
569
|
+
if "google_cloud_storage_credentials_json" in params and not isinstance(
|
|
570
|
+
params["google_cloud_storage_credentials_json"], str
|
|
571
|
+
):
|
|
572
|
+
raise InvalidParameterError(
|
|
573
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
574
|
+
)
|
|
575
|
+
if (
|
|
576
|
+
"google_cloud_storage_s3_compatible_secret_key" in params
|
|
577
|
+
and not isinstance(
|
|
578
|
+
params["google_cloud_storage_s3_compatible_secret_key"], str
|
|
579
|
+
)
|
|
580
|
+
):
|
|
581
|
+
raise InvalidParameterError(
|
|
582
|
+
"Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an str"
|
|
583
|
+
)
|
|
584
|
+
if "linode_secret_key" in params and not isinstance(
|
|
585
|
+
params["linode_secret_key"], str
|
|
586
|
+
):
|
|
587
|
+
raise InvalidParameterError(
|
|
588
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
589
|
+
)
|
|
590
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
591
|
+
params["s3_compatible_secret_key"], str
|
|
592
|
+
):
|
|
593
|
+
raise InvalidParameterError(
|
|
594
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
595
|
+
)
|
|
596
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
597
|
+
params["wasabi_secret_key"], str
|
|
598
|
+
):
|
|
599
|
+
raise InvalidParameterError(
|
|
600
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
601
|
+
)
|
|
602
|
+
if "workspace_id" in params and not isinstance(
|
|
603
|
+
params["workspace_id"], int
|
|
604
|
+
):
|
|
605
|
+
raise InvalidParameterError(
|
|
606
|
+
"Bad parameter: workspace_id must be an int"
|
|
607
|
+
)
|
|
608
|
+
response, options = Api.send_request(
|
|
609
|
+
"POST", "/remote_server_credentials", params, options
|
|
610
|
+
)
|
|
611
|
+
return RemoteServerCredential(response.data, options)
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
# Parameters:
|
|
615
|
+
# name - string - Internal name for your reference
|
|
616
|
+
# description - string - Internal description for your reference
|
|
617
|
+
# server_type - string - Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
|
|
618
|
+
# aws_access_key - string - AWS Access Key.
|
|
619
|
+
# azure_blob_storage_account - string - Azure Blob Storage: Account name
|
|
620
|
+
# azure_files_storage_account - string - Azure Files: Storage Account name
|
|
621
|
+
# cloudflare_access_key - string - Cloudflare: Access Key.
|
|
622
|
+
# filebase_access_key - string - Filebase: Access Key.
|
|
623
|
+
# google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
|
|
624
|
+
# linode_access_key - string - Linode: Access Key
|
|
625
|
+
# s3_compatible_access_key - string - S3-compatible: Access Key
|
|
626
|
+
# username - string - Remote server username.
|
|
627
|
+
# wasabi_access_key - string - Wasabi: Access Key.
|
|
628
|
+
# password - string - Password, if needed.
|
|
629
|
+
# private_key - string - Private key, if needed.
|
|
630
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
631
|
+
# aws_secret_key - string - AWS: secret key.
|
|
632
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
|
|
633
|
+
# azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
|
|
634
|
+
# azure_files_storage_access_key - string - Azure File Storage: Access Key
|
|
635
|
+
# azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
|
|
636
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
|
|
637
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
|
|
638
|
+
# cloudflare_secret_key - string - Cloudflare: Secret Key
|
|
639
|
+
# filebase_secret_key - string - Filebase: Secret Key
|
|
640
|
+
# google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
641
|
+
# google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
|
|
642
|
+
# linode_secret_key - string - Linode: Secret Key
|
|
643
|
+
# s3_compatible_secret_key - string - S3-compatible: Secret Key
|
|
644
|
+
# wasabi_secret_key - string - Wasabi: Secret Key
|
|
645
|
+
def update(id, params=None, options=None):
|
|
646
|
+
if not isinstance(params, dict):
|
|
647
|
+
params = {}
|
|
648
|
+
if not isinstance(options, dict):
|
|
649
|
+
options = {}
|
|
650
|
+
params["id"] = id
|
|
651
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
652
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
653
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
654
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
655
|
+
if "description" in params and not isinstance(params["description"], str):
|
|
656
|
+
raise InvalidParameterError(
|
|
657
|
+
"Bad parameter: description must be an str"
|
|
658
|
+
)
|
|
659
|
+
if "server_type" in params and not isinstance(params["server_type"], str):
|
|
660
|
+
raise InvalidParameterError(
|
|
661
|
+
"Bad parameter: server_type must be an str"
|
|
662
|
+
)
|
|
663
|
+
if "aws_access_key" in params and not isinstance(
|
|
664
|
+
params["aws_access_key"], str
|
|
665
|
+
):
|
|
666
|
+
raise InvalidParameterError(
|
|
667
|
+
"Bad parameter: aws_access_key must be an str"
|
|
668
|
+
)
|
|
669
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
670
|
+
params["azure_blob_storage_account"], str
|
|
671
|
+
):
|
|
672
|
+
raise InvalidParameterError(
|
|
673
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
674
|
+
)
|
|
675
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
676
|
+
params["azure_files_storage_account"], str
|
|
677
|
+
):
|
|
678
|
+
raise InvalidParameterError(
|
|
679
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
680
|
+
)
|
|
681
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
682
|
+
params["cloudflare_access_key"], str
|
|
683
|
+
):
|
|
684
|
+
raise InvalidParameterError(
|
|
685
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
686
|
+
)
|
|
687
|
+
if "filebase_access_key" in params and not isinstance(
|
|
688
|
+
params["filebase_access_key"], str
|
|
689
|
+
):
|
|
690
|
+
raise InvalidParameterError(
|
|
691
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
692
|
+
)
|
|
693
|
+
if (
|
|
694
|
+
"google_cloud_storage_s3_compatible_access_key" in params
|
|
695
|
+
and not isinstance(
|
|
696
|
+
params["google_cloud_storage_s3_compatible_access_key"], str
|
|
697
|
+
)
|
|
698
|
+
):
|
|
699
|
+
raise InvalidParameterError(
|
|
700
|
+
"Bad parameter: google_cloud_storage_s3_compatible_access_key must be an str"
|
|
701
|
+
)
|
|
702
|
+
if "linode_access_key" in params and not isinstance(
|
|
703
|
+
params["linode_access_key"], str
|
|
704
|
+
):
|
|
705
|
+
raise InvalidParameterError(
|
|
706
|
+
"Bad parameter: linode_access_key must be an str"
|
|
707
|
+
)
|
|
708
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
709
|
+
params["s3_compatible_access_key"], str
|
|
710
|
+
):
|
|
711
|
+
raise InvalidParameterError(
|
|
712
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
713
|
+
)
|
|
714
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
715
|
+
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
716
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
717
|
+
params["wasabi_access_key"], str
|
|
718
|
+
):
|
|
719
|
+
raise InvalidParameterError(
|
|
720
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
721
|
+
)
|
|
722
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
723
|
+
raise InvalidParameterError("Bad parameter: password must be an str")
|
|
724
|
+
if "private_key" in params and not isinstance(params["private_key"], str):
|
|
725
|
+
raise InvalidParameterError(
|
|
726
|
+
"Bad parameter: private_key must be an str"
|
|
727
|
+
)
|
|
728
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
729
|
+
params["private_key_passphrase"], str
|
|
730
|
+
):
|
|
731
|
+
raise InvalidParameterError(
|
|
732
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
733
|
+
)
|
|
734
|
+
if "aws_secret_key" in params and not isinstance(
|
|
735
|
+
params["aws_secret_key"], str
|
|
736
|
+
):
|
|
737
|
+
raise InvalidParameterError(
|
|
738
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
739
|
+
)
|
|
740
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
741
|
+
params["azure_blob_storage_access_key"], str
|
|
742
|
+
):
|
|
743
|
+
raise InvalidParameterError(
|
|
744
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
745
|
+
)
|
|
746
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
747
|
+
params["azure_blob_storage_sas_token"], str
|
|
748
|
+
):
|
|
749
|
+
raise InvalidParameterError(
|
|
750
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
751
|
+
)
|
|
752
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
753
|
+
params["azure_files_storage_access_key"], str
|
|
754
|
+
):
|
|
755
|
+
raise InvalidParameterError(
|
|
756
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
757
|
+
)
|
|
758
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
759
|
+
params["azure_files_storage_sas_token"], str
|
|
760
|
+
):
|
|
761
|
+
raise InvalidParameterError(
|
|
762
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
763
|
+
)
|
|
764
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
765
|
+
params["backblaze_b2_application_key"], str
|
|
766
|
+
):
|
|
767
|
+
raise InvalidParameterError(
|
|
768
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
769
|
+
)
|
|
770
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
771
|
+
params["backblaze_b2_key_id"], str
|
|
772
|
+
):
|
|
773
|
+
raise InvalidParameterError(
|
|
774
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
775
|
+
)
|
|
776
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
777
|
+
params["cloudflare_secret_key"], str
|
|
778
|
+
):
|
|
779
|
+
raise InvalidParameterError(
|
|
780
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
781
|
+
)
|
|
782
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
783
|
+
params["filebase_secret_key"], str
|
|
784
|
+
):
|
|
785
|
+
raise InvalidParameterError(
|
|
786
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
787
|
+
)
|
|
788
|
+
if "google_cloud_storage_credentials_json" in params and not isinstance(
|
|
789
|
+
params["google_cloud_storage_credentials_json"], str
|
|
790
|
+
):
|
|
791
|
+
raise InvalidParameterError(
|
|
792
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
793
|
+
)
|
|
794
|
+
if (
|
|
795
|
+
"google_cloud_storage_s3_compatible_secret_key" in params
|
|
796
|
+
and not isinstance(
|
|
797
|
+
params["google_cloud_storage_s3_compatible_secret_key"], str
|
|
798
|
+
)
|
|
799
|
+
):
|
|
800
|
+
raise InvalidParameterError(
|
|
801
|
+
"Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an str"
|
|
802
|
+
)
|
|
803
|
+
if "linode_secret_key" in params and not isinstance(
|
|
804
|
+
params["linode_secret_key"], str
|
|
805
|
+
):
|
|
806
|
+
raise InvalidParameterError(
|
|
807
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
808
|
+
)
|
|
809
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
810
|
+
params["s3_compatible_secret_key"], str
|
|
811
|
+
):
|
|
812
|
+
raise InvalidParameterError(
|
|
813
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
814
|
+
)
|
|
815
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
816
|
+
params["wasabi_secret_key"], str
|
|
817
|
+
):
|
|
818
|
+
raise InvalidParameterError(
|
|
819
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
820
|
+
)
|
|
821
|
+
if "id" not in params:
|
|
822
|
+
raise MissingParameterError("Parameter missing: id")
|
|
823
|
+
response, options = Api.send_request(
|
|
824
|
+
"PATCH",
|
|
825
|
+
"/remote_server_credentials/{id}".format(id=params["id"]),
|
|
826
|
+
params,
|
|
827
|
+
options,
|
|
828
|
+
)
|
|
829
|
+
return RemoteServerCredential(response.data, options)
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
def delete(id, params=None, options=None):
|
|
833
|
+
if not isinstance(params, dict):
|
|
834
|
+
params = {}
|
|
835
|
+
if not isinstance(options, dict):
|
|
836
|
+
options = {}
|
|
837
|
+
params["id"] = id
|
|
838
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
839
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
840
|
+
if "id" not in params:
|
|
841
|
+
raise MissingParameterError("Parameter missing: id")
|
|
842
|
+
Api.send_request(
|
|
843
|
+
"DELETE",
|
|
844
|
+
"/remote_server_credentials/{id}".format(id=params["id"]),
|
|
845
|
+
params,
|
|
846
|
+
options,
|
|
847
|
+
)
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
def destroy(id, params=None, options=None):
|
|
851
|
+
delete(id, params, options)
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
def new(*args, **kwargs):
|
|
855
|
+
return RemoteServerCredential(*args, **kwargs)
|