Skip to content

Commit 4d292e6

Browse files
Generate vpn
1 parent 875e273 commit 4d292e6

45 files changed

Lines changed: 240 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

services/vpn/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
87a3ad63dec0a953ff5c6072ad9a15fddd8ec5f8
1+
98c11e0ee4834ddaaa474eccc437d234e6276a70

services/vpn/src/stackit/vpn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
99
10-
The version of the OpenAPI document: 1beta1
10+
The version of the OpenAPI document: 1
1111
Generated by OpenAPI Generator (https://openapi-generator.tech)
1212
1313
Do not edit the class manually.

services/vpn/src/stackit/vpn/api/default_api.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -334,7 +334,7 @@ def _create_gateway_connection_serialize(
334334

335335
return self.api_client.param_serialize(
336336
method="POST",
337-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
337+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
338338
path_params=_path_params,
339339
query_params=_query_params,
340340
header_params=_header_params,
@@ -613,7 +613,7 @@ def _create_vpn_gateway_serialize(
613613

614614
return self.api_client.param_serialize(
615615
method="POST",
616-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways",
616+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways",
617617
path_params=_path_params,
618618
query_params=_query_params,
619619
header_params=_header_params,
@@ -899,7 +899,7 @@ def _delete_gateway_connection_serialize(
899899

900900
return self.api_client.param_serialize(
901901
method="DELETE",
902-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
902+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
903903
path_params=_path_params,
904904
query_params=_query_params,
905905
header_params=_header_params,
@@ -1167,7 +1167,7 @@ def _delete_vpn_gateway_serialize(
11671167

11681168
return self.api_client.param_serialize(
11691169
method="DELETE",
1170-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
1170+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
11711171
path_params=_path_params,
11721172
query_params=_query_params,
11731173
header_params=_header_params,
@@ -1453,7 +1453,7 @@ def _get_gateway_connection_serialize(
14531453

14541454
return self.api_client.param_serialize(
14551455
method="GET",
1456-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
1456+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
14571457
path_params=_path_params,
14581458
query_params=_query_params,
14591459
header_params=_header_params,
@@ -1739,7 +1739,7 @@ def _get_gateway_connection_status_serialize(
17391739

17401740
return self.api_client.param_serialize(
17411741
method="GET",
1742-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status",
1742+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status",
17431743
path_params=_path_params,
17441744
query_params=_query_params,
17451745
header_params=_header_params,
@@ -2010,7 +2010,7 @@ def _get_vpn_gateway_serialize(
20102010

20112011
return self.api_client.param_serialize(
20122012
method="GET",
2013-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
2013+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
20142014
path_params=_path_params,
20152015
query_params=_query_params,
20162016
header_params=_header_params,
@@ -2281,7 +2281,7 @@ def _get_vpn_gateway_status_serialize(
22812281

22822282
return self.api_client.param_serialize(
22832283
method="GET",
2284-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status",
2284+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status",
22852285
path_params=_path_params,
22862286
query_params=_query_params,
22872287
header_params=_header_params,
@@ -2575,7 +2575,7 @@ def _list_gateway_connections_serialize(
25752575

25762576
return self.api_client.param_serialize(
25772577
method="GET",
2578-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
2578+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
25792579
path_params=_path_params,
25802580
query_params=_query_params,
25812581
header_params=_header_params,
@@ -2807,7 +2807,7 @@ def _list_plans_serialize(
28072807

28082808
return self.api_client.param_serialize(
28092809
method="GET",
2810-
resource_path="/v1beta1/regions/{region}/plans",
2810+
resource_path="/v1/regions/{region}/plans",
28112811
path_params=_path_params,
28122812
query_params=_query_params,
28132813
header_params=_header_params,
@@ -3054,7 +3054,7 @@ def _list_quotas_serialize(
30543054

30553055
return self.api_client.param_serialize(
30563056
method="GET",
3057-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/quotas",
3057+
resource_path="/v1/projects/{projectId}/regions/{region}/quotas",
30583058
path_params=_path_params,
30593059
query_params=_query_params,
30603060
header_params=_header_params,
@@ -3330,7 +3330,7 @@ def _list_vpn_gateways_serialize(
33303330

33313331
return self.api_client.param_serialize(
33323332
method="GET",
3333-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways",
3333+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways",
33343334
path_params=_path_params,
33353335
query_params=_query_params,
33363336
header_params=_header_params,
@@ -3639,7 +3639,7 @@ def _update_gateway_connection_serialize(
36393639

36403640
return self.api_client.param_serialize(
36413641
method="PUT",
3642-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
3642+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
36433643
path_params=_path_params,
36443644
query_params=_query_params,
36453645
header_params=_header_params,
@@ -3933,7 +3933,7 @@ def _update_vpn_gateway_serialize(
39333933

39343934
return self.api_client.param_serialize(
39353935
method="PUT",
3936-
resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
3936+
resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
39373937
path_params=_path_params,
39383938
query_params=_query_params,
39393939
header_params=_header_params,

services/vpn/src/stackit/vpn/api_client.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -66,6 +66,7 @@ class ApiClient:
6666
"date": datetime.date,
6767
"datetime": datetime.datetime,
6868
"decimal": decimal.Decimal,
69+
"UUID": uuid.UUID,
6970
"object": object,
7071
}
7172
_pool = None
@@ -265,7 +266,7 @@ def response_deserialize(
265266
response_text = None
266267
return_data = None
267268
try:
268-
if response_type == "bytearray":
269+
if response_type in ("bytearray", "bytes"):
269270
return_data = response_data.data
270271
elif response_type == "file":
271272
return_data = self.__deserialize_file(response_data)
@@ -326,25 +327,20 @@ def sanitize_for_serialization(self, obj):
326327
return obj.isoformat()
327328
elif isinstance(obj, decimal.Decimal):
328329
return str(obj)
329-
330330
elif isinstance(obj, dict):
331-
obj_dict = obj
331+
return {key: self.sanitize_for_serialization(val) for key, val in obj.items()}
332+
333+
# Convert model obj to dict except
334+
# attributes `openapi_types`, `attribute_map`
335+
# and attributes which value is not None.
336+
# Convert attribute name to json key in
337+
# model definition for request.
338+
if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")):
339+
obj_dict = obj.to_dict()
332340
else:
333-
# Convert model obj to dict except
334-
# attributes `openapi_types`, `attribute_map`
335-
# and attributes which value is not None.
336-
# Convert attribute name to json key in
337-
# model definition for request.
338-
if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
339-
obj_dict = obj.to_dict()
340-
else:
341-
obj_dict = obj.__dict__
342-
343-
if isinstance(obj_dict, list):
344-
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501
345-
return self.sanitize_for_serialization(obj_dict)
341+
obj_dict = obj.__dict__
346342

347-
return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
343+
return self.sanitize_for_serialization(obj_dict)
348344

349345
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
350346
"""Deserializes response into an object.
@@ -417,6 +413,8 @@ def __deserialize(self, data, klass):
417413
return self.__deserialize_datetime(data)
418414
elif klass is decimal.Decimal:
419415
return decimal.Decimal(data)
416+
elif klass is uuid.UUID:
417+
return uuid.UUID(data)
420418
elif issubclass(klass, Enum):
421419
return self.__deserialize_enum(data, klass)
422420
else:

services/vpn/src/stackit/vpn/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.

services/vpn/src/stackit/vpn/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.

services/vpn/src/stackit/vpn/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
88
9-
The version of the OpenAPI document: 1beta1
9+
The version of the OpenAPI document: 1
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
1212
Do not edit the class manually.

services/vpn/src/stackit/vpn/models/api_error.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -18,6 +18,7 @@
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

2020
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21+
from pydantic_core import to_jsonable_python
2122
from typing_extensions import Self
2223

2324
from stackit.vpn.models.api_error_detail import APIErrorDetail
@@ -35,7 +36,8 @@ class APIError(BaseModel):
3536
__properties: ClassVar[List[str]] = ["code", "details", "message", "status"]
3637

3738
model_config = ConfigDict(
38-
populate_by_name=True,
39+
validate_by_name=True,
40+
validate_by_alias=True,
3941
validate_assignment=True,
4042
protected_namespaces=(),
4143
)
@@ -46,8 +48,7 @@ def to_str(self) -> str:
4648

4749
def to_json(self) -> str:
4850
"""Returns the JSON representation of the model using alias"""
49-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50-
return json.dumps(self.to_dict())
51+
return json.dumps(to_jsonable_python(self.to_dict()))
5152

5253
@classmethod
5354
def from_json(cls, json_str: str) -> Optional[Self]:

services/vpn/src/stackit/vpn/models/api_error_detail.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -18,6 +18,7 @@
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

2020
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21+
from pydantic_core import to_jsonable_python
2122
from typing_extensions import Self
2223

2324

@@ -42,7 +43,8 @@ def reason_validate_enum(cls, value):
4243
return value
4344

4445
model_config = ConfigDict(
45-
populate_by_name=True,
46+
validate_by_name=True,
47+
validate_by_alias=True,
4648
validate_assignment=True,
4749
protected_namespaces=(),
4850
)
@@ -53,8 +55,7 @@ def to_str(self) -> str:
5355

5456
def to_json(self) -> str:
5557
"""Returns the JSON representation of the model using alias"""
56-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57-
return json.dumps(self.to_dict())
58+
return json.dumps(to_jsonable_python(self.to_dict()))
5859

5960
@classmethod
6061
def from_json(cls, json_str: str) -> Optional[Self]:

services/vpn/src/stackit/vpn/models/api_error_response.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
77
8-
The version of the OpenAPI document: 1beta1
8+
The version of the OpenAPI document: 1
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -18,6 +18,7 @@
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

2020
from pydantic import BaseModel, ConfigDict
21+
from pydantic_core import to_jsonable_python
2122
from typing_extensions import Self
2223

2324
from stackit.vpn.models.api_error import APIError
@@ -32,7 +33,8 @@ class APIErrorResponse(BaseModel):
3233
__properties: ClassVar[List[str]] = ["error"]
3334

3435
model_config = ConfigDict(
35-
populate_by_name=True,
36+
validate_by_name=True,
37+
validate_by_alias=True,
3638
validate_assignment=True,
3739
protected_namespaces=(),
3840
)
@@ -43,8 +45,7 @@ def to_str(self) -> str:
4345

4446
def to_json(self) -> str:
4547
"""Returns the JSON representation of the model using alias"""
46-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47-
return json.dumps(self.to_dict())
48+
return json.dumps(to_jsonable_python(self.to_dict()))
4849

4950
@classmethod
5051
def from_json(cls, json_str: str) -> Optional[Self]:

0 commit comments

Comments
 (0)