latitudesh-python-sdk 0.0.8__py3-none-any.whl → 1.1.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/_version.py +3 -3
- latitudesh_python_sdk/events_sdk.py +84 -5
- latitudesh_python_sdk/firewalls_sdk.py +130 -9
- latitudesh_python_sdk/ipaddresses_sdk.py +78 -5
- latitudesh_python_sdk/models/__init__.py +108 -19
- latitudesh_python_sdk/models/billing_usage.py +3 -0
- 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_team_membersop.py +42 -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/server.py +11 -11
- latitudesh_python_sdk/models/virtual_networks.py +1 -1
- latitudesh_python_sdk/operatingsystems_sdk.py +76 -9
- latitudesh_python_sdk/plans.py +68 -5
- latitudesh_python_sdk/privatenetworks.py +142 -9
- latitudesh_python_sdk/projects_sdk.py +78 -5
- latitudesh_python_sdk/regions_sdk.py +74 -7
- latitudesh_python_sdk/roles.py +74 -7
- latitudesh_python_sdk/servers_sdk.py +94 -5
- latitudesh_python_sdk/teamsmembers.py +74 -7
- latitudesh_python_sdk/utils/__init__.py +1 -0
- latitudesh_python_sdk/utils/datetimes.py +23 -0
- latitudesh_python_sdk/utils/serializers.py +32 -3
- {latitudesh_python_sdk-0.0.8.dist-info → latitudesh_python_sdk-1.1.0.dist-info}/METADATA +31 -5
- {latitudesh_python_sdk-0.0.8.dist-info → latitudesh_python_sdk-1.1.0.dist-info}/RECORD +38 -35
- latitudesh_python_sdk/models/{deploy_config_error.py → deploy_config.py} +8 -8
- latitudesh_python_sdk/models/{virtual_network_error.py → virtual_network.py} +14 -14
- {latitudesh_python_sdk-0.0.8.dist-info → latitudesh_python_sdk-1.1.0.dist-info}/LICENSE +0 -0
- {latitudesh_python_sdk-0.0.8.dist-info → latitudesh_python_sdk-1.1.0.dist-info}/WHEEL +0 -0
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "latitudesh-python-sdk"
|
|
6
|
-
__version__: str = "
|
|
6
|
+
__version__: str = "1.1.0"
|
|
7
7
|
__openapi_doc_version__: str = "v3"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python
|
|
8
|
+
__gen_version__: str = "2.593.4"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 1.1.0 2.593.4 v3 latitudesh-python-sdk"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
|
@@ -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
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 List, Mapping, Optional
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class EventsSDK(BaseSDK):
|
|
@@ -20,11 +21,13 @@ class EventsSDK(BaseSDK):
|
|
|
20
21
|
filter_created_at_gte: Optional[str] = None,
|
|
21
22
|
filter_created_at_lte: Optional[str] = None,
|
|
22
23
|
filter_created_at: Optional[List[str]] = None,
|
|
24
|
+
page_size: Optional[int] = 20,
|
|
25
|
+
page_number: Optional[int] = 1,
|
|
23
26
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
24
27
|
server_url: Optional[str] = None,
|
|
25
28
|
timeout_ms: Optional[int] = None,
|
|
26
29
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
27
|
-
) -> models.
|
|
30
|
+
) -> Optional[models.GetEventsResponse]:
|
|
28
31
|
r"""List all Events
|
|
29
32
|
|
|
30
33
|
Lists all events.
|
|
@@ -38,6 +41,8 @@ class EventsSDK(BaseSDK):
|
|
|
38
41
|
:param filter_created_at_gte: The created at greater than equal date to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
39
42
|
:param filter_created_at_lte: The created at less than equal date to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
40
43
|
:param filter_created_at: The created at between date range date1, date2 (inclusive) to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
44
|
+
:param page_size: Number of items to return per page
|
|
45
|
+
:param page_number: Page number to return (starts at 1)
|
|
41
46
|
:param retries: Override the default retry configuration for this method
|
|
42
47
|
:param server_url: Override the default server URL for this method
|
|
43
48
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -62,6 +67,8 @@ class EventsSDK(BaseSDK):
|
|
|
62
67
|
filter_created_at_gte=filter_created_at_gte,
|
|
63
68
|
filter_created_at_lte=filter_created_at_lte,
|
|
64
69
|
filter_created_at=filter_created_at,
|
|
70
|
+
page_size=page_size,
|
|
71
|
+
page_number=page_number,
|
|
65
72
|
)
|
|
66
73
|
|
|
67
74
|
req = self._build_request(
|
|
@@ -102,8 +109,41 @@ class EventsSDK(BaseSDK):
|
|
|
102
109
|
retry_config=retry_config,
|
|
103
110
|
)
|
|
104
111
|
|
|
112
|
+
def next_func() -> Optional[models.GetEventsResponse]:
|
|
113
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
114
|
+
page = request.page_number if not request.page_number is None else 1
|
|
115
|
+
next_page = page + 1
|
|
116
|
+
|
|
117
|
+
if not http_res.text:
|
|
118
|
+
return None
|
|
119
|
+
results = JSONPath("$.data").parse(body)
|
|
120
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
121
|
+
return None
|
|
122
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
123
|
+
if len(results[0]) < limit:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
return self.list(
|
|
127
|
+
filter_author=filter_author,
|
|
128
|
+
filter_project=filter_project,
|
|
129
|
+
filter_target_name=filter_target_name,
|
|
130
|
+
filter_target_id=filter_target_id,
|
|
131
|
+
filter_action=filter_action,
|
|
132
|
+
filter_created_at_gte=filter_created_at_gte,
|
|
133
|
+
filter_created_at_lte=filter_created_at_lte,
|
|
134
|
+
filter_created_at=filter_created_at,
|
|
135
|
+
page_size=page_size,
|
|
136
|
+
page_number=next_page,
|
|
137
|
+
retries=retries,
|
|
138
|
+
)
|
|
139
|
+
|
|
105
140
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
106
|
-
return
|
|
141
|
+
return models.GetEventsResponse(
|
|
142
|
+
result=utils.unmarshal_json(
|
|
143
|
+
http_res.text, models.GetEventsResponseBody
|
|
144
|
+
),
|
|
145
|
+
next=next_func,
|
|
146
|
+
)
|
|
107
147
|
if utils.match_response(http_res, "4XX", "*"):
|
|
108
148
|
http_res_text = utils.stream_to_text(http_res)
|
|
109
149
|
raise models.APIError(
|
|
@@ -135,11 +175,13 @@ class EventsSDK(BaseSDK):
|
|
|
135
175
|
filter_created_at_gte: Optional[str] = None,
|
|
136
176
|
filter_created_at_lte: Optional[str] = None,
|
|
137
177
|
filter_created_at: Optional[List[str]] = None,
|
|
178
|
+
page_size: Optional[int] = 20,
|
|
179
|
+
page_number: Optional[int] = 1,
|
|
138
180
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
139
181
|
server_url: Optional[str] = None,
|
|
140
182
|
timeout_ms: Optional[int] = None,
|
|
141
183
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
142
|
-
) -> models.
|
|
184
|
+
) -> Optional[models.GetEventsResponse]:
|
|
143
185
|
r"""List all Events
|
|
144
186
|
|
|
145
187
|
Lists all events.
|
|
@@ -153,6 +195,8 @@ class EventsSDK(BaseSDK):
|
|
|
153
195
|
:param filter_created_at_gte: The created at greater than equal date to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
154
196
|
:param filter_created_at_lte: The created at less than equal date to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
155
197
|
:param filter_created_at: The created at between date range date1, date2 (inclusive) to filter by, in ISO formatting (yyyy-MM-dd'T'HH:mm:ss)
|
|
198
|
+
:param page_size: Number of items to return per page
|
|
199
|
+
:param page_number: Page number to return (starts at 1)
|
|
156
200
|
:param retries: Override the default retry configuration for this method
|
|
157
201
|
:param server_url: Override the default server URL for this method
|
|
158
202
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -177,6 +221,8 @@ class EventsSDK(BaseSDK):
|
|
|
177
221
|
filter_created_at_gte=filter_created_at_gte,
|
|
178
222
|
filter_created_at_lte=filter_created_at_lte,
|
|
179
223
|
filter_created_at=filter_created_at,
|
|
224
|
+
page_size=page_size,
|
|
225
|
+
page_number=page_number,
|
|
180
226
|
)
|
|
181
227
|
|
|
182
228
|
req = self._build_request_async(
|
|
@@ -217,8 +263,41 @@ class EventsSDK(BaseSDK):
|
|
|
217
263
|
retry_config=retry_config,
|
|
218
264
|
)
|
|
219
265
|
|
|
266
|
+
def next_func() -> Optional[models.GetEventsResponse]:
|
|
267
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
268
|
+
page = request.page_number if not request.page_number is None else 1
|
|
269
|
+
next_page = page + 1
|
|
270
|
+
|
|
271
|
+
if not http_res.text:
|
|
272
|
+
return None
|
|
273
|
+
results = JSONPath("$.data").parse(body)
|
|
274
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
275
|
+
return None
|
|
276
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
277
|
+
if len(results[0]) < limit:
|
|
278
|
+
return None
|
|
279
|
+
|
|
280
|
+
return self.list(
|
|
281
|
+
filter_author=filter_author,
|
|
282
|
+
filter_project=filter_project,
|
|
283
|
+
filter_target_name=filter_target_name,
|
|
284
|
+
filter_target_id=filter_target_id,
|
|
285
|
+
filter_action=filter_action,
|
|
286
|
+
filter_created_at_gte=filter_created_at_gte,
|
|
287
|
+
filter_created_at_lte=filter_created_at_lte,
|
|
288
|
+
filter_created_at=filter_created_at,
|
|
289
|
+
page_size=page_size,
|
|
290
|
+
page_number=next_page,
|
|
291
|
+
retries=retries,
|
|
292
|
+
)
|
|
293
|
+
|
|
220
294
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
221
|
-
return
|
|
295
|
+
return models.GetEventsResponse(
|
|
296
|
+
result=utils.unmarshal_json(
|
|
297
|
+
http_res.text, models.GetEventsResponseBody
|
|
298
|
+
),
|
|
299
|
+
next=next_func,
|
|
300
|
+
)
|
|
222
301
|
if utils.match_response(http_res, "4XX", "*"):
|
|
223
302
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
224
303
|
raise models.APIError(
|
|
@@ -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
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 FirewallsSDK(BaseSDK):
|
|
@@ -219,16 +220,20 @@ class FirewallsSDK(BaseSDK):
|
|
|
219
220
|
self,
|
|
220
221
|
*,
|
|
221
222
|
filter_project: Optional[str] = None,
|
|
223
|
+
page_size: Optional[int] = 20,
|
|
224
|
+
page_number: Optional[int] = 1,
|
|
222
225
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
223
226
|
server_url: Optional[str] = None,
|
|
224
227
|
timeout_ms: Optional[int] = None,
|
|
225
228
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
226
|
-
) -> models.
|
|
229
|
+
) -> Optional[models.ListFirewallsResponse]:
|
|
227
230
|
r"""List firewalls
|
|
228
231
|
|
|
229
232
|
List firewalls
|
|
230
233
|
|
|
231
234
|
:param filter_project:
|
|
235
|
+
:param page_size: Number of items to return per page
|
|
236
|
+
:param page_number: Page number to return (starts at 1)
|
|
232
237
|
:param retries: Override the default retry configuration for this method
|
|
233
238
|
:param server_url: Override the default server URL for this method
|
|
234
239
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -246,6 +251,8 @@ class FirewallsSDK(BaseSDK):
|
|
|
246
251
|
|
|
247
252
|
request = models.ListFirewallsRequest(
|
|
248
253
|
filter_project=filter_project,
|
|
254
|
+
page_size=page_size,
|
|
255
|
+
page_number=page_number,
|
|
249
256
|
)
|
|
250
257
|
|
|
251
258
|
req = self._build_request(
|
|
@@ -286,8 +293,32 @@ class FirewallsSDK(BaseSDK):
|
|
|
286
293
|
retry_config=retry_config,
|
|
287
294
|
)
|
|
288
295
|
|
|
296
|
+
def next_func() -> Optional[models.ListFirewallsResponse]:
|
|
297
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
298
|
+
page = request.page_number if not request.page_number is None else 1
|
|
299
|
+
next_page = page + 1
|
|
300
|
+
|
|
301
|
+
if not http_res.text:
|
|
302
|
+
return None
|
|
303
|
+
results = JSONPath("$.data").parse(body)
|
|
304
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
305
|
+
return None
|
|
306
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
307
|
+
if len(results[0]) < limit:
|
|
308
|
+
return None
|
|
309
|
+
|
|
310
|
+
return self.list(
|
|
311
|
+
filter_project=filter_project,
|
|
312
|
+
page_size=page_size,
|
|
313
|
+
page_number=next_page,
|
|
314
|
+
retries=retries,
|
|
315
|
+
)
|
|
316
|
+
|
|
289
317
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
290
|
-
return
|
|
318
|
+
return models.ListFirewallsResponse(
|
|
319
|
+
result=utils.unmarshal_json(http_res.text, models.Firewalls),
|
|
320
|
+
next=next_func,
|
|
321
|
+
)
|
|
291
322
|
if utils.match_response(http_res, "4XX", "*"):
|
|
292
323
|
http_res_text = utils.stream_to_text(http_res)
|
|
293
324
|
raise models.APIError(
|
|
@@ -312,16 +343,20 @@ class FirewallsSDK(BaseSDK):
|
|
|
312
343
|
self,
|
|
313
344
|
*,
|
|
314
345
|
filter_project: Optional[str] = None,
|
|
346
|
+
page_size: Optional[int] = 20,
|
|
347
|
+
page_number: Optional[int] = 1,
|
|
315
348
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
316
349
|
server_url: Optional[str] = None,
|
|
317
350
|
timeout_ms: Optional[int] = None,
|
|
318
351
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
319
|
-
) -> models.
|
|
352
|
+
) -> Optional[models.ListFirewallsResponse]:
|
|
320
353
|
r"""List firewalls
|
|
321
354
|
|
|
322
355
|
List firewalls
|
|
323
356
|
|
|
324
357
|
:param filter_project:
|
|
358
|
+
:param page_size: Number of items to return per page
|
|
359
|
+
:param page_number: Page number to return (starts at 1)
|
|
325
360
|
:param retries: Override the default retry configuration for this method
|
|
326
361
|
:param server_url: Override the default server URL for this method
|
|
327
362
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -339,6 +374,8 @@ class FirewallsSDK(BaseSDK):
|
|
|
339
374
|
|
|
340
375
|
request = models.ListFirewallsRequest(
|
|
341
376
|
filter_project=filter_project,
|
|
377
|
+
page_size=page_size,
|
|
378
|
+
page_number=page_number,
|
|
342
379
|
)
|
|
343
380
|
|
|
344
381
|
req = self._build_request_async(
|
|
@@ -379,8 +416,32 @@ class FirewallsSDK(BaseSDK):
|
|
|
379
416
|
retry_config=retry_config,
|
|
380
417
|
)
|
|
381
418
|
|
|
419
|
+
def next_func() -> Optional[models.ListFirewallsResponse]:
|
|
420
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
421
|
+
page = request.page_number if not request.page_number is None else 1
|
|
422
|
+
next_page = page + 1
|
|
423
|
+
|
|
424
|
+
if not http_res.text:
|
|
425
|
+
return None
|
|
426
|
+
results = JSONPath("$.data").parse(body)
|
|
427
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
428
|
+
return None
|
|
429
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
430
|
+
if len(results[0]) < limit:
|
|
431
|
+
return None
|
|
432
|
+
|
|
433
|
+
return self.list(
|
|
434
|
+
filter_project=filter_project,
|
|
435
|
+
page_size=page_size,
|
|
436
|
+
page_number=next_page,
|
|
437
|
+
retries=retries,
|
|
438
|
+
)
|
|
439
|
+
|
|
382
440
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
383
|
-
return
|
|
441
|
+
return models.ListFirewallsResponse(
|
|
442
|
+
result=utils.unmarshal_json(http_res.text, models.Firewalls),
|
|
443
|
+
next=next_func,
|
|
444
|
+
)
|
|
384
445
|
if utils.match_response(http_res, "4XX", "*"):
|
|
385
446
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
386
447
|
raise models.APIError(
|
|
@@ -1249,16 +1310,20 @@ class FirewallsSDK(BaseSDK):
|
|
|
1249
1310
|
self,
|
|
1250
1311
|
*,
|
|
1251
1312
|
firewall_id: str,
|
|
1313
|
+
page_size: Optional[int] = 20,
|
|
1314
|
+
page_number: Optional[int] = 1,
|
|
1252
1315
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1253
1316
|
server_url: Optional[str] = None,
|
|
1254
1317
|
timeout_ms: Optional[int] = None,
|
|
1255
1318
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1256
|
-
) -> models.
|
|
1319
|
+
) -> Optional[models.GetFirewallAssignmentsResponse]:
|
|
1257
1320
|
r"""Firewall Assignments
|
|
1258
1321
|
|
|
1259
1322
|
List servers assigned to a firewall
|
|
1260
1323
|
|
|
1261
1324
|
:param firewall_id: The Firewall ID
|
|
1325
|
+
:param page_size: Number of items to return per page
|
|
1326
|
+
:param page_number: Page number to return (starts at 1)
|
|
1262
1327
|
:param retries: Override the default retry configuration for this method
|
|
1263
1328
|
:param server_url: Override the default server URL for this method
|
|
1264
1329
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1276,6 +1341,8 @@ class FirewallsSDK(BaseSDK):
|
|
|
1276
1341
|
|
|
1277
1342
|
request = models.GetFirewallAssignmentsRequest(
|
|
1278
1343
|
firewall_id=firewall_id,
|
|
1344
|
+
page_size=page_size,
|
|
1345
|
+
page_number=page_number,
|
|
1279
1346
|
)
|
|
1280
1347
|
|
|
1281
1348
|
req = self._build_request(
|
|
@@ -1316,9 +1383,33 @@ class FirewallsSDK(BaseSDK):
|
|
|
1316
1383
|
retry_config=retry_config,
|
|
1317
1384
|
)
|
|
1318
1385
|
|
|
1386
|
+
def next_func() -> Optional[models.GetFirewallAssignmentsResponse]:
|
|
1387
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
1388
|
+
page = request.page_number if not request.page_number is None else 1
|
|
1389
|
+
next_page = page + 1
|
|
1390
|
+
|
|
1391
|
+
if not http_res.text:
|
|
1392
|
+
return None
|
|
1393
|
+
results = JSONPath("$.data").parse(body)
|
|
1394
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
1395
|
+
return None
|
|
1396
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
1397
|
+
if len(results[0]) < limit:
|
|
1398
|
+
return None
|
|
1399
|
+
|
|
1400
|
+
return self.list_assignments(
|
|
1401
|
+
firewall_id=firewall_id,
|
|
1402
|
+
page_size=page_size,
|
|
1403
|
+
page_number=next_page,
|
|
1404
|
+
retries=retries,
|
|
1405
|
+
)
|
|
1406
|
+
|
|
1319
1407
|
response_data: Any = None
|
|
1320
1408
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1321
|
-
return
|
|
1409
|
+
return models.GetFirewallAssignmentsResponse(
|
|
1410
|
+
result=utils.unmarshal_json(http_res.text, models.FirewallServer),
|
|
1411
|
+
next=next_func,
|
|
1412
|
+
)
|
|
1322
1413
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
1323
1414
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
1324
1415
|
raise models.ErrorObject(data=response_data)
|
|
@@ -1346,16 +1437,20 @@ class FirewallsSDK(BaseSDK):
|
|
|
1346
1437
|
self,
|
|
1347
1438
|
*,
|
|
1348
1439
|
firewall_id: str,
|
|
1440
|
+
page_size: Optional[int] = 20,
|
|
1441
|
+
page_number: Optional[int] = 1,
|
|
1349
1442
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1350
1443
|
server_url: Optional[str] = None,
|
|
1351
1444
|
timeout_ms: Optional[int] = None,
|
|
1352
1445
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1353
|
-
) -> models.
|
|
1446
|
+
) -> Optional[models.GetFirewallAssignmentsResponse]:
|
|
1354
1447
|
r"""Firewall Assignments
|
|
1355
1448
|
|
|
1356
1449
|
List servers assigned to a firewall
|
|
1357
1450
|
|
|
1358
1451
|
:param firewall_id: The Firewall ID
|
|
1452
|
+
:param page_size: Number of items to return per page
|
|
1453
|
+
:param page_number: Page number to return (starts at 1)
|
|
1359
1454
|
:param retries: Override the default retry configuration for this method
|
|
1360
1455
|
:param server_url: Override the default server URL for this method
|
|
1361
1456
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1373,6 +1468,8 @@ class FirewallsSDK(BaseSDK):
|
|
|
1373
1468
|
|
|
1374
1469
|
request = models.GetFirewallAssignmentsRequest(
|
|
1375
1470
|
firewall_id=firewall_id,
|
|
1471
|
+
page_size=page_size,
|
|
1472
|
+
page_number=page_number,
|
|
1376
1473
|
)
|
|
1377
1474
|
|
|
1378
1475
|
req = self._build_request_async(
|
|
@@ -1413,9 +1510,33 @@ class FirewallsSDK(BaseSDK):
|
|
|
1413
1510
|
retry_config=retry_config,
|
|
1414
1511
|
)
|
|
1415
1512
|
|
|
1513
|
+
def next_func() -> Optional[models.GetFirewallAssignmentsResponse]:
|
|
1514
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
1515
|
+
page = request.page_number if not request.page_number is None else 1
|
|
1516
|
+
next_page = page + 1
|
|
1517
|
+
|
|
1518
|
+
if not http_res.text:
|
|
1519
|
+
return None
|
|
1520
|
+
results = JSONPath("$.data").parse(body)
|
|
1521
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
1522
|
+
return None
|
|
1523
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
1524
|
+
if len(results[0]) < limit:
|
|
1525
|
+
return None
|
|
1526
|
+
|
|
1527
|
+
return self.list_assignments(
|
|
1528
|
+
firewall_id=firewall_id,
|
|
1529
|
+
page_size=page_size,
|
|
1530
|
+
page_number=next_page,
|
|
1531
|
+
retries=retries,
|
|
1532
|
+
)
|
|
1533
|
+
|
|
1416
1534
|
response_data: Any = None
|
|
1417
1535
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1418
|
-
return
|
|
1536
|
+
return models.GetFirewallAssignmentsResponse(
|
|
1537
|
+
result=utils.unmarshal_json(http_res.text, models.FirewallServer),
|
|
1538
|
+
next=next_func,
|
|
1539
|
+
)
|
|
1419
1540
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
1420
1541
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
1421
1542
|
raise models.ErrorObject(data=response_data)
|
|
@@ -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
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
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class IPAddressesSDK(BaseSDK):
|
|
@@ -19,11 +20,13 @@ class IPAddressesSDK(BaseSDK):
|
|
|
19
20
|
filter_location: Optional[str] = None,
|
|
20
21
|
filter_address: Optional[str] = None,
|
|
21
22
|
extra_fields_ip_addresses: Optional[str] = None,
|
|
23
|
+
page_size: Optional[int] = 20,
|
|
24
|
+
page_number: Optional[int] = 1,
|
|
22
25
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
23
26
|
server_url: Optional[str] = None,
|
|
24
27
|
timeout_ms: Optional[int] = None,
|
|
25
28
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
26
|
-
) -> models.
|
|
29
|
+
) -> Optional[models.GetIpsResponse]:
|
|
27
30
|
r"""List IPs
|
|
28
31
|
|
|
29
32
|
List all Management and Additional IP Addresses.
|
|
@@ -39,6 +42,8 @@ class IPAddressesSDK(BaseSDK):
|
|
|
39
42
|
:param filter_location: The site slug to filter by
|
|
40
43
|
:param filter_address: The address of IP to filter by starts_with
|
|
41
44
|
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
45
|
+
:param page_size: Number of items to return per page
|
|
46
|
+
:param page_number: Page number to return (starts at 1)
|
|
42
47
|
:param retries: Override the default retry configuration for this method
|
|
43
48
|
:param server_url: Override the default server URL for this method
|
|
44
49
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -62,6 +67,8 @@ class IPAddressesSDK(BaseSDK):
|
|
|
62
67
|
filter_location=filter_location,
|
|
63
68
|
filter_address=filter_address,
|
|
64
69
|
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
70
|
+
page_size=page_size,
|
|
71
|
+
page_number=page_number,
|
|
65
72
|
)
|
|
66
73
|
|
|
67
74
|
req = self._build_request(
|
|
@@ -102,9 +109,39 @@ class IPAddressesSDK(BaseSDK):
|
|
|
102
109
|
retry_config=retry_config,
|
|
103
110
|
)
|
|
104
111
|
|
|
112
|
+
def next_func() -> Optional[models.GetIpsResponse]:
|
|
113
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
114
|
+
page = request.page_number if not request.page_number is None else 1
|
|
115
|
+
next_page = page + 1
|
|
116
|
+
|
|
117
|
+
if not http_res.text:
|
|
118
|
+
return None
|
|
119
|
+
results = JSONPath("$.data").parse(body)
|
|
120
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
121
|
+
return None
|
|
122
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
123
|
+
if len(results[0]) < limit:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
return self.list(
|
|
127
|
+
filter_server=filter_server,
|
|
128
|
+
filter_project=filter_project,
|
|
129
|
+
filter_family=filter_family,
|
|
130
|
+
filter_type=filter_type,
|
|
131
|
+
filter_location=filter_location,
|
|
132
|
+
filter_address=filter_address,
|
|
133
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
134
|
+
page_size=page_size,
|
|
135
|
+
page_number=next_page,
|
|
136
|
+
retries=retries,
|
|
137
|
+
)
|
|
138
|
+
|
|
105
139
|
response_data: Any = None
|
|
106
140
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
107
|
-
return
|
|
141
|
+
return models.GetIpsResponse(
|
|
142
|
+
result=utils.unmarshal_json(http_res.text, models.IPAddresses),
|
|
143
|
+
next=next_func,
|
|
144
|
+
)
|
|
108
145
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
109
146
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
110
147
|
raise models.ErrorObject(data=response_data)
|
|
@@ -138,11 +175,13 @@ class IPAddressesSDK(BaseSDK):
|
|
|
138
175
|
filter_location: Optional[str] = None,
|
|
139
176
|
filter_address: Optional[str] = None,
|
|
140
177
|
extra_fields_ip_addresses: Optional[str] = None,
|
|
178
|
+
page_size: Optional[int] = 20,
|
|
179
|
+
page_number: Optional[int] = 1,
|
|
141
180
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
142
181
|
server_url: Optional[str] = None,
|
|
143
182
|
timeout_ms: Optional[int] = None,
|
|
144
183
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
145
|
-
) -> models.
|
|
184
|
+
) -> Optional[models.GetIpsResponse]:
|
|
146
185
|
r"""List IPs
|
|
147
186
|
|
|
148
187
|
List all Management and Additional IP Addresses.
|
|
@@ -158,6 +197,8 @@ class IPAddressesSDK(BaseSDK):
|
|
|
158
197
|
:param filter_location: The site slug to filter by
|
|
159
198
|
:param filter_address: The address of IP to filter by starts_with
|
|
160
199
|
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
200
|
+
:param page_size: Number of items to return per page
|
|
201
|
+
:param page_number: Page number to return (starts at 1)
|
|
161
202
|
:param retries: Override the default retry configuration for this method
|
|
162
203
|
:param server_url: Override the default server URL for this method
|
|
163
204
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -181,6 +222,8 @@ class IPAddressesSDK(BaseSDK):
|
|
|
181
222
|
filter_location=filter_location,
|
|
182
223
|
filter_address=filter_address,
|
|
183
224
|
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
225
|
+
page_size=page_size,
|
|
226
|
+
page_number=page_number,
|
|
184
227
|
)
|
|
185
228
|
|
|
186
229
|
req = self._build_request_async(
|
|
@@ -221,9 +264,39 @@ class IPAddressesSDK(BaseSDK):
|
|
|
221
264
|
retry_config=retry_config,
|
|
222
265
|
)
|
|
223
266
|
|
|
267
|
+
def next_func() -> Optional[models.GetIpsResponse]:
|
|
268
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
269
|
+
page = request.page_number if not request.page_number is None else 1
|
|
270
|
+
next_page = page + 1
|
|
271
|
+
|
|
272
|
+
if not http_res.text:
|
|
273
|
+
return None
|
|
274
|
+
results = JSONPath("$.data").parse(body)
|
|
275
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
276
|
+
return None
|
|
277
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
278
|
+
if len(results[0]) < limit:
|
|
279
|
+
return None
|
|
280
|
+
|
|
281
|
+
return self.list(
|
|
282
|
+
filter_server=filter_server,
|
|
283
|
+
filter_project=filter_project,
|
|
284
|
+
filter_family=filter_family,
|
|
285
|
+
filter_type=filter_type,
|
|
286
|
+
filter_location=filter_location,
|
|
287
|
+
filter_address=filter_address,
|
|
288
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
289
|
+
page_size=page_size,
|
|
290
|
+
page_number=next_page,
|
|
291
|
+
retries=retries,
|
|
292
|
+
)
|
|
293
|
+
|
|
224
294
|
response_data: Any = None
|
|
225
295
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
226
|
-
return
|
|
296
|
+
return models.GetIpsResponse(
|
|
297
|
+
result=utils.unmarshal_json(http_res.text, models.IPAddresses),
|
|
298
|
+
next=next_func,
|
|
299
|
+
)
|
|
227
300
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
228
301
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
229
302
|
raise models.ErrorObject(data=response_data)
|