latitudesh-python-sdk 1.1.0__py3-none-any.whl → 2.0.0__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 +22 -18
- latitudesh_python_sdk/basesdk.py +12 -20
- latitudesh_python_sdk/billing.py +2 -0
- latitudesh_python_sdk/events_sdk.py +2 -0
- latitudesh_python_sdk/firewalls_sdk.py +18 -2
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +4 -0
- latitudesh_python_sdk/models/__init__.py +2563 -1126
- 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/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/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/role.py +11 -0
- latitudesh_python_sdk/models/server_data.py +8 -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 +60 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +19 -0
- 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 +2 -0
- latitudesh_python_sdk/plans.py +42 -26
- latitudesh_python_sdk/privatenetworks.py +44 -28
- latitudesh_python_sdk/projects_sdk.py +36 -28
- latitudesh_python_sdk/regions_sdk.py +4 -0
- latitudesh_python_sdk/roles.py +4 -0
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +102 -46
- latitudesh_python_sdk/{sshkeys.py → sshkeys_sdk.py} +1030 -5
- latitudesh_python_sdk/storage.py +8 -0
- latitudesh_python_sdk/tags.py +30 -22
- latitudesh_python_sdk/teams_sdk.py +6 -0
- latitudesh_python_sdk/teamsmembers.py +6 -0
- latitudesh_python_sdk/traffic_sdk.py +12 -8
- latitudesh_python_sdk/userdata_sdk.py +1029 -0
- latitudesh_python_sdk/userprofile.py +6 -0
- latitudesh_python_sdk/utils/__init__.py +131 -46
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/virtualmachines.py +36 -18
- latitudesh_python_sdk/vpnsessions.py +38 -26
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/METADATA +30 -20
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/RECORD +80 -61
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
import httpx
|
|
5
5
|
from latitudesh_python_sdk.httpclient import HttpClient
|
|
6
|
+
from latitudesh_python_sdk.sdkconfiguration import SDKConfiguration
|
|
6
7
|
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class HookContext:
|
|
11
|
+
config: SDKConfiguration
|
|
10
12
|
base_url: str
|
|
11
13
|
operation_id: str
|
|
12
14
|
oauth2_scopes: Optional[List[str]] = None
|
|
@@ -14,11 +16,13 @@ class HookContext:
|
|
|
14
16
|
|
|
15
17
|
def __init__(
|
|
16
18
|
self,
|
|
19
|
+
config: SDKConfiguration,
|
|
17
20
|
base_url: str,
|
|
18
21
|
operation_id: str,
|
|
19
22
|
oauth2_scopes: Optional[List[str]],
|
|
20
23
|
security_source: Optional[Union[Any, Callable[[], Any]]],
|
|
21
24
|
):
|
|
25
|
+
self.config = config
|
|
22
26
|
self.base_url = base_url
|
|
23
27
|
self.operation_id = operation_id
|
|
24
28
|
self.oauth2_scopes = oauth2_scopes
|
|
@@ -28,6 +32,7 @@ class HookContext:
|
|
|
28
32
|
class BeforeRequestContext(HookContext):
|
|
29
33
|
def __init__(self, hook_ctx: HookContext):
|
|
30
34
|
super().__init__(
|
|
35
|
+
hook_ctx.config,
|
|
31
36
|
hook_ctx.base_url,
|
|
32
37
|
hook_ctx.operation_id,
|
|
33
38
|
hook_ctx.oauth2_scopes,
|
|
@@ -38,6 +43,7 @@ class BeforeRequestContext(HookContext):
|
|
|
38
43
|
class AfterSuccessContext(HookContext):
|
|
39
44
|
def __init__(self, hook_ctx: HookContext):
|
|
40
45
|
super().__init__(
|
|
46
|
+
hook_ctx.config,
|
|
41
47
|
hook_ctx.base_url,
|
|
42
48
|
hook_ctx.operation_id,
|
|
43
49
|
hook_ctx.oauth2_scopes,
|
|
@@ -48,6 +54,7 @@ class AfterSuccessContext(HookContext):
|
|
|
48
54
|
class AfterErrorContext(HookContext):
|
|
49
55
|
def __init__(self, hook_ctx: HookContext):
|
|
50
56
|
super().__init__(
|
|
57
|
+
hook_ctx.config,
|
|
51
58
|
hook_ctx.base_url,
|
|
52
59
|
hook_ctx.operation_id,
|
|
53
60
|
hook_ctx.oauth2_scopes,
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "latitudesh-python-sdk"
|
|
6
|
-
__version__: str = "
|
|
7
|
-
__openapi_doc_version__: str = "
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str =
|
|
6
|
+
__version__: str = "2.0.0"
|
|
7
|
+
__openapi_doc_version__: str = "2023-06-01"
|
|
8
|
+
__gen_version__: str = "2.640.2"
|
|
9
|
+
__user_agent__: str = (
|
|
10
|
+
"speakeasy-sdk/python 2.0.0 2.640.2 2023-06-01 latitudesh-python-sdk"
|
|
11
|
+
)
|
|
10
12
|
|
|
11
13
|
try:
|
|
12
14
|
if __package__ is not None:
|
latitudesh_python_sdk/apikeys.py
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
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 typing import Any, Mapping, Optional, Union
|
|
8
|
+
from typing import Any, Mapping, Optional, Union
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class APIKeys(BaseSDK):
|
|
@@ -62,6 +62,7 @@ class APIKeys(BaseSDK):
|
|
|
62
62
|
|
|
63
63
|
http_res = self.do_request(
|
|
64
64
|
hook_ctx=HookContext(
|
|
65
|
+
config=self.sdk_configuration,
|
|
65
66
|
base_url=base_url or "",
|
|
66
67
|
operation_id="get-api-keys",
|
|
67
68
|
oauth2_scopes=[],
|
|
@@ -149,6 +150,7 @@ class APIKeys(BaseSDK):
|
|
|
149
150
|
|
|
150
151
|
http_res = await self.do_request_async(
|
|
151
152
|
hook_ctx=HookContext(
|
|
153
|
+
config=self.sdk_configuration,
|
|
152
154
|
base_url=base_url or "",
|
|
153
155
|
operation_id="get-api-keys",
|
|
154
156
|
oauth2_scopes=[],
|
|
@@ -186,9 +188,7 @@ class APIKeys(BaseSDK):
|
|
|
186
188
|
def create(
|
|
187
189
|
self,
|
|
188
190
|
*,
|
|
189
|
-
|
|
190
|
-
models.CreateAPIKey, models.CreateAPIKeyTypedDict
|
|
191
|
-
] = models.CreateAPIKey(),
|
|
191
|
+
data: Optional[Union[models.Data, models.DataTypedDict]] = None,
|
|
192
192
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
193
193
|
server_url: Optional[str] = None,
|
|
194
194
|
timeout_ms: Optional[int] = None,
|
|
@@ -199,7 +199,7 @@ class APIKeys(BaseSDK):
|
|
|
199
199
|
Create a new API Key that is tied to the current user account. The created API key is only listed ONCE upon creation. It can however be regenerated or deleted.
|
|
200
200
|
|
|
201
201
|
|
|
202
|
-
:param
|
|
202
|
+
:param data:
|
|
203
203
|
:param retries: Override the default retry configuration for this method
|
|
204
204
|
:param server_url: Override the default server URL for this method
|
|
205
205
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -215,9 +215,9 @@ class APIKeys(BaseSDK):
|
|
|
215
215
|
else:
|
|
216
216
|
base_url = self._get_url(base_url, url_variables)
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
request = models.CreateAPIKey(
|
|
219
|
+
data=utils.get_pydantic_model(data, Optional[models.Data]),
|
|
220
|
+
)
|
|
221
221
|
|
|
222
222
|
req = self._build_request(
|
|
223
223
|
method="POST",
|
|
@@ -233,7 +233,7 @@ class APIKeys(BaseSDK):
|
|
|
233
233
|
http_headers=http_headers,
|
|
234
234
|
security=self.sdk_configuration.security,
|
|
235
235
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
236
|
-
request, False,
|
|
236
|
+
request, False, False, "json", models.CreateAPIKey
|
|
237
237
|
),
|
|
238
238
|
timeout_ms=timeout_ms,
|
|
239
239
|
)
|
|
@@ -248,6 +248,7 @@ class APIKeys(BaseSDK):
|
|
|
248
248
|
|
|
249
249
|
http_res = self.do_request(
|
|
250
250
|
hook_ctx=HookContext(
|
|
251
|
+
config=self.sdk_configuration,
|
|
251
252
|
base_url=base_url or "",
|
|
252
253
|
operation_id="post-api-key",
|
|
253
254
|
oauth2_scopes=[],
|
|
@@ -289,9 +290,7 @@ class APIKeys(BaseSDK):
|
|
|
289
290
|
async def create_async(
|
|
290
291
|
self,
|
|
291
292
|
*,
|
|
292
|
-
|
|
293
|
-
models.CreateAPIKey, models.CreateAPIKeyTypedDict
|
|
294
|
-
] = models.CreateAPIKey(),
|
|
293
|
+
data: Optional[Union[models.Data, models.DataTypedDict]] = None,
|
|
295
294
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
296
295
|
server_url: Optional[str] = None,
|
|
297
296
|
timeout_ms: Optional[int] = None,
|
|
@@ -302,7 +301,7 @@ class APIKeys(BaseSDK):
|
|
|
302
301
|
Create a new API Key that is tied to the current user account. The created API key is only listed ONCE upon creation. It can however be regenerated or deleted.
|
|
303
302
|
|
|
304
303
|
|
|
305
|
-
:param
|
|
304
|
+
:param data:
|
|
306
305
|
:param retries: Override the default retry configuration for this method
|
|
307
306
|
:param server_url: Override the default server URL for this method
|
|
308
307
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -318,9 +317,9 @@ class APIKeys(BaseSDK):
|
|
|
318
317
|
else:
|
|
319
318
|
base_url = self._get_url(base_url, url_variables)
|
|
320
319
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
320
|
+
request = models.CreateAPIKey(
|
|
321
|
+
data=utils.get_pydantic_model(data, Optional[models.Data]),
|
|
322
|
+
)
|
|
324
323
|
|
|
325
324
|
req = self._build_request_async(
|
|
326
325
|
method="POST",
|
|
@@ -336,7 +335,7 @@ class APIKeys(BaseSDK):
|
|
|
336
335
|
http_headers=http_headers,
|
|
337
336
|
security=self.sdk_configuration.security,
|
|
338
337
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
339
|
-
request, False,
|
|
338
|
+
request, False, False, "json", models.CreateAPIKey
|
|
340
339
|
),
|
|
341
340
|
timeout_ms=timeout_ms,
|
|
342
341
|
)
|
|
@@ -351,6 +350,7 @@ class APIKeys(BaseSDK):
|
|
|
351
350
|
|
|
352
351
|
http_res = await self.do_request_async(
|
|
353
352
|
hook_ctx=HookContext(
|
|
353
|
+
config=self.sdk_configuration,
|
|
354
354
|
base_url=base_url or "",
|
|
355
355
|
operation_id="post-api-key",
|
|
356
356
|
oauth2_scopes=[],
|
|
@@ -459,6 +459,7 @@ class APIKeys(BaseSDK):
|
|
|
459
459
|
|
|
460
460
|
http_res = self.do_request(
|
|
461
461
|
hook_ctx=HookContext(
|
|
462
|
+
config=self.sdk_configuration,
|
|
462
463
|
base_url=base_url or "",
|
|
463
464
|
operation_id="update-api-key",
|
|
464
465
|
oauth2_scopes=[],
|
|
@@ -567,6 +568,7 @@ class APIKeys(BaseSDK):
|
|
|
567
568
|
|
|
568
569
|
http_res = await self.do_request_async(
|
|
569
570
|
hook_ctx=HookContext(
|
|
571
|
+
config=self.sdk_configuration,
|
|
570
572
|
base_url=base_url or "",
|
|
571
573
|
operation_id="update-api-key",
|
|
572
574
|
oauth2_scopes=[],
|
|
@@ -665,6 +667,7 @@ class APIKeys(BaseSDK):
|
|
|
665
667
|
|
|
666
668
|
http_res = self.do_request(
|
|
667
669
|
hook_ctx=HookContext(
|
|
670
|
+
config=self.sdk_configuration,
|
|
668
671
|
base_url=base_url or "",
|
|
669
672
|
operation_id="delete-api-key",
|
|
670
673
|
oauth2_scopes=[],
|
|
@@ -763,6 +766,7 @@ class APIKeys(BaseSDK):
|
|
|
763
766
|
|
|
764
767
|
http_res = await self.do_request_async(
|
|
765
768
|
hook_ctx=HookContext(
|
|
769
|
+
config=self.sdk_configuration,
|
|
766
770
|
base_url=base_url or "",
|
|
767
771
|
operation_id="delete-api-key",
|
|
768
772
|
oauth2_scopes=[],
|
latitudesh_python_sdk/basesdk.py
CHANGED
|
@@ -222,12 +222,12 @@ class BaseSDK:
|
|
|
222
222
|
client = self.sdk_configuration.client
|
|
223
223
|
logger = self.sdk_configuration.debug_logger
|
|
224
224
|
|
|
225
|
+
hooks = self.sdk_configuration.__dict__["_hooks"]
|
|
226
|
+
|
|
225
227
|
def do():
|
|
226
228
|
http_res = None
|
|
227
229
|
try:
|
|
228
|
-
req =
|
|
229
|
-
BeforeRequestContext(hook_ctx), request
|
|
230
|
-
)
|
|
230
|
+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
|
|
231
231
|
logger.debug(
|
|
232
232
|
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
233
233
|
req.method,
|
|
@@ -241,9 +241,7 @@ class BaseSDK:
|
|
|
241
241
|
|
|
242
242
|
http_res = client.send(req, stream=stream)
|
|
243
243
|
except Exception as e:
|
|
244
|
-
_, e =
|
|
245
|
-
AfterErrorContext(hook_ctx), None, e
|
|
246
|
-
)
|
|
244
|
+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
|
|
247
245
|
if e is not None:
|
|
248
246
|
logger.debug("Request Exception", exc_info=True)
|
|
249
247
|
raise e
|
|
@@ -261,7 +259,7 @@ class BaseSDK:
|
|
|
261
259
|
)
|
|
262
260
|
|
|
263
261
|
if utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
264
|
-
result, err =
|
|
262
|
+
result, err = hooks.after_error(
|
|
265
263
|
AfterErrorContext(hook_ctx), http_res, None
|
|
266
264
|
)
|
|
267
265
|
if err is not None:
|
|
@@ -281,9 +279,7 @@ class BaseSDK:
|
|
|
281
279
|
http_res = do()
|
|
282
280
|
|
|
283
281
|
if not utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
284
|
-
http_res =
|
|
285
|
-
AfterSuccessContext(hook_ctx), http_res
|
|
286
|
-
)
|
|
282
|
+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
|
|
287
283
|
|
|
288
284
|
return http_res
|
|
289
285
|
|
|
@@ -298,12 +294,12 @@ class BaseSDK:
|
|
|
298
294
|
client = self.sdk_configuration.async_client
|
|
299
295
|
logger = self.sdk_configuration.debug_logger
|
|
300
296
|
|
|
297
|
+
hooks = self.sdk_configuration.__dict__["_hooks"]
|
|
298
|
+
|
|
301
299
|
async def do():
|
|
302
300
|
http_res = None
|
|
303
301
|
try:
|
|
304
|
-
req =
|
|
305
|
-
BeforeRequestContext(hook_ctx), request
|
|
306
|
-
)
|
|
302
|
+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
|
|
307
303
|
logger.debug(
|
|
308
304
|
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
309
305
|
req.method,
|
|
@@ -317,9 +313,7 @@ class BaseSDK:
|
|
|
317
313
|
|
|
318
314
|
http_res = await client.send(req, stream=stream)
|
|
319
315
|
except Exception as e:
|
|
320
|
-
_, e =
|
|
321
|
-
AfterErrorContext(hook_ctx), None, e
|
|
322
|
-
)
|
|
316
|
+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
|
|
323
317
|
if e is not None:
|
|
324
318
|
logger.debug("Request Exception", exc_info=True)
|
|
325
319
|
raise e
|
|
@@ -337,7 +331,7 @@ class BaseSDK:
|
|
|
337
331
|
)
|
|
338
332
|
|
|
339
333
|
if utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
340
|
-
result, err =
|
|
334
|
+
result, err = hooks.after_error(
|
|
341
335
|
AfterErrorContext(hook_ctx), http_res, None
|
|
342
336
|
)
|
|
343
337
|
if err is not None:
|
|
@@ -359,8 +353,6 @@ class BaseSDK:
|
|
|
359
353
|
http_res = await do()
|
|
360
354
|
|
|
361
355
|
if not utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
362
|
-
http_res =
|
|
363
|
-
AfterSuccessContext(hook_ctx), http_res
|
|
364
|
-
)
|
|
356
|
+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
|
|
365
357
|
|
|
366
358
|
return http_res
|
latitudesh_python_sdk/billing.py
CHANGED
|
@@ -75,6 +75,7 @@ class Billing(BaseSDK):
|
|
|
75
75
|
|
|
76
76
|
http_res = self.do_request(
|
|
77
77
|
hook_ctx=HookContext(
|
|
78
|
+
config=self.sdk_configuration,
|
|
78
79
|
base_url=base_url or "",
|
|
79
80
|
operation_id="get-billing-usage",
|
|
80
81
|
oauth2_scopes=[],
|
|
@@ -175,6 +176,7 @@ class Billing(BaseSDK):
|
|
|
175
176
|
|
|
176
177
|
http_res = await self.do_request_async(
|
|
177
178
|
hook_ctx=HookContext(
|
|
179
|
+
config=self.sdk_configuration,
|
|
178
180
|
base_url=base_url or "",
|
|
179
181
|
operation_id="get-billing-usage",
|
|
180
182
|
oauth2_scopes=[],
|
|
@@ -97,6 +97,7 @@ class EventsSDK(BaseSDK):
|
|
|
97
97
|
|
|
98
98
|
http_res = self.do_request(
|
|
99
99
|
hook_ctx=HookContext(
|
|
100
|
+
config=self.sdk_configuration,
|
|
100
101
|
base_url=base_url or "",
|
|
101
102
|
operation_id="get-events",
|
|
102
103
|
oauth2_scopes=[],
|
|
@@ -251,6 +252,7 @@ class EventsSDK(BaseSDK):
|
|
|
251
252
|
|
|
252
253
|
http_res = await self.do_request_async(
|
|
253
254
|
hook_ctx=HookContext(
|
|
255
|
+
config=self.sdk_configuration,
|
|
254
256
|
base_url=base_url or "",
|
|
255
257
|
operation_id="get-events",
|
|
256
258
|
oauth2_scopes=[],
|
|
@@ -75,6 +75,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
75
75
|
|
|
76
76
|
http_res = self.do_request(
|
|
77
77
|
hook_ctx=HookContext(
|
|
78
|
+
config=self.sdk_configuration,
|
|
78
79
|
base_url=base_url or "",
|
|
79
80
|
operation_id="create-firewall",
|
|
80
81
|
oauth2_scopes=[],
|
|
@@ -178,6 +179,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
178
179
|
|
|
179
180
|
http_res = await self.do_request_async(
|
|
180
181
|
hook_ctx=HookContext(
|
|
182
|
+
config=self.sdk_configuration,
|
|
181
183
|
base_url=base_url or "",
|
|
182
184
|
operation_id="create-firewall",
|
|
183
185
|
oauth2_scopes=[],
|
|
@@ -281,6 +283,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
281
283
|
|
|
282
284
|
http_res = self.do_request(
|
|
283
285
|
hook_ctx=HookContext(
|
|
286
|
+
config=self.sdk_configuration,
|
|
284
287
|
base_url=base_url or "",
|
|
285
288
|
operation_id="list-firewalls",
|
|
286
289
|
oauth2_scopes=[],
|
|
@@ -404,6 +407,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
404
407
|
|
|
405
408
|
http_res = await self.do_request_async(
|
|
406
409
|
hook_ctx=HookContext(
|
|
410
|
+
config=self.sdk_configuration,
|
|
407
411
|
base_url=base_url or "",
|
|
408
412
|
operation_id="list-firewalls",
|
|
409
413
|
oauth2_scopes=[],
|
|
@@ -521,6 +525,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
521
525
|
|
|
522
526
|
http_res = self.do_request(
|
|
523
527
|
hook_ctx=HookContext(
|
|
528
|
+
config=self.sdk_configuration,
|
|
524
529
|
base_url=base_url or "",
|
|
525
530
|
operation_id="get-firewall",
|
|
526
531
|
oauth2_scopes=[],
|
|
@@ -618,6 +623,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
618
623
|
|
|
619
624
|
http_res = await self.do_request_async(
|
|
620
625
|
hook_ctx=HookContext(
|
|
626
|
+
config=self.sdk_configuration,
|
|
621
627
|
base_url=base_url or "",
|
|
622
628
|
operation_id="get-firewall",
|
|
623
629
|
oauth2_scopes=[],
|
|
@@ -730,6 +736,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
730
736
|
|
|
731
737
|
http_res = self.do_request(
|
|
732
738
|
hook_ctx=HookContext(
|
|
739
|
+
config=self.sdk_configuration,
|
|
733
740
|
base_url=base_url or "",
|
|
734
741
|
operation_id="update-firewall",
|
|
735
742
|
oauth2_scopes=[],
|
|
@@ -842,6 +849,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
842
849
|
|
|
843
850
|
http_res = await self.do_request_async(
|
|
844
851
|
hook_ctx=HookContext(
|
|
852
|
+
config=self.sdk_configuration,
|
|
845
853
|
base_url=base_url or "",
|
|
846
854
|
operation_id="update-firewall",
|
|
847
855
|
oauth2_scopes=[],
|
|
@@ -939,6 +947,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
939
947
|
|
|
940
948
|
http_res = self.do_request(
|
|
941
949
|
hook_ctx=HookContext(
|
|
950
|
+
config=self.sdk_configuration,
|
|
942
951
|
base_url=base_url or "",
|
|
943
952
|
operation_id="delete-firewall",
|
|
944
953
|
oauth2_scopes=[],
|
|
@@ -1036,6 +1045,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1036
1045
|
|
|
1037
1046
|
http_res = await self.do_request_async(
|
|
1038
1047
|
hook_ctx=HookContext(
|
|
1048
|
+
config=self.sdk_configuration,
|
|
1039
1049
|
base_url=base_url or "",
|
|
1040
1050
|
operation_id="delete-firewall",
|
|
1041
1051
|
oauth2_scopes=[],
|
|
@@ -1150,6 +1160,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1150
1160
|
|
|
1151
1161
|
http_res = self.do_request(
|
|
1152
1162
|
hook_ctx=HookContext(
|
|
1163
|
+
config=self.sdk_configuration,
|
|
1153
1164
|
base_url=base_url or "",
|
|
1154
1165
|
operation_id="create-firewall-assignment",
|
|
1155
1166
|
oauth2_scopes=[],
|
|
@@ -1266,6 +1277,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1266
1277
|
|
|
1267
1278
|
http_res = await self.do_request_async(
|
|
1268
1279
|
hook_ctx=HookContext(
|
|
1280
|
+
config=self.sdk_configuration,
|
|
1269
1281
|
base_url=base_url or "",
|
|
1270
1282
|
operation_id="create-firewall-assignment",
|
|
1271
1283
|
oauth2_scopes=[],
|
|
@@ -1371,6 +1383,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1371
1383
|
|
|
1372
1384
|
http_res = self.do_request(
|
|
1373
1385
|
hook_ctx=HookContext(
|
|
1386
|
+
config=self.sdk_configuration,
|
|
1374
1387
|
base_url=base_url or "",
|
|
1375
1388
|
operation_id="get-firewall-assignments",
|
|
1376
1389
|
oauth2_scopes=[],
|
|
@@ -1407,7 +1420,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1407
1420
|
response_data: Any = None
|
|
1408
1421
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1409
1422
|
return models.GetFirewallAssignmentsResponse(
|
|
1410
|
-
result=utils.unmarshal_json(http_res.text, models.
|
|
1423
|
+
result=utils.unmarshal_json(http_res.text, models.FirewallAssignments),
|
|
1411
1424
|
next=next_func,
|
|
1412
1425
|
)
|
|
1413
1426
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
@@ -1498,6 +1511,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1498
1511
|
|
|
1499
1512
|
http_res = await self.do_request_async(
|
|
1500
1513
|
hook_ctx=HookContext(
|
|
1514
|
+
config=self.sdk_configuration,
|
|
1501
1515
|
base_url=base_url or "",
|
|
1502
1516
|
operation_id="get-firewall-assignments",
|
|
1503
1517
|
oauth2_scopes=[],
|
|
@@ -1534,7 +1548,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1534
1548
|
response_data: Any = None
|
|
1535
1549
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1536
1550
|
return models.GetFirewallAssignmentsResponse(
|
|
1537
|
-
result=utils.unmarshal_json(http_res.text, models.
|
|
1551
|
+
result=utils.unmarshal_json(http_res.text, models.FirewallAssignments),
|
|
1538
1552
|
next=next_func,
|
|
1539
1553
|
)
|
|
1540
1554
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
@@ -1622,6 +1636,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1622
1636
|
|
|
1623
1637
|
http_res = self.do_request(
|
|
1624
1638
|
hook_ctx=HookContext(
|
|
1639
|
+
config=self.sdk_configuration,
|
|
1625
1640
|
base_url=base_url or "",
|
|
1626
1641
|
operation_id="delete-firewall-assignment",
|
|
1627
1642
|
oauth2_scopes=[],
|
|
@@ -1722,6 +1737,7 @@ class FirewallsSDK(BaseSDK):
|
|
|
1722
1737
|
|
|
1723
1738
|
http_res = await self.do_request_async(
|
|
1724
1739
|
hook_ctx=HookContext(
|
|
1740
|
+
config=self.sdk_configuration,
|
|
1725
1741
|
base_url=base_url or "",
|
|
1726
1742
|
operation_id="delete-firewall-assignment",
|
|
1727
1743
|
oauth2_scopes=[],
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# pyright: reportReturnType = false
|
|
4
4
|
import asyncio
|
|
5
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
6
5
|
from typing_extensions import Protocol, runtime_checkable
|
|
7
6
|
import httpx
|
|
8
7
|
from typing import Any, Optional, Union
|
|
@@ -116,21 +115,12 @@ def close_clients(
|
|
|
116
115
|
pass
|
|
117
116
|
|
|
118
117
|
if async_client is not None and not async_client_supplied:
|
|
119
|
-
is_async = False
|
|
120
118
|
try:
|
|
121
|
-
asyncio.get_running_loop()
|
|
122
|
-
|
|
119
|
+
loop = asyncio.get_running_loop()
|
|
120
|
+
asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
|
|
123
121
|
except RuntimeError:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
try:
|
|
127
|
-
# If this function is called in an async loop then start another
|
|
128
|
-
# loop in a separate thread to close the async http client.
|
|
129
|
-
if is_async:
|
|
130
|
-
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
131
|
-
future = executor.submit(asyncio.run, async_client.aclose())
|
|
132
|
-
future.result()
|
|
133
|
-
else:
|
|
122
|
+
try:
|
|
134
123
|
asyncio.run(async_client.aclose())
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
except RuntimeError:
|
|
125
|
+
# best effort
|
|
126
|
+
pass
|
|
@@ -97,6 +97,7 @@ class IPAddressesSDK(BaseSDK):
|
|
|
97
97
|
|
|
98
98
|
http_res = self.do_request(
|
|
99
99
|
hook_ctx=HookContext(
|
|
100
|
+
config=self.sdk_configuration,
|
|
100
101
|
base_url=base_url or "",
|
|
101
102
|
operation_id="get-ips",
|
|
102
103
|
oauth2_scopes=[],
|
|
@@ -252,6 +253,7 @@ class IPAddressesSDK(BaseSDK):
|
|
|
252
253
|
|
|
253
254
|
http_res = await self.do_request_async(
|
|
254
255
|
hook_ctx=HookContext(
|
|
256
|
+
config=self.sdk_configuration,
|
|
255
257
|
base_url=base_url or "",
|
|
256
258
|
operation_id="get-ips",
|
|
257
259
|
oauth2_scopes=[],
|
|
@@ -382,6 +384,7 @@ class IPAddressesSDK(BaseSDK):
|
|
|
382
384
|
|
|
383
385
|
http_res = self.do_request(
|
|
384
386
|
hook_ctx=HookContext(
|
|
387
|
+
config=self.sdk_configuration,
|
|
385
388
|
base_url=base_url or "",
|
|
386
389
|
operation_id="get-ip",
|
|
387
390
|
oauth2_scopes=[],
|
|
@@ -482,6 +485,7 @@ class IPAddressesSDK(BaseSDK):
|
|
|
482
485
|
|
|
483
486
|
http_res = await self.do_request_async(
|
|
484
487
|
hook_ctx=HookContext(
|
|
488
|
+
config=self.sdk_configuration,
|
|
485
489
|
base_url=base_url or "",
|
|
486
490
|
operation_id="get-ip",
|
|
487
491
|
oauth2_scopes=[],
|