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