latitudesh-python-sdk 1.0.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 +86 -5
- latitudesh_python_sdk/firewalls_sdk.py +146 -9
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +82 -5
- latitudesh_python_sdk/models/__init__.py +2597 -1071
- 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/billing_usage.py +3 -0
- 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_bandwidth_plansop.py +30 -1
- latitudesh_python_sdk/models/get_eventsop.py +29 -1
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +37 -2
- latitudesh_python_sdk/models/get_ipsop.py +30 -1
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +37 -2
- latitudesh_python_sdk/models/get_projectsop.py +30 -1
- latitudesh_python_sdk/models/get_regionsop.py +42 -0
- latitudesh_python_sdk/models/get_rolesop.py +37 -2
- latitudesh_python_sdk/models/get_serversop.py +30 -1
- 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_team_membersop.py +42 -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/get_virtual_networks_assignmentsop.py +33 -1
- latitudesh_python_sdk/models/get_virtual_networksop.py +30 -1
- latitudesh_python_sdk/models/list_firewallsop.py +30 -1
- 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 -1
- 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 +78 -9
- latitudesh_python_sdk/plans.py +109 -30
- latitudesh_python_sdk/privatenetworks.py +185 -36
- latitudesh_python_sdk/projects_sdk.py +113 -32
- latitudesh_python_sdk/regions_sdk.py +78 -7
- latitudesh_python_sdk/roles.py +78 -7
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +195 -50
- 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 +80 -7
- 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 -45
- latitudesh_python_sdk/utils/datetimes.py +23 -0
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/utils/serializers.py +32 -3
- latitudesh_python_sdk/virtualmachines.py +36 -18
- latitudesh_python_sdk/vpnsessions.py +38 -26
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/METADATA +58 -22
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/RECORD +95 -73
- {latitudesh_python_sdk-1.0.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.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
+
from jsonpath import JSONPath
|
|
4
5
|
from latitudesh_python_sdk import models, utils
|
|
5
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
7
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
-
from typing import Mapping, Optional
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class OperatingSystemsSDK(BaseSDK):
|
|
12
13
|
def list(
|
|
13
14
|
self,
|
|
14
15
|
*,
|
|
16
|
+
page_size: Optional[int] = 20,
|
|
17
|
+
page_number: Optional[int] = 1,
|
|
15
18
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
16
19
|
server_url: Optional[str] = None,
|
|
17
20
|
timeout_ms: Optional[int] = None,
|
|
18
21
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
19
|
-
) -> models.
|
|
22
|
+
) -> Optional[models.GetPlansOperatingSystemResponse]:
|
|
20
23
|
r"""List all operating systems available
|
|
21
24
|
|
|
22
25
|
Lists all operating systems available to deploy and reinstall.
|
|
23
26
|
|
|
24
27
|
|
|
28
|
+
:param page_size: Number of items to return per page
|
|
29
|
+
:param page_number: Page number to return (starts at 1)
|
|
25
30
|
:param retries: Override the default retry configuration for this method
|
|
26
31
|
:param server_url: Override the default server URL for this method
|
|
27
32
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -36,12 +41,18 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
36
41
|
base_url = server_url
|
|
37
42
|
else:
|
|
38
43
|
base_url = self._get_url(base_url, url_variables)
|
|
44
|
+
|
|
45
|
+
request = models.GetPlansOperatingSystemRequest(
|
|
46
|
+
page_size=page_size,
|
|
47
|
+
page_number=page_number,
|
|
48
|
+
)
|
|
49
|
+
|
|
39
50
|
req = self._build_request(
|
|
40
51
|
method="GET",
|
|
41
52
|
path="/plans/operating_systems",
|
|
42
53
|
base_url=base_url,
|
|
43
54
|
url_variables=url_variables,
|
|
44
|
-
request=
|
|
55
|
+
request=request,
|
|
45
56
|
request_body_required=False,
|
|
46
57
|
request_has_path_params=False,
|
|
47
58
|
request_has_query_params=True,
|
|
@@ -62,6 +73,7 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
62
73
|
|
|
63
74
|
http_res = self.do_request(
|
|
64
75
|
hook_ctx=HookContext(
|
|
76
|
+
config=self.sdk_configuration,
|
|
65
77
|
base_url=base_url or "",
|
|
66
78
|
operation_id="get-plans-operating-system",
|
|
67
79
|
oauth2_scopes=[],
|
|
@@ -74,9 +86,32 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
74
86
|
retry_config=retry_config,
|
|
75
87
|
)
|
|
76
88
|
|
|
89
|
+
def next_func() -> Optional[models.GetPlansOperatingSystemResponse]:
|
|
90
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
91
|
+
page = request.page_number if not request.page_number is None else 1
|
|
92
|
+
next_page = page + 1
|
|
93
|
+
|
|
94
|
+
if not http_res.text:
|
|
95
|
+
return None
|
|
96
|
+
results = JSONPath("$.data").parse(body)
|
|
97
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
98
|
+
return None
|
|
99
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
100
|
+
if len(results[0]) < limit:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
return self.list(
|
|
104
|
+
page_size=page_size,
|
|
105
|
+
page_number=next_page,
|
|
106
|
+
retries=retries,
|
|
107
|
+
)
|
|
108
|
+
|
|
77
109
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
78
|
-
return
|
|
79
|
-
|
|
110
|
+
return models.GetPlansOperatingSystemResponse(
|
|
111
|
+
result=utils.unmarshal_json(
|
|
112
|
+
http_res.text, models.GetPlansOperatingSystemResponseBody
|
|
113
|
+
),
|
|
114
|
+
next=next_func,
|
|
80
115
|
)
|
|
81
116
|
if utils.match_response(http_res, "4XX", "*"):
|
|
82
117
|
http_res_text = utils.stream_to_text(http_res)
|
|
@@ -101,16 +136,20 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
101
136
|
async def list_async(
|
|
102
137
|
self,
|
|
103
138
|
*,
|
|
139
|
+
page_size: Optional[int] = 20,
|
|
140
|
+
page_number: Optional[int] = 1,
|
|
104
141
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
105
142
|
server_url: Optional[str] = None,
|
|
106
143
|
timeout_ms: Optional[int] = None,
|
|
107
144
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
108
|
-
) -> models.
|
|
145
|
+
) -> Optional[models.GetPlansOperatingSystemResponse]:
|
|
109
146
|
r"""List all operating systems available
|
|
110
147
|
|
|
111
148
|
Lists all operating systems available to deploy and reinstall.
|
|
112
149
|
|
|
113
150
|
|
|
151
|
+
:param page_size: Number of items to return per page
|
|
152
|
+
:param page_number: Page number to return (starts at 1)
|
|
114
153
|
:param retries: Override the default retry configuration for this method
|
|
115
154
|
:param server_url: Override the default server URL for this method
|
|
116
155
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -125,12 +164,18 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
125
164
|
base_url = server_url
|
|
126
165
|
else:
|
|
127
166
|
base_url = self._get_url(base_url, url_variables)
|
|
167
|
+
|
|
168
|
+
request = models.GetPlansOperatingSystemRequest(
|
|
169
|
+
page_size=page_size,
|
|
170
|
+
page_number=page_number,
|
|
171
|
+
)
|
|
172
|
+
|
|
128
173
|
req = self._build_request_async(
|
|
129
174
|
method="GET",
|
|
130
175
|
path="/plans/operating_systems",
|
|
131
176
|
base_url=base_url,
|
|
132
177
|
url_variables=url_variables,
|
|
133
|
-
request=
|
|
178
|
+
request=request,
|
|
134
179
|
request_body_required=False,
|
|
135
180
|
request_has_path_params=False,
|
|
136
181
|
request_has_query_params=True,
|
|
@@ -151,6 +196,7 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
151
196
|
|
|
152
197
|
http_res = await self.do_request_async(
|
|
153
198
|
hook_ctx=HookContext(
|
|
199
|
+
config=self.sdk_configuration,
|
|
154
200
|
base_url=base_url or "",
|
|
155
201
|
operation_id="get-plans-operating-system",
|
|
156
202
|
oauth2_scopes=[],
|
|
@@ -163,9 +209,32 @@ class OperatingSystemsSDK(BaseSDK):
|
|
|
163
209
|
retry_config=retry_config,
|
|
164
210
|
)
|
|
165
211
|
|
|
212
|
+
def next_func() -> Optional[models.GetPlansOperatingSystemResponse]:
|
|
213
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
214
|
+
page = request.page_number if not request.page_number is None else 1
|
|
215
|
+
next_page = page + 1
|
|
216
|
+
|
|
217
|
+
if not http_res.text:
|
|
218
|
+
return None
|
|
219
|
+
results = JSONPath("$.data").parse(body)
|
|
220
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
221
|
+
return None
|
|
222
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
223
|
+
if len(results[0]) < limit:
|
|
224
|
+
return None
|
|
225
|
+
|
|
226
|
+
return self.list(
|
|
227
|
+
page_size=page_size,
|
|
228
|
+
page_number=next_page,
|
|
229
|
+
retries=retries,
|
|
230
|
+
)
|
|
231
|
+
|
|
166
232
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
167
|
-
return
|
|
168
|
-
|
|
233
|
+
return models.GetPlansOperatingSystemResponse(
|
|
234
|
+
result=utils.unmarshal_json(
|
|
235
|
+
http_res.text, models.GetPlansOperatingSystemResponseBody
|
|
236
|
+
),
|
|
237
|
+
next=next_func,
|
|
169
238
|
)
|
|
170
239
|
if utils.match_response(http_res, "4XX", "*"):
|
|
171
240
|
http_res_text = await utils.stream_to_text_async(http_res)
|
latitudesh_python_sdk/plans.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
+
from jsonpath import JSONPath
|
|
4
5
|
from latitudesh_python_sdk import models, utils
|
|
5
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
|
-
from latitudesh_python_sdk.types import
|
|
7
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
-
from typing import Any, Mapping, Optional, Union
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Plans(BaseSDK):
|
|
@@ -90,6 +91,7 @@ class Plans(BaseSDK):
|
|
|
90
91
|
|
|
91
92
|
http_res = self.do_request(
|
|
92
93
|
hook_ctx=HookContext(
|
|
94
|
+
config=self.sdk_configuration,
|
|
93
95
|
base_url=base_url or "",
|
|
94
96
|
operation_id="get-plans",
|
|
95
97
|
oauth2_scopes=[],
|
|
@@ -205,6 +207,7 @@ class Plans(BaseSDK):
|
|
|
205
207
|
|
|
206
208
|
http_res = await self.do_request_async(
|
|
207
209
|
hook_ctx=HookContext(
|
|
210
|
+
config=self.sdk_configuration,
|
|
208
211
|
base_url=base_url or "",
|
|
209
212
|
operation_id="get-plans",
|
|
210
213
|
oauth2_scopes=[],
|
|
@@ -296,6 +299,7 @@ class Plans(BaseSDK):
|
|
|
296
299
|
|
|
297
300
|
http_res = self.do_request(
|
|
298
301
|
hook_ctx=HookContext(
|
|
302
|
+
config=self.sdk_configuration,
|
|
299
303
|
base_url=base_url or "",
|
|
300
304
|
operation_id="get-plan",
|
|
301
305
|
oauth2_scopes=[],
|
|
@@ -391,6 +395,7 @@ class Plans(BaseSDK):
|
|
|
391
395
|
|
|
392
396
|
http_res = await self.do_request_async(
|
|
393
397
|
hook_ctx=HookContext(
|
|
398
|
+
config=self.sdk_configuration,
|
|
394
399
|
base_url=base_url or "",
|
|
395
400
|
operation_id="get-plan",
|
|
396
401
|
oauth2_scopes=[],
|
|
@@ -434,17 +439,21 @@ class Plans(BaseSDK):
|
|
|
434
439
|
*,
|
|
435
440
|
api_version: Optional[str] = "2023-06-01",
|
|
436
441
|
filter_id: Optional[str] = None,
|
|
442
|
+
page_size: Optional[int] = 20,
|
|
443
|
+
page_number: Optional[int] = 1,
|
|
437
444
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
438
445
|
server_url: Optional[str] = None,
|
|
439
446
|
timeout_ms: Optional[int] = None,
|
|
440
447
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
441
|
-
) -> models.
|
|
448
|
+
) -> Optional[models.GetBandwidthPlansResponse]:
|
|
442
449
|
r"""List all bandwidth plans
|
|
443
450
|
|
|
444
451
|
Lists all bandwidth plans.
|
|
445
452
|
|
|
446
453
|
:param api_version:
|
|
447
454
|
:param filter_id: The plan ID to filter by
|
|
455
|
+
:param page_size: Number of items to return per page
|
|
456
|
+
:param page_number: Page number to return (starts at 1)
|
|
448
457
|
:param retries: Override the default retry configuration for this method
|
|
449
458
|
:param server_url: Override the default server URL for this method
|
|
450
459
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -463,6 +472,8 @@ class Plans(BaseSDK):
|
|
|
463
472
|
request = models.GetBandwidthPlansRequest(
|
|
464
473
|
api_version=api_version,
|
|
465
474
|
filter_id=filter_id,
|
|
475
|
+
page_size=page_size,
|
|
476
|
+
page_number=page_number,
|
|
466
477
|
)
|
|
467
478
|
|
|
468
479
|
req = self._build_request(
|
|
@@ -491,6 +502,7 @@ class Plans(BaseSDK):
|
|
|
491
502
|
|
|
492
503
|
http_res = self.do_request(
|
|
493
504
|
hook_ctx=HookContext(
|
|
505
|
+
config=self.sdk_configuration,
|
|
494
506
|
base_url=base_url or "",
|
|
495
507
|
operation_id="get-bandwidth-plans",
|
|
496
508
|
oauth2_scopes=[],
|
|
@@ -503,8 +515,33 @@ class Plans(BaseSDK):
|
|
|
503
515
|
retry_config=retry_config,
|
|
504
516
|
)
|
|
505
517
|
|
|
518
|
+
def next_func() -> Optional[models.GetBandwidthPlansResponse]:
|
|
519
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
520
|
+
page = request.page_number if not request.page_number is None else 1
|
|
521
|
+
next_page = page + 1
|
|
522
|
+
|
|
523
|
+
if not http_res.text:
|
|
524
|
+
return None
|
|
525
|
+
results = JSONPath("$.data").parse(body)
|
|
526
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
527
|
+
return None
|
|
528
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
529
|
+
if len(results[0]) < limit:
|
|
530
|
+
return None
|
|
531
|
+
|
|
532
|
+
return self.list_bandwidth(
|
|
533
|
+
api_version=api_version,
|
|
534
|
+
filter_id=filter_id,
|
|
535
|
+
page_size=page_size,
|
|
536
|
+
page_number=next_page,
|
|
537
|
+
retries=retries,
|
|
538
|
+
)
|
|
539
|
+
|
|
506
540
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
507
|
-
return
|
|
541
|
+
return models.GetBandwidthPlansResponse(
|
|
542
|
+
result=utils.unmarshal_json(http_res.text, models.BandwidthPlans),
|
|
543
|
+
next=next_func,
|
|
544
|
+
)
|
|
508
545
|
if utils.match_response(http_res, "4XX", "*"):
|
|
509
546
|
http_res_text = utils.stream_to_text(http_res)
|
|
510
547
|
raise models.APIError(
|
|
@@ -530,17 +567,21 @@ class Plans(BaseSDK):
|
|
|
530
567
|
*,
|
|
531
568
|
api_version: Optional[str] = "2023-06-01",
|
|
532
569
|
filter_id: Optional[str] = None,
|
|
570
|
+
page_size: Optional[int] = 20,
|
|
571
|
+
page_number: Optional[int] = 1,
|
|
533
572
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
534
573
|
server_url: Optional[str] = None,
|
|
535
574
|
timeout_ms: Optional[int] = None,
|
|
536
575
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
537
|
-
) -> models.
|
|
576
|
+
) -> Optional[models.GetBandwidthPlansResponse]:
|
|
538
577
|
r"""List all bandwidth plans
|
|
539
578
|
|
|
540
579
|
Lists all bandwidth plans.
|
|
541
580
|
|
|
542
581
|
:param api_version:
|
|
543
582
|
:param filter_id: The plan ID to filter by
|
|
583
|
+
:param page_size: Number of items to return per page
|
|
584
|
+
:param page_number: Page number to return (starts at 1)
|
|
544
585
|
:param retries: Override the default retry configuration for this method
|
|
545
586
|
:param server_url: Override the default server URL for this method
|
|
546
587
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -559,6 +600,8 @@ class Plans(BaseSDK):
|
|
|
559
600
|
request = models.GetBandwidthPlansRequest(
|
|
560
601
|
api_version=api_version,
|
|
561
602
|
filter_id=filter_id,
|
|
603
|
+
page_size=page_size,
|
|
604
|
+
page_number=page_number,
|
|
562
605
|
)
|
|
563
606
|
|
|
564
607
|
req = self._build_request_async(
|
|
@@ -587,6 +630,7 @@ class Plans(BaseSDK):
|
|
|
587
630
|
|
|
588
631
|
http_res = await self.do_request_async(
|
|
589
632
|
hook_ctx=HookContext(
|
|
633
|
+
config=self.sdk_configuration,
|
|
590
634
|
base_url=base_url or "",
|
|
591
635
|
operation_id="get-bandwidth-plans",
|
|
592
636
|
oauth2_scopes=[],
|
|
@@ -599,8 +643,33 @@ class Plans(BaseSDK):
|
|
|
599
643
|
retry_config=retry_config,
|
|
600
644
|
)
|
|
601
645
|
|
|
646
|
+
def next_func() -> Optional[models.GetBandwidthPlansResponse]:
|
|
647
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
648
|
+
page = request.page_number if not request.page_number is None else 1
|
|
649
|
+
next_page = page + 1
|
|
650
|
+
|
|
651
|
+
if not http_res.text:
|
|
652
|
+
return None
|
|
653
|
+
results = JSONPath("$.data").parse(body)
|
|
654
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
655
|
+
return None
|
|
656
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
657
|
+
if len(results[0]) < limit:
|
|
658
|
+
return None
|
|
659
|
+
|
|
660
|
+
return self.list_bandwidth(
|
|
661
|
+
api_version=api_version,
|
|
662
|
+
filter_id=filter_id,
|
|
663
|
+
page_size=page_size,
|
|
664
|
+
page_number=next_page,
|
|
665
|
+
retries=retries,
|
|
666
|
+
)
|
|
667
|
+
|
|
602
668
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
603
|
-
return
|
|
669
|
+
return models.GetBandwidthPlansResponse(
|
|
670
|
+
result=utils.unmarshal_json(http_res.text, models.BandwidthPlans),
|
|
671
|
+
next=next_func,
|
|
672
|
+
)
|
|
604
673
|
if utils.match_response(http_res, "4XX", "*"):
|
|
605
674
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
606
675
|
raise models.APIError(
|
|
@@ -624,10 +693,12 @@ class Plans(BaseSDK):
|
|
|
624
693
|
def update_bandwidth(
|
|
625
694
|
self,
|
|
626
695
|
*,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
696
|
+
data: Optional[
|
|
697
|
+
Union[
|
|
698
|
+
models.UpdatePlansBandwidthPlansData,
|
|
699
|
+
models.UpdatePlansBandwidthPlansDataTypedDict,
|
|
700
|
+
]
|
|
701
|
+
] = None,
|
|
631
702
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
632
703
|
server_url: Optional[str] = None,
|
|
633
704
|
timeout_ms: Optional[int] = None,
|
|
@@ -638,7 +709,7 @@ class Plans(BaseSDK):
|
|
|
638
709
|
Allow to increase or decrease bandwidth packages. Only admins and owners can request.
|
|
639
710
|
|
|
640
711
|
|
|
641
|
-
:param
|
|
712
|
+
:param data:
|
|
642
713
|
:param retries: Override the default retry configuration for this method
|
|
643
714
|
:param server_url: Override the default server URL for this method
|
|
644
715
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -654,11 +725,11 @@ class Plans(BaseSDK):
|
|
|
654
725
|
else:
|
|
655
726
|
base_url = self._get_url(base_url, url_variables)
|
|
656
727
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
)
|
|
661
|
-
|
|
728
|
+
request = models.UpdatePlansBandwidthPlansRequestBody(
|
|
729
|
+
data=utils.get_pydantic_model(
|
|
730
|
+
data, Optional[models.UpdatePlansBandwidthPlansData]
|
|
731
|
+
),
|
|
732
|
+
)
|
|
662
733
|
|
|
663
734
|
req = self._build_request(
|
|
664
735
|
method="POST",
|
|
@@ -676,9 +747,9 @@ class Plans(BaseSDK):
|
|
|
676
747
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
677
748
|
request,
|
|
678
749
|
False,
|
|
679
|
-
|
|
750
|
+
False,
|
|
680
751
|
"json",
|
|
681
|
-
|
|
752
|
+
models.UpdatePlansBandwidthPlansRequestBody,
|
|
682
753
|
),
|
|
683
754
|
timeout_ms=timeout_ms,
|
|
684
755
|
)
|
|
@@ -693,6 +764,7 @@ class Plans(BaseSDK):
|
|
|
693
764
|
|
|
694
765
|
http_res = self.do_request(
|
|
695
766
|
hook_ctx=HookContext(
|
|
767
|
+
config=self.sdk_configuration,
|
|
696
768
|
base_url=base_url or "",
|
|
697
769
|
operation_id="update-plans-bandwidth",
|
|
698
770
|
oauth2_scopes=[],
|
|
@@ -734,10 +806,12 @@ class Plans(BaseSDK):
|
|
|
734
806
|
async def update_bandwidth_async(
|
|
735
807
|
self,
|
|
736
808
|
*,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
809
|
+
data: Optional[
|
|
810
|
+
Union[
|
|
811
|
+
models.UpdatePlansBandwidthPlansData,
|
|
812
|
+
models.UpdatePlansBandwidthPlansDataTypedDict,
|
|
813
|
+
]
|
|
814
|
+
] = None,
|
|
741
815
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
742
816
|
server_url: Optional[str] = None,
|
|
743
817
|
timeout_ms: Optional[int] = None,
|
|
@@ -748,7 +822,7 @@ class Plans(BaseSDK):
|
|
|
748
822
|
Allow to increase or decrease bandwidth packages. Only admins and owners can request.
|
|
749
823
|
|
|
750
824
|
|
|
751
|
-
:param
|
|
825
|
+
:param data:
|
|
752
826
|
:param retries: Override the default retry configuration for this method
|
|
753
827
|
:param server_url: Override the default server URL for this method
|
|
754
828
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -764,11 +838,11 @@ class Plans(BaseSDK):
|
|
|
764
838
|
else:
|
|
765
839
|
base_url = self._get_url(base_url, url_variables)
|
|
766
840
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
)
|
|
771
|
-
|
|
841
|
+
request = models.UpdatePlansBandwidthPlansRequestBody(
|
|
842
|
+
data=utils.get_pydantic_model(
|
|
843
|
+
data, Optional[models.UpdatePlansBandwidthPlansData]
|
|
844
|
+
),
|
|
845
|
+
)
|
|
772
846
|
|
|
773
847
|
req = self._build_request_async(
|
|
774
848
|
method="POST",
|
|
@@ -786,9 +860,9 @@ class Plans(BaseSDK):
|
|
|
786
860
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
787
861
|
request,
|
|
788
862
|
False,
|
|
789
|
-
|
|
863
|
+
False,
|
|
790
864
|
"json",
|
|
791
|
-
|
|
865
|
+
models.UpdatePlansBandwidthPlansRequestBody,
|
|
792
866
|
),
|
|
793
867
|
timeout_ms=timeout_ms,
|
|
794
868
|
)
|
|
@@ -803,6 +877,7 @@ class Plans(BaseSDK):
|
|
|
803
877
|
|
|
804
878
|
http_res = await self.do_request_async(
|
|
805
879
|
hook_ctx=HookContext(
|
|
880
|
+
config=self.sdk_configuration,
|
|
806
881
|
base_url=base_url or "",
|
|
807
882
|
operation_id="update-plans-bandwidth",
|
|
808
883
|
oauth2_scopes=[],
|
|
@@ -891,6 +966,7 @@ class Plans(BaseSDK):
|
|
|
891
966
|
|
|
892
967
|
http_res = self.do_request(
|
|
893
968
|
hook_ctx=HookContext(
|
|
969
|
+
config=self.sdk_configuration,
|
|
894
970
|
base_url=base_url or "",
|
|
895
971
|
operation_id="get-storage-plans",
|
|
896
972
|
oauth2_scopes=[],
|
|
@@ -975,6 +1051,7 @@ class Plans(BaseSDK):
|
|
|
975
1051
|
|
|
976
1052
|
http_res = await self.do_request_async(
|
|
977
1053
|
hook_ctx=HookContext(
|
|
1054
|
+
config=self.sdk_configuration,
|
|
978
1055
|
base_url=base_url or "",
|
|
979
1056
|
operation_id="get-storage-plans",
|
|
980
1057
|
oauth2_scopes=[],
|
|
@@ -1059,6 +1136,7 @@ class Plans(BaseSDK):
|
|
|
1059
1136
|
|
|
1060
1137
|
http_res = self.do_request(
|
|
1061
1138
|
hook_ctx=HookContext(
|
|
1139
|
+
config=self.sdk_configuration,
|
|
1062
1140
|
base_url=base_url or "",
|
|
1063
1141
|
operation_id="get-vm-plans",
|
|
1064
1142
|
oauth2_scopes=[],
|
|
@@ -1143,6 +1221,7 @@ class Plans(BaseSDK):
|
|
|
1143
1221
|
|
|
1144
1222
|
http_res = await self.do_request_async(
|
|
1145
1223
|
hook_ctx=HookContext(
|
|
1224
|
+
config=self.sdk_configuration,
|
|
1146
1225
|
base_url=base_url or "",
|
|
1147
1226
|
operation_id="get-vm-plans",
|
|
1148
1227
|
oauth2_scopes=[],
|