files-com 1.6.208__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of files-com might be problematic. Click here for more details.
- README.md +758 -0
- _VERSION +1 -0
- files_com-1.6.208.dist-info/METADATA +770 -0
- files_com-1.6.208.dist-info/RECORD +126 -0
- files_com-1.6.208.dist-info/WHEEL +5 -0
- files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
- files_com-1.6.208.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +309 -0
- files_sdk/api.py +63 -0
- files_sdk/api_client.py +336 -0
- files_sdk/error.py +2981 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +119 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +153 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +318 -0
- files_sdk/models/api_request_log.py +105 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +117 -0
- files_sdk/models/as2_outgoing_message.py +113 -0
- files_sdk/models/as2_partner.py +415 -0
- files_sdk/models/as2_station.py +282 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +823 -0
- files_sdk/models/automation_log.py +94 -0
- files_sdk/models/automation_run.py +112 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +340 -0
- files_sdk/models/bundle.py +686 -0
- files_sdk/models/bundle_action.py +93 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +252 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +133 -0
- files_sdk/models/bundle_registration.py +82 -0
- files_sdk/models/child_site_management_policy.py +278 -0
- files_sdk/models/clickwrap.py +268 -0
- files_sdk/models/dns_record.py +59 -0
- files_sdk/models/email_incoming_message.py +102 -0
- files_sdk/models/email_log.py +84 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +102 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +851 -0
- files_sdk/models/file_action.py +39 -0
- files_sdk/models/file_comment.py +191 -0
- files_sdk/models/file_comment_reaction.py +125 -0
- files_sdk/models/file_migration.py +69 -0
- files_sdk/models/file_migration_log.py +88 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +186 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +265 -0
- files_sdk/models/ftp_action_log.py +104 -0
- files_sdk/models/gpg_key.py +333 -0
- files_sdk/models/group.py +338 -0
- files_sdk/models/group_user.py +235 -0
- files_sdk/models/history.py +236 -0
- files_sdk/models/history_export.py +238 -0
- files_sdk/models/history_export_result.py +98 -0
- files_sdk/models/holiday_region.py +58 -0
- files_sdk/models/image.py +37 -0
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/inbox_recipient.py +124 -0
- files_sdk/models/inbox_registration.py +79 -0
- files_sdk/models/inbox_upload.py +80 -0
- files_sdk/models/invoice.py +91 -0
- files_sdk/models/invoice_line_item.py +51 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/lock.py +174 -0
- files_sdk/models/message.py +244 -0
- files_sdk/models/message_comment.py +223 -0
- files_sdk/models/message_comment_reaction.py +181 -0
- files_sdk/models/message_reaction.py +170 -0
- files_sdk/models/notification.py +451 -0
- files_sdk/models/outbound_connection_log.py +105 -0
- files_sdk/models/partner.py +307 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +190 -0
- files_sdk/models/preview.py +40 -0
- files_sdk/models/priority.py +63 -0
- files_sdk/models/project.py +205 -0
- files_sdk/models/public_hosting_request_log.py +101 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +269 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_mount_backend.py +438 -0
- files_sdk/models/remote_server.py +1854 -0
- files_sdk/models/remote_server_configuration_file.py +73 -0
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/request.py +184 -0
- files_sdk/models/restore.py +142 -0
- files_sdk/models/scim_log.py +88 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +108 -0
- files_sdk/models/sftp_host_key.py +215 -0
- files_sdk/models/share_group.py +228 -0
- files_sdk/models/share_group_member.py +41 -0
- files_sdk/models/siem_http_destination.py +1074 -0
- files_sdk/models/site.py +1289 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +168 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync.py +588 -0
- files_sdk/models/sync_log.py +86 -0
- files_sdk/models/sync_run.py +124 -0
- files_sdk/models/usage_by_top_level_dir.py +41 -0
- files_sdk/models/usage_daily_snapshot.py +93 -0
- files_sdk/models/usage_snapshot.py +73 -0
- files_sdk/models/user.py +1232 -0
- files_sdk/models/user_cipher_use.py +91 -0
- files_sdk/models/user_lifecycle_rule.py +355 -0
- files_sdk/models/user_request.py +166 -0
- files_sdk/models/user_sftp_client_use.py +68 -0
- files_sdk/models/web_dav_action_log.py +104 -0
- files_sdk/models/webhook_test.py +116 -0
- files_sdk/models/workspace.py +202 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,269 @@
|
|
|
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 PublicKey:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Public key ID
|
|
14
|
+
"workspace_id": None, # int64 - Workspace ID (0 for default workspace).
|
|
15
|
+
"title": None, # string - Public key title
|
|
16
|
+
"created_at": None, # date-time - Public key created at date/time
|
|
17
|
+
"fingerprint": None, # string - Public key fingerprint (MD5)
|
|
18
|
+
"fingerprint_sha256": None, # string - Public key fingerprint (SHA256)
|
|
19
|
+
"status": None, # string - Only returned when generating keys. Can be invalid, not_generated, generating, complete
|
|
20
|
+
"last_login_at": None, # date-time - Key's most recent login time via SFTP
|
|
21
|
+
"generated_private_key": None, # string - Only returned when generating keys. Private key generated for the user.
|
|
22
|
+
"generated_public_key": None, # string - Only returned when generating keys. Public key generated for the user.
|
|
23
|
+
"username": None, # string - Username of the user this public key is associated with
|
|
24
|
+
"user_id": None, # int64 - User ID this public key is associated with
|
|
25
|
+
"public_key": None, # string - Actual contents of SSH key.
|
|
26
|
+
"generate_keypair": None, # boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
27
|
+
"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.
|
|
28
|
+
"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.
|
|
29
|
+
"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.
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def __init__(self, attributes=None, options=None):
|
|
33
|
+
if not isinstance(attributes, dict):
|
|
34
|
+
attributes = {}
|
|
35
|
+
if not isinstance(options, dict):
|
|
36
|
+
options = {}
|
|
37
|
+
self.set_attributes(attributes)
|
|
38
|
+
self.options = options
|
|
39
|
+
|
|
40
|
+
def set_attributes(self, attributes):
|
|
41
|
+
for attribute, default_value in PublicKey.default_attributes.items():
|
|
42
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
43
|
+
|
|
44
|
+
def get_attributes(self):
|
|
45
|
+
return {
|
|
46
|
+
k: getattr(self, k, None)
|
|
47
|
+
for k in PublicKey.default_attributes
|
|
48
|
+
if getattr(self, k, None) is not None
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
# Parameters:
|
|
52
|
+
# title (required) - string - Internal reference for key.
|
|
53
|
+
def update(self, params=None):
|
|
54
|
+
if not isinstance(params, dict):
|
|
55
|
+
params = {}
|
|
56
|
+
|
|
57
|
+
if hasattr(self, "id") and self.id:
|
|
58
|
+
params["id"] = self.id
|
|
59
|
+
else:
|
|
60
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
61
|
+
if "id" not in params:
|
|
62
|
+
raise MissingParameterError("Parameter missing: id")
|
|
63
|
+
if "title" not in params:
|
|
64
|
+
raise MissingParameterError("Parameter missing: title")
|
|
65
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
66
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
67
|
+
if "title" in params and not isinstance(params["title"], str):
|
|
68
|
+
raise InvalidParameterError("Bad parameter: title must be an str")
|
|
69
|
+
response, _options = Api.send_request(
|
|
70
|
+
"PATCH",
|
|
71
|
+
"/public_keys/{id}".format(id=params["id"]),
|
|
72
|
+
params,
|
|
73
|
+
self.options,
|
|
74
|
+
)
|
|
75
|
+
return response.data
|
|
76
|
+
|
|
77
|
+
def delete(self, params=None):
|
|
78
|
+
if not isinstance(params, dict):
|
|
79
|
+
params = {}
|
|
80
|
+
|
|
81
|
+
if hasattr(self, "id") and self.id:
|
|
82
|
+
params["id"] = self.id
|
|
83
|
+
else:
|
|
84
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
85
|
+
if "id" not in params:
|
|
86
|
+
raise MissingParameterError("Parameter missing: id")
|
|
87
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
88
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
89
|
+
Api.send_request(
|
|
90
|
+
"DELETE",
|
|
91
|
+
"/public_keys/{id}".format(id=params["id"]),
|
|
92
|
+
params,
|
|
93
|
+
self.options,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def destroy(self, params=None):
|
|
97
|
+
self.delete(params)
|
|
98
|
+
|
|
99
|
+
def save(self):
|
|
100
|
+
if hasattr(self, "id") and self.id:
|
|
101
|
+
new_obj = self.update(self.get_attributes())
|
|
102
|
+
self.set_attributes(new_obj.get_attributes())
|
|
103
|
+
return True
|
|
104
|
+
else:
|
|
105
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
106
|
+
self.set_attributes(new_obj.get_attributes())
|
|
107
|
+
return True
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# Parameters:
|
|
111
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
112
|
+
# 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.
|
|
113
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
114
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `user_id`, `title` or `created_at`.
|
|
115
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at` and `workspace_id`.
|
|
116
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
117
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
118
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
|
119
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
|
120
|
+
def list(params=None, options=None):
|
|
121
|
+
if not isinstance(params, dict):
|
|
122
|
+
params = {}
|
|
123
|
+
if not isinstance(options, dict):
|
|
124
|
+
options = {}
|
|
125
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
126
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
127
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
128
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
129
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
130
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
131
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
132
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
133
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
134
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
135
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
136
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
137
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
138
|
+
raise InvalidParameterError(
|
|
139
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
140
|
+
)
|
|
141
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
142
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
143
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
144
|
+
raise InvalidParameterError(
|
|
145
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
146
|
+
)
|
|
147
|
+
return ListObj(PublicKey, "GET", "/public_keys", params, options)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def all(params=None, options=None):
|
|
151
|
+
list(params, options)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# Parameters:
|
|
155
|
+
# id (required) - int64 - Public Key ID.
|
|
156
|
+
def find(id, params=None, options=None):
|
|
157
|
+
if not isinstance(params, dict):
|
|
158
|
+
params = {}
|
|
159
|
+
if not isinstance(options, dict):
|
|
160
|
+
options = {}
|
|
161
|
+
params["id"] = id
|
|
162
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
163
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
164
|
+
if "id" not in params:
|
|
165
|
+
raise MissingParameterError("Parameter missing: id")
|
|
166
|
+
response, options = Api.send_request(
|
|
167
|
+
"GET", "/public_keys/{id}".format(id=params["id"]), params, options
|
|
168
|
+
)
|
|
169
|
+
return PublicKey(response.data, options)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def get(id, params=None, options=None):
|
|
173
|
+
find(id, params, options)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
# Parameters:
|
|
177
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
178
|
+
# title (required) - string - Internal reference for key.
|
|
179
|
+
# public_key - string - Actual contents of SSH key.
|
|
180
|
+
# generate_keypair - boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
181
|
+
# 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.
|
|
182
|
+
# 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.
|
|
183
|
+
# 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.
|
|
184
|
+
def create(params=None, options=None):
|
|
185
|
+
if not isinstance(params, dict):
|
|
186
|
+
params = {}
|
|
187
|
+
if not isinstance(options, dict):
|
|
188
|
+
options = {}
|
|
189
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
190
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
191
|
+
if "title" in params and not isinstance(params["title"], str):
|
|
192
|
+
raise InvalidParameterError("Bad parameter: title must be an str")
|
|
193
|
+
if "public_key" in params and not isinstance(params["public_key"], str):
|
|
194
|
+
raise InvalidParameterError("Bad parameter: public_key must be an str")
|
|
195
|
+
if "generate_keypair" in params and not isinstance(
|
|
196
|
+
params["generate_keypair"], bool
|
|
197
|
+
):
|
|
198
|
+
raise InvalidParameterError(
|
|
199
|
+
"Bad parameter: generate_keypair must be an bool"
|
|
200
|
+
)
|
|
201
|
+
if "generate_private_key_password" in params and not isinstance(
|
|
202
|
+
params["generate_private_key_password"], str
|
|
203
|
+
):
|
|
204
|
+
raise InvalidParameterError(
|
|
205
|
+
"Bad parameter: generate_private_key_password must be an str"
|
|
206
|
+
)
|
|
207
|
+
if "generate_algorithm" in params and not isinstance(
|
|
208
|
+
params["generate_algorithm"], str
|
|
209
|
+
):
|
|
210
|
+
raise InvalidParameterError(
|
|
211
|
+
"Bad parameter: generate_algorithm must be an str"
|
|
212
|
+
)
|
|
213
|
+
if "generate_length" in params and not isinstance(
|
|
214
|
+
params["generate_length"], int
|
|
215
|
+
):
|
|
216
|
+
raise InvalidParameterError(
|
|
217
|
+
"Bad parameter: generate_length must be an int"
|
|
218
|
+
)
|
|
219
|
+
if "title" not in params:
|
|
220
|
+
raise MissingParameterError("Parameter missing: title")
|
|
221
|
+
response, options = Api.send_request(
|
|
222
|
+
"POST", "/public_keys", params, options
|
|
223
|
+
)
|
|
224
|
+
return PublicKey(response.data, options)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
# Parameters:
|
|
228
|
+
# title (required) - string - Internal reference for key.
|
|
229
|
+
def update(id, params=None, options=None):
|
|
230
|
+
if not isinstance(params, dict):
|
|
231
|
+
params = {}
|
|
232
|
+
if not isinstance(options, dict):
|
|
233
|
+
options = {}
|
|
234
|
+
params["id"] = id
|
|
235
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
236
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
237
|
+
if "title" in params and not isinstance(params["title"], str):
|
|
238
|
+
raise InvalidParameterError("Bad parameter: title must be an str")
|
|
239
|
+
if "id" not in params:
|
|
240
|
+
raise MissingParameterError("Parameter missing: id")
|
|
241
|
+
if "title" not in params:
|
|
242
|
+
raise MissingParameterError("Parameter missing: title")
|
|
243
|
+
response, options = Api.send_request(
|
|
244
|
+
"PATCH", "/public_keys/{id}".format(id=params["id"]), params, options
|
|
245
|
+
)
|
|
246
|
+
return PublicKey(response.data, options)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def delete(id, params=None, options=None):
|
|
250
|
+
if not isinstance(params, dict):
|
|
251
|
+
params = {}
|
|
252
|
+
if not isinstance(options, dict):
|
|
253
|
+
options = {}
|
|
254
|
+
params["id"] = id
|
|
255
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
256
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
257
|
+
if "id" not in params:
|
|
258
|
+
raise MissingParameterError("Parameter missing: id")
|
|
259
|
+
Api.send_request(
|
|
260
|
+
"DELETE", "/public_keys/{id}".format(id=params["id"]), params, options
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def destroy(id, params=None, options=None):
|
|
265
|
+
delete(id, params, options)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def new(*args, **kwargs):
|
|
269
|
+
return PublicKey(*args, **kwargs)
|
|
@@ -0,0 +1,91 @@
|
|
|
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 RemoteBandwidthSnapshot:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Site bandwidth ID
|
|
14
|
+
"sync_bytes_received": None, # double - Site sync bandwidth report bytes received
|
|
15
|
+
"sync_bytes_sent": None, # double - Site sync bandwidth report bytes sent
|
|
16
|
+
"logged_at": None, # date-time - Time the site bandwidth report was logged
|
|
17
|
+
"remote_server_id": None, # int64 - ID of related Remote Server
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
def __init__(self, attributes=None, options=None):
|
|
21
|
+
if not isinstance(attributes, dict):
|
|
22
|
+
attributes = {}
|
|
23
|
+
if not isinstance(options, dict):
|
|
24
|
+
options = {}
|
|
25
|
+
self.set_attributes(attributes)
|
|
26
|
+
self.options = options
|
|
27
|
+
|
|
28
|
+
def set_attributes(self, attributes):
|
|
29
|
+
for (
|
|
30
|
+
attribute,
|
|
31
|
+
default_value,
|
|
32
|
+
) in RemoteBandwidthSnapshot.default_attributes.items():
|
|
33
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
34
|
+
|
|
35
|
+
def get_attributes(self):
|
|
36
|
+
return {
|
|
37
|
+
k: getattr(self, k, None)
|
|
38
|
+
for k in RemoteBandwidthSnapshot.default_attributes
|
|
39
|
+
if getattr(self, k, None) is not None
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Parameters:
|
|
44
|
+
# 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.
|
|
45
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
46
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`.
|
|
47
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`.
|
|
48
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`.
|
|
49
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`.
|
|
50
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`.
|
|
51
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`.
|
|
52
|
+
def list(params=None, options=None):
|
|
53
|
+
if not isinstance(params, dict):
|
|
54
|
+
params = {}
|
|
55
|
+
if not isinstance(options, dict):
|
|
56
|
+
options = {}
|
|
57
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
58
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
59
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
60
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
61
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
62
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
63
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
64
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
65
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
66
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
67
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
68
|
+
raise InvalidParameterError(
|
|
69
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
70
|
+
)
|
|
71
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
72
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
73
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
74
|
+
raise InvalidParameterError(
|
|
75
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
76
|
+
)
|
|
77
|
+
return ListObj(
|
|
78
|
+
RemoteBandwidthSnapshot,
|
|
79
|
+
"GET",
|
|
80
|
+
"/remote_bandwidth_snapshots",
|
|
81
|
+
params,
|
|
82
|
+
options,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def all(params=None, options=None):
|
|
87
|
+
list(params, options)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def new(*args, **kwargs):
|
|
91
|
+
return RemoteBandwidthSnapshot(*args, **kwargs)
|