latitudesh-python-sdk 2.0.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/_version.py +3 -3
- latitudesh_python_sdk/apikeys.py +51 -138
- latitudesh_python_sdk/basesdk.py +4 -4
- latitudesh_python_sdk/billing.py +11 -32
- latitudesh_python_sdk/events_sdk.py +9 -34
- latitudesh_python_sdk/firewalls_sdk.py +89 -264
- latitudesh_python_sdk/ipaddresses_sdk.py +25 -68
- latitudesh_python_sdk/models/__init__.py +27 -4
- latitudesh_python_sdk/models/apierror.py +30 -14
- latitudesh_python_sdk/models/deploy_config.py +11 -6
- latitudesh_python_sdk/models/error_object.py +11 -6
- latitudesh_python_sdk/models/latitudesherror.py +26 -0
- latitudesh_python_sdk/models/no_response_error.py +13 -0
- latitudesh_python_sdk/models/region_resource_data.py +4 -4
- latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
- latitudesh_python_sdk/models/server.py +11 -6
- latitudesh_python_sdk/models/server_data.py +6 -3
- latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
- latitudesh_python_sdk/models/update_serverop.py +1 -3
- latitudesh_python_sdk/models/virtual_network.py +11 -6
- latitudesh_python_sdk/operatingsystems_sdk.py +11 -32
- latitudesh_python_sdk/plans.py +57 -188
- latitudesh_python_sdk/privatenetworks.py +87 -262
- latitudesh_python_sdk/projects_sdk.py +43 -130
- latitudesh_python_sdk/regions_sdk.py +21 -66
- latitudesh_python_sdk/roles.py +21 -64
- latitudesh_python_sdk/servers_sdk.py +207 -604
- latitudesh_python_sdk/sshkeys_sdk.py +85 -304
- latitudesh_python_sdk/storage.py +33 -120
- latitudesh_python_sdk/tags.py +39 -126
- latitudesh_python_sdk/teams_sdk.py +35 -100
- latitudesh_python_sdk/teamsmembers.py +31 -96
- latitudesh_python_sdk/traffic_sdk.py +25 -68
- latitudesh_python_sdk/userdata_sdk.py +79 -298
- latitudesh_python_sdk/userprofile.py +31 -100
- latitudesh_python_sdk/utils/serializers.py +3 -2
- latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
- latitudesh_python_sdk/virtualmachines.py +35 -122
- latitudesh_python_sdk/vpnsessions.py +55 -146
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +47 -24
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +43 -38
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +0 -0
|
@@ -6,6 +6,7 @@ from latitudesh_python_sdk import models, utils
|
|
|
6
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
7
7
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
9
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
10
|
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
10
11
|
|
|
11
12
|
|
|
@@ -140,31 +141,20 @@ class IPAddressesSDK(BaseSDK):
|
|
|
140
141
|
response_data: Any = None
|
|
141
142
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
142
143
|
return models.GetIpsResponse(
|
|
143
|
-
result=
|
|
144
|
+
result=unmarshal_json_response(models.IPAddresses, http_res),
|
|
144
145
|
next=next_func,
|
|
145
146
|
)
|
|
146
147
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
147
|
-
response_data =
|
|
148
|
-
raise models.ErrorObject(
|
|
148
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
149
|
+
raise models.ErrorObject(response_data, http_res)
|
|
149
150
|
if utils.match_response(http_res, "4XX", "*"):
|
|
150
151
|
http_res_text = utils.stream_to_text(http_res)
|
|
151
|
-
raise models.APIError(
|
|
152
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
153
|
-
)
|
|
152
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
154
153
|
if utils.match_response(http_res, "5XX", "*"):
|
|
155
154
|
http_res_text = utils.stream_to_text(http_res)
|
|
156
|
-
raise models.APIError(
|
|
157
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
158
|
-
)
|
|
155
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
159
156
|
|
|
160
|
-
|
|
161
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
162
|
-
raise models.APIError(
|
|
163
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
164
|
-
http_res.status_code,
|
|
165
|
-
http_res_text,
|
|
166
|
-
http_res,
|
|
167
|
-
)
|
|
157
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
168
158
|
|
|
169
159
|
async def list_async(
|
|
170
160
|
self,
|
|
@@ -296,31 +286,20 @@ class IPAddressesSDK(BaseSDK):
|
|
|
296
286
|
response_data: Any = None
|
|
297
287
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
298
288
|
return models.GetIpsResponse(
|
|
299
|
-
result=
|
|
289
|
+
result=unmarshal_json_response(models.IPAddresses, http_res),
|
|
300
290
|
next=next_func,
|
|
301
291
|
)
|
|
302
292
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
303
|
-
response_data =
|
|
304
|
-
raise models.ErrorObject(
|
|
293
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
294
|
+
raise models.ErrorObject(response_data, http_res)
|
|
305
295
|
if utils.match_response(http_res, "4XX", "*"):
|
|
306
296
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
307
|
-
raise models.APIError(
|
|
308
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
309
|
-
)
|
|
297
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
310
298
|
if utils.match_response(http_res, "5XX", "*"):
|
|
311
299
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
312
|
-
raise models.APIError(
|
|
313
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
314
|
-
)
|
|
300
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
315
301
|
|
|
316
|
-
|
|
317
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
318
|
-
raise models.APIError(
|
|
319
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
320
|
-
http_res.status_code,
|
|
321
|
-
http_res_text,
|
|
322
|
-
http_res,
|
|
323
|
-
)
|
|
302
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
324
303
|
|
|
325
304
|
def get(
|
|
326
305
|
self,
|
|
@@ -399,29 +378,18 @@ class IPAddressesSDK(BaseSDK):
|
|
|
399
378
|
|
|
400
379
|
response_data: Any = None
|
|
401
380
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
402
|
-
return
|
|
381
|
+
return unmarshal_json_response(models.IPAddress, http_res)
|
|
403
382
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
404
|
-
response_data =
|
|
405
|
-
raise models.ErrorObject(
|
|
383
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
384
|
+
raise models.ErrorObject(response_data, http_res)
|
|
406
385
|
if utils.match_response(http_res, "4XX", "*"):
|
|
407
386
|
http_res_text = utils.stream_to_text(http_res)
|
|
408
|
-
raise models.APIError(
|
|
409
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
410
|
-
)
|
|
387
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
411
388
|
if utils.match_response(http_res, "5XX", "*"):
|
|
412
389
|
http_res_text = utils.stream_to_text(http_res)
|
|
413
|
-
raise models.APIError(
|
|
414
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
415
|
-
)
|
|
390
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
416
391
|
|
|
417
|
-
|
|
418
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
419
|
-
raise models.APIError(
|
|
420
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
421
|
-
http_res.status_code,
|
|
422
|
-
http_res_text,
|
|
423
|
-
http_res,
|
|
424
|
-
)
|
|
392
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
425
393
|
|
|
426
394
|
async def get_async(
|
|
427
395
|
self,
|
|
@@ -500,26 +468,15 @@ class IPAddressesSDK(BaseSDK):
|
|
|
500
468
|
|
|
501
469
|
response_data: Any = None
|
|
502
470
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
503
|
-
return
|
|
471
|
+
return unmarshal_json_response(models.IPAddress, http_res)
|
|
504
472
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
505
|
-
response_data =
|
|
506
|
-
raise models.ErrorObject(
|
|
473
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
474
|
+
raise models.ErrorObject(response_data, http_res)
|
|
507
475
|
if utils.match_response(http_res, "4XX", "*"):
|
|
508
476
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
509
|
-
raise models.APIError(
|
|
510
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
511
|
-
)
|
|
477
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
512
478
|
if utils.match_response(http_res, "5XX", "*"):
|
|
513
479
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
514
|
-
raise models.APIError(
|
|
515
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
516
|
-
)
|
|
480
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
517
481
|
|
|
518
|
-
|
|
519
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
520
|
-
raise models.APIError(
|
|
521
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
522
|
-
http_res.status_code,
|
|
523
|
-
http_res_text,
|
|
524
|
-
http_res,
|
|
525
|
-
)
|
|
482
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
@@ -576,6 +576,7 @@ if TYPE_CHECKING:
|
|
|
576
576
|
IpmiSessionType,
|
|
577
577
|
IpmiSessionTypedDict,
|
|
578
578
|
)
|
|
579
|
+
from .latitudesherror import LatitudeshError
|
|
579
580
|
from .list_firewallsop import (
|
|
580
581
|
ListFirewallsRequest,
|
|
581
582
|
ListFirewallsRequestTypedDict,
|
|
@@ -591,6 +592,7 @@ if TYPE_CHECKING:
|
|
|
591
592
|
MembershipRole,
|
|
592
593
|
MembershipTypedDict,
|
|
593
594
|
)
|
|
595
|
+
from .no_response_error import NoResponseError
|
|
594
596
|
from .operating_system_data import (
|
|
595
597
|
OperatingSystemData,
|
|
596
598
|
OperatingSystemDataAttributes,
|
|
@@ -866,9 +868,9 @@ if TYPE_CHECKING:
|
|
|
866
868
|
)
|
|
867
869
|
from .region_resource_data import (
|
|
868
870
|
RegionResourceData,
|
|
871
|
+
RegionResourceDataSite,
|
|
872
|
+
RegionResourceDataSiteTypedDict,
|
|
869
873
|
RegionResourceDataTypedDict,
|
|
870
|
-
Site,
|
|
871
|
-
SiteTypedDict,
|
|
872
874
|
)
|
|
873
875
|
from .regions import (
|
|
874
876
|
Country,
|
|
@@ -880,6 +882,7 @@ if TYPE_CHECKING:
|
|
|
880
882
|
RegionsDataTypedDict,
|
|
881
883
|
RegionsTypedDict,
|
|
882
884
|
)
|
|
885
|
+
from .responsevalidationerror import ResponseValidationError
|
|
883
886
|
from .role import Role, RoleMeta, RoleMetaTypedDict, RoleTypedDict
|
|
884
887
|
from .role_data import (
|
|
885
888
|
RoleData,
|
|
@@ -933,6 +936,12 @@ if TYPE_CHECKING:
|
|
|
933
936
|
ServerExitRescueModeRequestTypedDict,
|
|
934
937
|
)
|
|
935
938
|
from .server_lockop import ServerLockRequest, ServerLockRequestTypedDict
|
|
939
|
+
from .server_region_resource_data import (
|
|
940
|
+
ServerRegionResourceData,
|
|
941
|
+
ServerRegionResourceDataTypedDict,
|
|
942
|
+
Site,
|
|
943
|
+
SiteTypedDict,
|
|
944
|
+
)
|
|
936
945
|
from .server_rescue import (
|
|
937
946
|
ServerRescue,
|
|
938
947
|
ServerRescueMeta,
|
|
@@ -1761,6 +1770,7 @@ __all__ = [
|
|
|
1761
1770
|
"IpmiSessionType",
|
|
1762
1771
|
"IpmiSessionTypedDict",
|
|
1763
1772
|
"IpmiStatus",
|
|
1773
|
+
"LatitudeshError",
|
|
1764
1774
|
"ListFirewallsRequest",
|
|
1765
1775
|
"ListFirewallsRequestTypedDict",
|
|
1766
1776
|
"ListFirewallsResponse",
|
|
@@ -1784,6 +1794,7 @@ __all__ = [
|
|
|
1784
1794
|
"MetadataTypedDict",
|
|
1785
1795
|
"Nics",
|
|
1786
1796
|
"NicsTypedDict",
|
|
1797
|
+
"NoResponseError",
|
|
1787
1798
|
"OperatingSystem",
|
|
1788
1799
|
"OperatingSystemData",
|
|
1789
1800
|
"OperatingSystemDataAttributes",
|
|
@@ -2007,6 +2018,8 @@ __all__ = [
|
|
|
2007
2018
|
"RegionData",
|
|
2008
2019
|
"RegionDataTypedDict",
|
|
2009
2020
|
"RegionResourceData",
|
|
2021
|
+
"RegionResourceDataSite",
|
|
2022
|
+
"RegionResourceDataSiteTypedDict",
|
|
2010
2023
|
"RegionResourceDataTypedDict",
|
|
2011
2024
|
"RegionTypedDict",
|
|
2012
2025
|
"Regions",
|
|
@@ -2015,6 +2028,7 @@ __all__ = [
|
|
|
2015
2028
|
"RegionsData",
|
|
2016
2029
|
"RegionsDataTypedDict",
|
|
2017
2030
|
"RegionsTypedDict",
|
|
2031
|
+
"ResponseValidationError",
|
|
2018
2032
|
"Role",
|
|
2019
2033
|
"RoleData",
|
|
2020
2034
|
"RoleDataAttributes",
|
|
@@ -2069,6 +2083,8 @@ __all__ = [
|
|
|
2069
2083
|
"ServerLockRequestTypedDict",
|
|
2070
2084
|
"ServerMeta",
|
|
2071
2085
|
"ServerMetaTypedDict",
|
|
2086
|
+
"ServerRegionResourceData",
|
|
2087
|
+
"ServerRegionResourceDataTypedDict",
|
|
2072
2088
|
"ServerRescue",
|
|
2073
2089
|
"ServerRescueMeta",
|
|
2074
2090
|
"ServerRescueMetaTypedDict",
|
|
@@ -2818,6 +2834,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2818
2834
|
"IpmiSessionDataTypedDict": ".ipmi_session",
|
|
2819
2835
|
"IpmiSessionType": ".ipmi_session",
|
|
2820
2836
|
"IpmiSessionTypedDict": ".ipmi_session",
|
|
2837
|
+
"LatitudeshError": ".latitudesherror",
|
|
2821
2838
|
"ListFirewallsRequest": ".list_firewallsop",
|
|
2822
2839
|
"ListFirewallsRequestTypedDict": ".list_firewallsop",
|
|
2823
2840
|
"ListFirewallsResponse": ".list_firewallsop",
|
|
@@ -2829,6 +2846,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2829
2846
|
"MembershipDataTypedDict": ".membership",
|
|
2830
2847
|
"MembershipRole": ".membership",
|
|
2831
2848
|
"MembershipTypedDict": ".membership",
|
|
2849
|
+
"NoResponseError": ".no_response_error",
|
|
2832
2850
|
"OperatingSystemData": ".operating_system_data",
|
|
2833
2851
|
"OperatingSystemDataAttributes": ".operating_system_data",
|
|
2834
2852
|
"OperatingSystemDataAttributesTypedDict": ".operating_system_data",
|
|
@@ -3063,9 +3081,9 @@ _dynamic_imports: dict[str, str] = {
|
|
|
3063
3081
|
"RegionDataTypedDict": ".region",
|
|
3064
3082
|
"RegionTypedDict": ".region",
|
|
3065
3083
|
"RegionResourceData": ".region_resource_data",
|
|
3084
|
+
"RegionResourceDataSite": ".region_resource_data",
|
|
3085
|
+
"RegionResourceDataSiteTypedDict": ".region_resource_data",
|
|
3066
3086
|
"RegionResourceDataTypedDict": ".region_resource_data",
|
|
3067
|
-
"Site": ".region_resource_data",
|
|
3068
|
-
"SiteTypedDict": ".region_resource_data",
|
|
3069
3087
|
"Country": ".regions",
|
|
3070
3088
|
"CountryTypedDict": ".regions",
|
|
3071
3089
|
"Regions": ".regions",
|
|
@@ -3074,6 +3092,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
3074
3092
|
"RegionsData": ".regions",
|
|
3075
3093
|
"RegionsDataTypedDict": ".regions",
|
|
3076
3094
|
"RegionsTypedDict": ".regions",
|
|
3095
|
+
"ResponseValidationError": ".responsevalidationerror",
|
|
3077
3096
|
"Role": ".role",
|
|
3078
3097
|
"RoleMeta": ".role",
|
|
3079
3098
|
"RoleMetaTypedDict": ".role",
|
|
@@ -3122,6 +3141,10 @@ _dynamic_imports: dict[str, str] = {
|
|
|
3122
3141
|
"ServerExitRescueModeRequestTypedDict": ".server_exit_rescue_modeop",
|
|
3123
3142
|
"ServerLockRequest": ".server_lockop",
|
|
3124
3143
|
"ServerLockRequestTypedDict": ".server_lockop",
|
|
3144
|
+
"ServerRegionResourceData": ".server_region_resource_data",
|
|
3145
|
+
"ServerRegionResourceDataTypedDict": ".server_region_resource_data",
|
|
3146
|
+
"Site": ".server_region_resource_data",
|
|
3147
|
+
"SiteTypedDict": ".server_region_resource_data",
|
|
3125
3148
|
"ServerRescue": ".server_rescue",
|
|
3126
3149
|
"ServerRescueMeta": ".server_rescue",
|
|
3127
3150
|
"ServerRescueMetaTypedDict": ".server_rescue",
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
3
|
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
7
|
+
|
|
8
|
+
MAX_MESSAGE_LEN = 10_000
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class APIError(LatitudeshError):
|
|
12
|
+
"""The fallback error class if no more specific error class is matched."""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self, message: str, raw_response: httpx.Response, body: Optional[str] = None
|
|
16
|
+
):
|
|
17
|
+
body_display = body or raw_response.text or '""'
|
|
6
18
|
|
|
19
|
+
if message:
|
|
20
|
+
message += ": "
|
|
21
|
+
message += f"Status {raw_response.status_code}"
|
|
7
22
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
headers = raw_response.headers
|
|
24
|
+
content_type = headers.get("content-type", '""')
|
|
25
|
+
if content_type != "application/json":
|
|
26
|
+
if " " in content_type:
|
|
27
|
+
content_type = f'"{content_type}"'
|
|
28
|
+
message += f" Content-Type {content_type}"
|
|
11
29
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
30
|
+
if len(body_display) > MAX_MESSAGE_LEN:
|
|
31
|
+
truncated = body_display[:MAX_MESSAGE_LEN]
|
|
32
|
+
remaining = len(body_display) - MAX_MESSAGE_LEN
|
|
33
|
+
body_display = f"{truncated}...and {remaining} more chars"
|
|
16
34
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if len(self.body) > 0:
|
|
20
|
-
body = f"\n{self.body}"
|
|
35
|
+
message += f". Body: {body_display}"
|
|
36
|
+
message = message.strip()
|
|
21
37
|
|
|
22
|
-
|
|
38
|
+
super().__init__(message, raw_response, body)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
5
6
|
from latitudesh_python_sdk.types import BaseModel
|
|
6
7
|
from typing import List, Optional
|
|
7
8
|
from typing_extensions import NotRequired, TypedDict
|
|
@@ -64,11 +65,15 @@ class DeployConfigErrorData(BaseModel):
|
|
|
64
65
|
data: Optional[DeployConfigData] = None
|
|
65
66
|
|
|
66
67
|
|
|
67
|
-
class DeployConfigError(
|
|
68
|
+
class DeployConfigError(LatitudeshError):
|
|
68
69
|
data: DeployConfigErrorData
|
|
69
70
|
|
|
70
|
-
def __init__(
|
|
71
|
+
def __init__(
|
|
72
|
+
self,
|
|
73
|
+
data: DeployConfigErrorData,
|
|
74
|
+
raw_response: httpx.Response,
|
|
75
|
+
body: Optional[str] = None,
|
|
76
|
+
):
|
|
77
|
+
message = body or raw_response.text
|
|
78
|
+
super().__init__(message, raw_response, body)
|
|
71
79
|
self.data = data
|
|
72
|
-
|
|
73
|
-
def __str__(self) -> str:
|
|
74
|
-
return utils.marshal_json(self.data, DeployConfigErrorData)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
5
6
|
from latitudesh_python_sdk.types import BaseModel
|
|
6
7
|
from typing import List, Optional
|
|
7
8
|
from typing_extensions import NotRequired, TypedDict
|
|
@@ -39,11 +40,15 @@ class ErrorObjectData(BaseModel):
|
|
|
39
40
|
errors: Optional[List[Errors]] = None
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
class ErrorObject(
|
|
43
|
+
class ErrorObject(LatitudeshError):
|
|
43
44
|
data: ErrorObjectData
|
|
44
45
|
|
|
45
|
-
def __init__(
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
data: ErrorObjectData,
|
|
49
|
+
raw_response: httpx.Response,
|
|
50
|
+
body: Optional[str] = None,
|
|
51
|
+
):
|
|
52
|
+
message = body or raw_response.text
|
|
53
|
+
super().__init__(message, raw_response, body)
|
|
46
54
|
self.data = data
|
|
47
|
-
|
|
48
|
-
def __str__(self) -> str:
|
|
49
|
-
return utils.marshal_json(self.data, ErrorObjectData)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LatitudeshError(Exception):
|
|
8
|
+
"""The base class for all HTTP error responses."""
|
|
9
|
+
|
|
10
|
+
message: str
|
|
11
|
+
status_code: int
|
|
12
|
+
body: str
|
|
13
|
+
headers: httpx.Headers
|
|
14
|
+
raw_response: httpx.Response
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self, message: str, raw_response: httpx.Response, body: Optional[str] = None
|
|
18
|
+
):
|
|
19
|
+
self.message = message
|
|
20
|
+
self.status_code = raw_response.status_code
|
|
21
|
+
self.body = body if body is not None else raw_response.text
|
|
22
|
+
self.headers = raw_response.headers
|
|
23
|
+
self.raw_response = raw_response
|
|
24
|
+
|
|
25
|
+
def __str__(self):
|
|
26
|
+
return self.message
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
class NoResponseError(Exception):
|
|
4
|
+
"""Error raised when no HTTP response is received from the server."""
|
|
5
|
+
|
|
6
|
+
message: str
|
|
7
|
+
|
|
8
|
+
def __init__(self, message: str = "No response received"):
|
|
9
|
+
self.message = message
|
|
10
|
+
super().__init__(message)
|
|
11
|
+
|
|
12
|
+
def __str__(self):
|
|
13
|
+
return self.message
|
|
@@ -6,14 +6,14 @@ from typing import Optional
|
|
|
6
6
|
from typing_extensions import NotRequired, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class RegionResourceDataSiteTypedDict(TypedDict):
|
|
10
10
|
id: NotRequired[str]
|
|
11
11
|
name: NotRequired[str]
|
|
12
12
|
slug: NotRequired[str]
|
|
13
13
|
facility: NotRequired[str]
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class RegionResourceDataSite(BaseModel):
|
|
17
17
|
id: Optional[str] = None
|
|
18
18
|
|
|
19
19
|
name: Optional[str] = None
|
|
@@ -26,7 +26,7 @@ class Site(BaseModel):
|
|
|
26
26
|
class RegionResourceDataTypedDict(TypedDict):
|
|
27
27
|
city: NotRequired[str]
|
|
28
28
|
country: NotRequired[str]
|
|
29
|
-
site: NotRequired[
|
|
29
|
+
site: NotRequired[RegionResourceDataSiteTypedDict]
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class RegionResourceData(BaseModel):
|
|
@@ -34,4 +34,4 @@ class RegionResourceData(BaseModel):
|
|
|
34
34
|
|
|
35
35
|
country: Optional[str] = None
|
|
36
36
|
|
|
37
|
-
site: Optional[
|
|
37
|
+
site: Optional[RegionResourceDataSite] = None
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ResponseValidationError(LatitudeshError):
|
|
10
|
+
"""Error raised when there is a type mismatch between the response data and the expected Pydantic model."""
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
message: str,
|
|
15
|
+
raw_response: httpx.Response,
|
|
16
|
+
cause: Exception,
|
|
17
|
+
body: Optional[str] = None,
|
|
18
|
+
):
|
|
19
|
+
message = f"{message}: {cause}"
|
|
20
|
+
super().__init__(message, raw_response, body)
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def cause(self):
|
|
24
|
+
"""Normally the Pydantic ValidationError"""
|
|
25
|
+
return self.__cause__
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .server_data import ServerData, ServerDataTypedDict
|
|
5
|
-
|
|
5
|
+
import httpx
|
|
6
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
6
7
|
from latitudesh_python_sdk.types import BaseModel
|
|
7
8
|
from typing import Optional
|
|
8
9
|
from typing_extensions import NotRequired, TypedDict
|
|
@@ -33,15 +34,19 @@ class ServerErrorData(BaseModel):
|
|
|
33
34
|
meta: Optional[ServerMeta] = None
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
class ServerError(
|
|
37
|
+
class ServerError(LatitudeshError):
|
|
37
38
|
data: ServerErrorData
|
|
38
39
|
|
|
39
|
-
def __init__(
|
|
40
|
+
def __init__(
|
|
41
|
+
self,
|
|
42
|
+
data: ServerErrorData,
|
|
43
|
+
raw_response: httpx.Response,
|
|
44
|
+
body: Optional[str] = None,
|
|
45
|
+
):
|
|
46
|
+
message = body or raw_response.text
|
|
47
|
+
super().__init__(message, raw_response, body)
|
|
40
48
|
self.data = data
|
|
41
49
|
|
|
42
|
-
def __str__(self) -> str:
|
|
43
|
-
return utils.marshal_json(self.data, ServerErrorData)
|
|
44
|
-
|
|
45
50
|
|
|
46
51
|
class Server1TypedDict(TypedDict):
|
|
47
52
|
data: NotRequired[ServerDataTypedDict]
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .project_include import ProjectInclude, ProjectIncludeTypedDict
|
|
5
|
-
from .
|
|
5
|
+
from .server_region_resource_data import (
|
|
6
|
+
ServerRegionResourceData,
|
|
7
|
+
ServerRegionResourceDataTypedDict,
|
|
8
|
+
)
|
|
6
9
|
from .team_include import TeamInclude, TeamIncludeTypedDict
|
|
7
10
|
from enum import Enum
|
|
8
11
|
from latitudesh_python_sdk.types import BaseModel
|
|
@@ -160,7 +163,7 @@ class ServerDataAttributesTypedDict(TypedDict):
|
|
|
160
163
|
scheduled_deletion_at: NotRequired[str]
|
|
161
164
|
plan: NotRequired[ServerDataPlanTypedDict]
|
|
162
165
|
operating_system: NotRequired[OperatingSystemTypedDict]
|
|
163
|
-
region: NotRequired[
|
|
166
|
+
region: NotRequired[ServerRegionResourceDataTypedDict]
|
|
164
167
|
specs: NotRequired[ServerDataSpecsTypedDict]
|
|
165
168
|
project: NotRequired[ProjectIncludeTypedDict]
|
|
166
169
|
team: NotRequired[TeamIncludeTypedDict]
|
|
@@ -202,7 +205,7 @@ class ServerDataAttributes(BaseModel):
|
|
|
202
205
|
|
|
203
206
|
operating_system: Optional[OperatingSystem] = None
|
|
204
207
|
|
|
205
|
-
region: Optional[
|
|
208
|
+
region: Optional[ServerRegionResourceData] = None
|
|
206
209
|
|
|
207
210
|
specs: Optional[ServerDataSpecs] = None
|
|
208
211
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from latitudesh_python_sdk.types import BaseModel
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SiteTypedDict(TypedDict):
|
|
10
|
+
id: NotRequired[str]
|
|
11
|
+
name: NotRequired[str]
|
|
12
|
+
slug: NotRequired[str]
|
|
13
|
+
facility: NotRequired[str]
|
|
14
|
+
rack_id: NotRequired[str]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Site(BaseModel):
|
|
18
|
+
id: Optional[str] = None
|
|
19
|
+
|
|
20
|
+
name: Optional[str] = None
|
|
21
|
+
|
|
22
|
+
slug: Optional[str] = None
|
|
23
|
+
|
|
24
|
+
facility: Optional[str] = None
|
|
25
|
+
|
|
26
|
+
rack_id: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ServerRegionResourceDataTypedDict(TypedDict):
|
|
30
|
+
city: NotRequired[str]
|
|
31
|
+
country: NotRequired[str]
|
|
32
|
+
site: NotRequired[SiteTypedDict]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ServerRegionResourceData(BaseModel):
|
|
36
|
+
city: Optional[str] = None
|
|
37
|
+
|
|
38
|
+
country: Optional[str] = None
|
|
39
|
+
|
|
40
|
+
site: Optional[Site] = None
|
|
@@ -32,9 +32,7 @@ class UpdateServerServersRequestAttributesTypedDict(TypedDict):
|
|
|
32
32
|
class UpdateServerServersRequestAttributes(BaseModel):
|
|
33
33
|
hostname: Optional[str] = "new-hostname"
|
|
34
34
|
|
|
35
|
-
billing: Optional[UpdateServerServersRequestBilling] =
|
|
36
|
-
UpdateServerServersRequestBilling.MONTHLY
|
|
37
|
-
)
|
|
35
|
+
billing: Optional[UpdateServerServersRequestBilling] = None
|
|
38
36
|
|
|
39
37
|
tags: Optional[List[str]] = None
|
|
40
38
|
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .virtual_network_data import VirtualNetworkData, VirtualNetworkDataTypedDict
|
|
5
5
|
from enum import Enum
|
|
6
|
-
|
|
6
|
+
import httpx
|
|
7
|
+
from latitudesh_python_sdk.models import LatitudeshError
|
|
7
8
|
from latitudesh_python_sdk.types import BaseModel
|
|
8
9
|
from typing import Optional
|
|
9
10
|
from typing_extensions import NotRequired, TypedDict
|
|
@@ -112,11 +113,15 @@ class VirtualNetworkErrorData(BaseModel):
|
|
|
112
113
|
meta: Optional[VirtualNetworkMeta1] = None
|
|
113
114
|
|
|
114
115
|
|
|
115
|
-
class VirtualNetworkError(
|
|
116
|
+
class VirtualNetworkError(LatitudeshError):
|
|
116
117
|
data: VirtualNetworkErrorData
|
|
117
118
|
|
|
118
|
-
def __init__(
|
|
119
|
+
def __init__(
|
|
120
|
+
self,
|
|
121
|
+
data: VirtualNetworkErrorData,
|
|
122
|
+
raw_response: httpx.Response,
|
|
123
|
+
body: Optional[str] = None,
|
|
124
|
+
):
|
|
125
|
+
message = body or raw_response.text
|
|
126
|
+
super().__init__(message, raw_response, body)
|
|
119
127
|
self.data = data
|
|
120
|
-
|
|
121
|
-
def __str__(self) -> str:
|
|
122
|
-
return utils.marshal_json(self.data, VirtualNetworkErrorData)
|