latitudesh-python-sdk 1.1.0__py3-none-any.whl → 2.0.1__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 latitudesh-python-sdk might be problematic. Click here for more details.
- latitudesh_python_sdk/_hooks/types.py +7 -0
- latitudesh_python_sdk/_version.py +6 -4
- latitudesh_python_sdk/apikeys.py +73 -156
- latitudesh_python_sdk/basesdk.py +16 -24
- latitudesh_python_sdk/billing.py +13 -32
- latitudesh_python_sdk/events_sdk.py +11 -34
- latitudesh_python_sdk/firewalls_sdk.py +105 -264
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +29 -68
- latitudesh_python_sdk/models/__init__.py +2586 -1126
- latitudesh_python_sdk/models/apierror.py +30 -14
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
- latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
- latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
- latitudesh_python_sdk/models/custom_tag.py +15 -0
- latitudesh_python_sdk/models/custom_tag_data.py +54 -0
- latitudesh_python_sdk/models/custom_tags.py +26 -0
- latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
- latitudesh_python_sdk/models/deploy_config.py +11 -6
- latitudesh_python_sdk/models/error_object.py +11 -6
- latitudesh_python_sdk/models/event_data.py +98 -0
- latitudesh_python_sdk/models/events.py +16 -1
- latitudesh_python_sdk/models/filesystem_data.py +4 -0
- latitudesh_python_sdk/models/firewall.py +15 -0
- latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
- latitudesh_python_sdk/models/firewall_assignments.py +29 -0
- latitudesh_python_sdk/models/firewall_data.py +71 -0
- latitudesh_python_sdk/models/firewall_server.py +4 -1
- latitudesh_python_sdk/models/firewalls.py +7 -7
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +3 -3
- latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
- latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
- latitudesh_python_sdk/models/get_user_dataop.py +31 -0
- latitudesh_python_sdk/models/get_users_dataop.py +35 -0
- latitudesh_python_sdk/models/latitudesherror.py +26 -0
- latitudesh_python_sdk/models/no_response_error.py +13 -0
- latitudesh_python_sdk/models/operating_system_data.py +65 -0
- latitudesh_python_sdk/models/operating_systems.py +15 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
- latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
- latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
- latitudesh_python_sdk/models/post_user_dataop.py +45 -0
- latitudesh_python_sdk/models/project_include.py +3 -0
- latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
- latitudesh_python_sdk/models/region_resource_data.py +4 -4
- latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
- latitudesh_python_sdk/models/role.py +11 -0
- latitudesh_python_sdk/models/server.py +11 -6
- latitudesh_python_sdk/models/server_data.py +14 -3
- latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
- latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
- latitudesh_python_sdk/models/storage_plan_data.py +47 -0
- latitudesh_python_sdk/models/storage_plans.py +14 -3
- latitudesh_python_sdk/models/update_serverop.py +58 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +30 -6
- latitudesh_python_sdk/models/virtual_network1.py +15 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
- latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
- latitudesh_python_sdk/models/virtual_network_data.py +88 -0
- latitudesh_python_sdk/models/virtual_networks.py +3 -3
- latitudesh_python_sdk/operatingsystems_sdk.py +13 -32
- latitudesh_python_sdk/plans.py +99 -214
- latitudesh_python_sdk/privatenetworks.py +131 -290
- latitudesh_python_sdk/projects_sdk.py +79 -158
- latitudesh_python_sdk/regions_sdk.py +25 -66
- latitudesh_python_sdk/roles.py +25 -64
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +305 -646
- latitudesh_python_sdk/sshkeys_sdk.py +1856 -0
- latitudesh_python_sdk/storage.py +41 -120
- latitudesh_python_sdk/tags.py +67 -146
- latitudesh_python_sdk/teams_sdk.py +41 -100
- latitudesh_python_sdk/teamsmembers.py +37 -96
- latitudesh_python_sdk/traffic_sdk.py +37 -76
- latitudesh_python_sdk/userdata_sdk.py +959 -149
- latitudesh_python_sdk/userprofile.py +37 -100
- latitudesh_python_sdk/utils/__init__.py +131 -46
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/utils/serializers.py +3 -2
- latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
- latitudesh_python_sdk/virtualmachines.py +71 -140
- latitudesh_python_sdk/vpnsessions.py +93 -172
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +76 -43
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +91 -67
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- latitudesh_python_sdk/sshkeys.py +0 -1050
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
latitudesh_python_sdk/tags.py
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
4
|
from latitudesh_python_sdk import models, utils
|
|
5
5
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
|
-
from latitudesh_python_sdk.types import
|
|
6
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
-
from
|
|
8
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Tags(BaseSDK):
|
|
@@ -16,7 +17,7 @@ class Tags(BaseSDK):
|
|
|
16
17
|
server_url: Optional[str] = None,
|
|
17
18
|
timeout_ms: Optional[int] = None,
|
|
18
19
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
19
|
-
) -> models.
|
|
20
|
+
) -> models.CustomTags:
|
|
20
21
|
r"""List all Tags
|
|
21
22
|
|
|
22
23
|
List all Tags in the team.
|
|
@@ -62,6 +63,7 @@ class Tags(BaseSDK):
|
|
|
62
63
|
|
|
63
64
|
http_res = self.do_request(
|
|
64
65
|
hook_ctx=HookContext(
|
|
66
|
+
config=self.sdk_configuration,
|
|
65
67
|
base_url=base_url or "",
|
|
66
68
|
operation_id="get-tags",
|
|
67
69
|
oauth2_scopes=[],
|
|
@@ -75,26 +77,15 @@ class Tags(BaseSDK):
|
|
|
75
77
|
)
|
|
76
78
|
|
|
77
79
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
78
|
-
return
|
|
80
|
+
return unmarshal_json_response(models.CustomTags, http_res)
|
|
79
81
|
if utils.match_response(http_res, "4XX", "*"):
|
|
80
82
|
http_res_text = utils.stream_to_text(http_res)
|
|
81
|
-
raise models.APIError(
|
|
82
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
83
|
-
)
|
|
83
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
84
84
|
if utils.match_response(http_res, "5XX", "*"):
|
|
85
85
|
http_res_text = utils.stream_to_text(http_res)
|
|
86
|
-
raise models.APIError(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
content_type = http_res.headers.get("Content-Type")
|
|
91
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
92
|
-
raise models.APIError(
|
|
93
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
94
|
-
http_res.status_code,
|
|
95
|
-
http_res_text,
|
|
96
|
-
http_res,
|
|
97
|
-
)
|
|
86
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
87
|
+
|
|
88
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
98
89
|
|
|
99
90
|
async def list_async(
|
|
100
91
|
self,
|
|
@@ -103,7 +94,7 @@ class Tags(BaseSDK):
|
|
|
103
94
|
server_url: Optional[str] = None,
|
|
104
95
|
timeout_ms: Optional[int] = None,
|
|
105
96
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
106
|
-
) -> models.
|
|
97
|
+
) -> models.CustomTags:
|
|
107
98
|
r"""List all Tags
|
|
108
99
|
|
|
109
100
|
List all Tags in the team.
|
|
@@ -149,6 +140,7 @@ class Tags(BaseSDK):
|
|
|
149
140
|
|
|
150
141
|
http_res = await self.do_request_async(
|
|
151
142
|
hook_ctx=HookContext(
|
|
143
|
+
config=self.sdk_configuration,
|
|
152
144
|
base_url=base_url or "",
|
|
153
145
|
operation_id="get-tags",
|
|
154
146
|
oauth2_scopes=[],
|
|
@@ -162,33 +154,22 @@ class Tags(BaseSDK):
|
|
|
162
154
|
)
|
|
163
155
|
|
|
164
156
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
165
|
-
return
|
|
157
|
+
return unmarshal_json_response(models.CustomTags, http_res)
|
|
166
158
|
if utils.match_response(http_res, "4XX", "*"):
|
|
167
159
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
168
|
-
raise models.APIError(
|
|
169
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
170
|
-
)
|
|
160
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
171
161
|
if utils.match_response(http_res, "5XX", "*"):
|
|
172
162
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
173
|
-
raise models.APIError(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
content_type = http_res.headers.get("Content-Type")
|
|
178
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
179
|
-
raise models.APIError(
|
|
180
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
181
|
-
http_res.status_code,
|
|
182
|
-
http_res_text,
|
|
183
|
-
http_res,
|
|
184
|
-
)
|
|
163
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
164
|
+
|
|
165
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
185
166
|
|
|
186
167
|
def create(
|
|
187
168
|
self,
|
|
188
169
|
*,
|
|
189
|
-
|
|
190
|
-
models.
|
|
191
|
-
] =
|
|
170
|
+
data: Optional[
|
|
171
|
+
Union[models.CreateTagTagsData, models.CreateTagTagsDataTypedDict]
|
|
172
|
+
] = None,
|
|
192
173
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
193
174
|
server_url: Optional[str] = None,
|
|
194
175
|
timeout_ms: Optional[int] = None,
|
|
@@ -199,7 +180,7 @@ class Tags(BaseSDK):
|
|
|
199
180
|
Create a Tag in the team.
|
|
200
181
|
|
|
201
182
|
|
|
202
|
-
:param
|
|
183
|
+
:param data:
|
|
203
184
|
:param retries: Override the default retry configuration for this method
|
|
204
185
|
:param server_url: Override the default server URL for this method
|
|
205
186
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -215,9 +196,9 @@ class Tags(BaseSDK):
|
|
|
215
196
|
else:
|
|
216
197
|
base_url = self._get_url(base_url, url_variables)
|
|
217
198
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
199
|
+
request = models.CreateTagTagsRequestBody(
|
|
200
|
+
data=utils.get_pydantic_model(data, Optional[models.CreateTagTagsData]),
|
|
201
|
+
)
|
|
221
202
|
|
|
222
203
|
req = self._build_request(
|
|
223
204
|
method="POST",
|
|
@@ -233,7 +214,7 @@ class Tags(BaseSDK):
|
|
|
233
214
|
http_headers=http_headers,
|
|
234
215
|
security=self.sdk_configuration.security,
|
|
235
216
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
236
|
-
request, False,
|
|
217
|
+
request, False, False, "json", models.CreateTagTagsRequestBody
|
|
237
218
|
),
|
|
238
219
|
timeout_ms=timeout_ms,
|
|
239
220
|
)
|
|
@@ -248,6 +229,7 @@ class Tags(BaseSDK):
|
|
|
248
229
|
|
|
249
230
|
http_res = self.do_request(
|
|
250
231
|
hook_ctx=HookContext(
|
|
232
|
+
config=self.sdk_configuration,
|
|
251
233
|
base_url=base_url or "",
|
|
252
234
|
operation_id="create-tag",
|
|
253
235
|
oauth2_scopes=[],
|
|
@@ -261,33 +243,22 @@ class Tags(BaseSDK):
|
|
|
261
243
|
)
|
|
262
244
|
|
|
263
245
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
264
|
-
return
|
|
246
|
+
return unmarshal_json_response(models.CustomTag, http_res)
|
|
265
247
|
if utils.match_response(http_res, ["422", "4XX"], "*"):
|
|
266
248
|
http_res_text = utils.stream_to_text(http_res)
|
|
267
|
-
raise models.APIError(
|
|
268
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
269
|
-
)
|
|
249
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
270
250
|
if utils.match_response(http_res, "5XX", "*"):
|
|
271
251
|
http_res_text = utils.stream_to_text(http_res)
|
|
272
|
-
raise models.APIError(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
content_type = http_res.headers.get("Content-Type")
|
|
277
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
278
|
-
raise models.APIError(
|
|
279
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
280
|
-
http_res.status_code,
|
|
281
|
-
http_res_text,
|
|
282
|
-
http_res,
|
|
283
|
-
)
|
|
252
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
253
|
+
|
|
254
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
284
255
|
|
|
285
256
|
async def create_async(
|
|
286
257
|
self,
|
|
287
258
|
*,
|
|
288
|
-
|
|
289
|
-
models.
|
|
290
|
-
] =
|
|
259
|
+
data: Optional[
|
|
260
|
+
Union[models.CreateTagTagsData, models.CreateTagTagsDataTypedDict]
|
|
261
|
+
] = None,
|
|
291
262
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
292
263
|
server_url: Optional[str] = None,
|
|
293
264
|
timeout_ms: Optional[int] = None,
|
|
@@ -298,7 +269,7 @@ class Tags(BaseSDK):
|
|
|
298
269
|
Create a Tag in the team.
|
|
299
270
|
|
|
300
271
|
|
|
301
|
-
:param
|
|
272
|
+
:param data:
|
|
302
273
|
:param retries: Override the default retry configuration for this method
|
|
303
274
|
:param server_url: Override the default server URL for this method
|
|
304
275
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -314,9 +285,9 @@ class Tags(BaseSDK):
|
|
|
314
285
|
else:
|
|
315
286
|
base_url = self._get_url(base_url, url_variables)
|
|
316
287
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
288
|
+
request = models.CreateTagTagsRequestBody(
|
|
289
|
+
data=utils.get_pydantic_model(data, Optional[models.CreateTagTagsData]),
|
|
290
|
+
)
|
|
320
291
|
|
|
321
292
|
req = self._build_request_async(
|
|
322
293
|
method="POST",
|
|
@@ -332,7 +303,7 @@ class Tags(BaseSDK):
|
|
|
332
303
|
http_headers=http_headers,
|
|
333
304
|
security=self.sdk_configuration.security,
|
|
334
305
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
335
|
-
request, False,
|
|
306
|
+
request, False, False, "json", models.CreateTagTagsRequestBody
|
|
336
307
|
),
|
|
337
308
|
timeout_ms=timeout_ms,
|
|
338
309
|
)
|
|
@@ -347,6 +318,7 @@ class Tags(BaseSDK):
|
|
|
347
318
|
|
|
348
319
|
http_res = await self.do_request_async(
|
|
349
320
|
hook_ctx=HookContext(
|
|
321
|
+
config=self.sdk_configuration,
|
|
350
322
|
base_url=base_url or "",
|
|
351
323
|
operation_id="create-tag",
|
|
352
324
|
oauth2_scopes=[],
|
|
@@ -360,26 +332,15 @@ class Tags(BaseSDK):
|
|
|
360
332
|
)
|
|
361
333
|
|
|
362
334
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
363
|
-
return
|
|
335
|
+
return unmarshal_json_response(models.CustomTag, http_res)
|
|
364
336
|
if utils.match_response(http_res, ["422", "4XX"], "*"):
|
|
365
337
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
366
|
-
raise models.APIError(
|
|
367
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
368
|
-
)
|
|
338
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
369
339
|
if utils.match_response(http_res, "5XX", "*"):
|
|
370
340
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
371
|
-
raise models.APIError(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
content_type = http_res.headers.get("Content-Type")
|
|
376
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
377
|
-
raise models.APIError(
|
|
378
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
379
|
-
http_res.status_code,
|
|
380
|
-
http_res_text,
|
|
381
|
-
http_res,
|
|
382
|
-
)
|
|
341
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
342
|
+
|
|
343
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
383
344
|
|
|
384
345
|
def update(
|
|
385
346
|
self,
|
|
@@ -455,6 +416,7 @@ class Tags(BaseSDK):
|
|
|
455
416
|
|
|
456
417
|
http_res = self.do_request(
|
|
457
418
|
hook_ctx=HookContext(
|
|
419
|
+
config=self.sdk_configuration,
|
|
458
420
|
base_url=base_url or "",
|
|
459
421
|
operation_id="update-tag",
|
|
460
422
|
oauth2_scopes=[],
|
|
@@ -468,26 +430,15 @@ class Tags(BaseSDK):
|
|
|
468
430
|
)
|
|
469
431
|
|
|
470
432
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
471
|
-
return
|
|
433
|
+
return unmarshal_json_response(models.CustomTag, http_res)
|
|
472
434
|
if utils.match_response(http_res, ["404", "422", "4XX"], "*"):
|
|
473
435
|
http_res_text = utils.stream_to_text(http_res)
|
|
474
|
-
raise models.APIError(
|
|
475
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
476
|
-
)
|
|
436
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
477
437
|
if utils.match_response(http_res, "5XX", "*"):
|
|
478
438
|
http_res_text = utils.stream_to_text(http_res)
|
|
479
|
-
raise models.APIError(
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
content_type = http_res.headers.get("Content-Type")
|
|
484
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
485
|
-
raise models.APIError(
|
|
486
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
487
|
-
http_res.status_code,
|
|
488
|
-
http_res_text,
|
|
489
|
-
http_res,
|
|
490
|
-
)
|
|
439
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
440
|
+
|
|
441
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
491
442
|
|
|
492
443
|
async def update_async(
|
|
493
444
|
self,
|
|
@@ -563,6 +514,7 @@ class Tags(BaseSDK):
|
|
|
563
514
|
|
|
564
515
|
http_res = await self.do_request_async(
|
|
565
516
|
hook_ctx=HookContext(
|
|
517
|
+
config=self.sdk_configuration,
|
|
566
518
|
base_url=base_url or "",
|
|
567
519
|
operation_id="update-tag",
|
|
568
520
|
oauth2_scopes=[],
|
|
@@ -576,26 +528,15 @@ class Tags(BaseSDK):
|
|
|
576
528
|
)
|
|
577
529
|
|
|
578
530
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
579
|
-
return
|
|
531
|
+
return unmarshal_json_response(models.CustomTag, http_res)
|
|
580
532
|
if utils.match_response(http_res, ["404", "422", "4XX"], "*"):
|
|
581
533
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
582
|
-
raise models.APIError(
|
|
583
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
584
|
-
)
|
|
534
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
585
535
|
if utils.match_response(http_res, "5XX", "*"):
|
|
586
536
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
587
|
-
raise models.APIError(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
content_type = http_res.headers.get("Content-Type")
|
|
592
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
593
|
-
raise models.APIError(
|
|
594
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
595
|
-
http_res.status_code,
|
|
596
|
-
http_res_text,
|
|
597
|
-
http_res,
|
|
598
|
-
)
|
|
537
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
538
|
+
|
|
539
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
599
540
|
|
|
600
541
|
def delete(
|
|
601
542
|
self,
|
|
@@ -657,6 +598,7 @@ class Tags(BaseSDK):
|
|
|
657
598
|
|
|
658
599
|
http_res = self.do_request(
|
|
659
600
|
hook_ctx=HookContext(
|
|
601
|
+
config=self.sdk_configuration,
|
|
660
602
|
base_url=base_url or "",
|
|
661
603
|
operation_id="destroy-tag",
|
|
662
604
|
oauth2_scopes=[],
|
|
@@ -673,23 +615,12 @@ class Tags(BaseSDK):
|
|
|
673
615
|
return
|
|
674
616
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
675
617
|
http_res_text = utils.stream_to_text(http_res)
|
|
676
|
-
raise models.APIError(
|
|
677
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
678
|
-
)
|
|
618
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
679
619
|
if utils.match_response(http_res, "5XX", "*"):
|
|
680
620
|
http_res_text = utils.stream_to_text(http_res)
|
|
681
|
-
raise models.APIError(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
content_type = http_res.headers.get("Content-Type")
|
|
686
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
687
|
-
raise models.APIError(
|
|
688
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
689
|
-
http_res.status_code,
|
|
690
|
-
http_res_text,
|
|
691
|
-
http_res,
|
|
692
|
-
)
|
|
621
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
622
|
+
|
|
623
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
693
624
|
|
|
694
625
|
async def delete_async(
|
|
695
626
|
self,
|
|
@@ -751,6 +682,7 @@ class Tags(BaseSDK):
|
|
|
751
682
|
|
|
752
683
|
http_res = await self.do_request_async(
|
|
753
684
|
hook_ctx=HookContext(
|
|
685
|
+
config=self.sdk_configuration,
|
|
754
686
|
base_url=base_url or "",
|
|
755
687
|
operation_id="destroy-tag",
|
|
756
688
|
oauth2_scopes=[],
|
|
@@ -767,20 +699,9 @@ class Tags(BaseSDK):
|
|
|
767
699
|
return
|
|
768
700
|
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
769
701
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
770
|
-
raise models.APIError(
|
|
771
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
772
|
-
)
|
|
702
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
773
703
|
if utils.match_response(http_res, "5XX", "*"):
|
|
774
704
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
775
|
-
raise models.APIError(
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
content_type = http_res.headers.get("Content-Type")
|
|
780
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
781
|
-
raise models.APIError(
|
|
782
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
783
|
-
http_res.status_code,
|
|
784
|
-
http_res_text,
|
|
785
|
-
http_res,
|
|
786
|
-
)
|
|
705
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
706
|
+
|
|
707
|
+
raise models.APIError("Unexpected response received", http_res)
|