From a36b53c7acd7d2d714236714d56f473e74840e4c Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 12 May 2026 12:41:14 +0000 Subject: [PATCH] Generate vpn --- services/vpn/oas_commit | 2 +- services/vpn/src/stackit/vpn/__init__.py | 20 +- .../vpn/src/stackit/vpn/api/default_api.py | 818 +++++++++--------- services/vpn/src/stackit/vpn/api_client.py | 34 +- services/vpn/src/stackit/vpn/configuration.py | 2 +- services/vpn/src/stackit/vpn/exceptions.py | 2 +- .../vpn/src/stackit/vpn/models/__init__.py | 10 +- .../vpn/src/stackit/vpn/models/api_error.py | 9 +- .../stackit/vpn/models/api_error_detail.py | 9 +- .../stackit/vpn/models/api_error_response.py | 9 +- .../stackit/vpn/models/bgp_gateway_config.py | 9 +- .../vpn/src/stackit/vpn/models/bgp_status.py | 9 +- .../stackit/vpn/models/bgp_status_peers.py | 9 +- .../stackit/vpn/models/bgp_status_routes.py | 9 +- .../stackit/vpn/models/bgp_tunnel_config.py | 9 +- .../src/stackit/vpn/models/connection_list.py | 9 +- .../stackit/vpn/models/connection_response.py | 12 +- .../vpn/models/connection_status_response.py | 9 +- .../create_gateway_connection_payload.py | 12 +- ...y_payload.py => create_gateway_payload.py} | 28 +- ...ate_gateway_payload_availability_zones.py} | 17 +- .../vpn/src/stackit/vpn/models/gateway.py | 20 +- .../src/stackit/vpn/models/gateway_list.py | 9 +- .../stackit/vpn/models/gateway_response.py | 20 +- .../src/stackit/vpn/models/gateway_status.py | 2 +- .../vpn/models/gateway_status_response.py | 9 +- .../src/stackit/vpn/models/peering_config.py | 15 +- services/vpn/src/stackit/vpn/models/phase.py | 9 +- .../src/stackit/vpn/models/phase1_status.py | 9 +- .../src/stackit/vpn/models/phase2_status.py | 9 +- services/vpn/src/stackit/vpn/models/plan.py | 9 +- .../vpn/src/stackit/vpn/models/plan_list.py | 9 +- services/vpn/src/stackit/vpn/models/quota.py | 9 +- .../vpn/src/stackit/vpn/models/quota_list.py | 9 +- .../stackit/vpn/models/quota_list_response.py | 9 +- services/vpn/src/stackit/vpn/models/region.py | 2 +- .../src/stackit/vpn/models/routing_type.py | 2 +- .../vpn/models/tunnel_configuration.py | 12 +- .../vpn/models/tunnel_configuration_phase1.py | 9 +- .../vpn/models/tunnel_configuration_phase2.py | 9 +- .../src/stackit/vpn/models/tunnel_status.py | 9 +- .../update_gateway_connection_payload.py | 12 +- ...y_payload.py => update_gateway_payload.py} | 28 +- .../vpn/src/stackit/vpn/models/vpn_tunnels.py | 9 +- services/vpn/src/stackit/vpn/rest.py | 2 +- 45 files changed, 675 insertions(+), 613 deletions(-) rename services/vpn/src/stackit/vpn/models/{create_vpn_gateway_payload.py => create_gateway_payload.py} (84%) rename services/vpn/src/stackit/vpn/models/{create_vpn_gateway_payload_availability_zones.py => create_gateway_payload_availability_zones.py} (82%) rename services/vpn/src/stackit/vpn/models/{update_vpn_gateway_payload.py => update_gateway_payload.py} (84%) diff --git a/services/vpn/oas_commit b/services/vpn/oas_commit index 36076afe8..f4a2ce25c 100644 --- a/services/vpn/oas_commit +++ b/services/vpn/oas_commit @@ -1 +1 @@ -87a3ad63dec0a953ff5c6072ad9a15fddd8ec5f8 +8f43ed707da765654e4427642c9d978f80d504e1 diff --git a/services/vpn/src/stackit/vpn/__init__.py b/services/vpn/src/stackit/vpn/__init__.py index f996eedb9..1a781c62b 100644 --- a/services/vpn/src/stackit/vpn/__init__.py +++ b/services/vpn/src/stackit/vpn/__init__.py @@ -7,7 +7,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -40,8 +40,8 @@ "ConnectionResponse", "ConnectionStatusResponse", "CreateGatewayConnectionPayload", - "CreateVPNGatewayPayload", - "CreateVPNGatewayPayloadAvailabilityZones", + "CreateGatewayPayload", + "CreateGatewayPayloadAvailabilityZones", "Gateway", "GatewayList", "GatewayResponse", @@ -63,7 +63,7 @@ "TunnelConfigurationPhase2", "TunnelStatus", "UpdateGatewayConnectionPayload", - "UpdateVPNGatewayPayload", + "UpdateGatewayPayload", "VPNTunnels", ] @@ -100,11 +100,11 @@ from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload as CreateGatewayConnectionPayload, ) -from stackit.vpn.models.create_vpn_gateway_payload import ( - CreateVPNGatewayPayload as CreateVPNGatewayPayload, +from stackit.vpn.models.create_gateway_payload import ( + CreateGatewayPayload as CreateGatewayPayload, ) -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones as CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones as CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.gateway import Gateway as Gateway from stackit.vpn.models.gateway_list import GatewayList as GatewayList @@ -139,7 +139,7 @@ from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload as UpdateGatewayConnectionPayload, ) -from stackit.vpn.models.update_vpn_gateway_payload import ( - UpdateVPNGatewayPayload as UpdateVPNGatewayPayload, +from stackit.vpn.models.update_gateway_payload import ( + UpdateGatewayPayload as UpdateGatewayPayload, ) from stackit.vpn.models.vpn_tunnels import VPNTunnels as VPNTunnels diff --git a/services/vpn/src/stackit/vpn/api/default_api.py b/services/vpn/src/stackit/vpn/api/default_api.py index b5f4d779f..c47f17b51 100644 --- a/services/vpn/src/stackit/vpn/api/default_api.py +++ b/services/vpn/src/stackit/vpn/api/default_api.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -26,7 +26,7 @@ from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload, ) -from stackit.vpn.models.create_vpn_gateway_payload import CreateVPNGatewayPayload +from stackit.vpn.models.create_gateway_payload import CreateGatewayPayload from stackit.vpn.models.gateway_list import GatewayList from stackit.vpn.models.gateway_response import GatewayResponse from stackit.vpn.models.gateway_status_response import GatewayStatusResponse @@ -36,7 +36,7 @@ from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload, ) -from stackit.vpn.models.update_vpn_gateway_payload import UpdateVPNGatewayPayload +from stackit.vpn.models.update_gateway_payload import UpdateGatewayPayload from stackit.vpn.rest import RESTResponseType @@ -54,12 +54,11 @@ def __init__(self, configuration: Configuration = None) -> None: self.api_client = ApiClient(self.configuration) @validate_call - def create_gateway_connection( + def create_gateway( self, project_id: StrictStr, region: Region, - gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_payload: CreateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -69,19 +68,17 @@ def create_gateway_connection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionResponse: - """Create a new connection on an existing VPN gateway. + ) -> GatewayResponse: + """Create a VPN gateway in a project. - Create a new connection on an existing VPN gateway. + Provision a new VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param gateway_id: (required) - :type gateway_id: UUID - :param create_gateway_connection_payload: - :type create_gateway_connection_payload: CreateGatewayConnectionPayload + :param create_gateway_payload: (required) + :type create_gateway_payload: CreateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -104,11 +101,10 @@ def create_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_serialize( project_id=project_id, region=region, - gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_payload=create_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -116,11 +112,11 @@ def create_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -131,12 +127,11 @@ def create_gateway_connection( ).data @validate_call - def create_gateway_connection_with_http_info( + def create_gateway_with_http_info( self, project_id: StrictStr, region: Region, - gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_payload: CreateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -146,19 +141,17 @@ def create_gateway_connection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ConnectionResponse]: - """Create a new connection on an existing VPN gateway. + ) -> ApiResponse[GatewayResponse]: + """Create a VPN gateway in a project. - Create a new connection on an existing VPN gateway. + Provision a new VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param gateway_id: (required) - :type gateway_id: UUID - :param create_gateway_connection_payload: - :type create_gateway_connection_payload: CreateGatewayConnectionPayload + :param create_gateway_payload: (required) + :type create_gateway_payload: CreateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -181,11 +174,10 @@ def create_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_serialize( project_id=project_id, region=region, - gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_payload=create_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -193,11 +185,11 @@ def create_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -208,12 +200,11 @@ def create_gateway_connection_with_http_info( ) @validate_call - def create_gateway_connection_without_preload_content( + def create_gateway_without_preload_content( self, project_id: StrictStr, region: Region, - gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_payload: CreateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -224,18 +215,16 @@ def create_gateway_connection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a new connection on an existing VPN gateway. + """Create a VPN gateway in a project. - Create a new connection on an existing VPN gateway. + Provision a new VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param gateway_id: (required) - :type gateway_id: UUID - :param create_gateway_connection_payload: - :type create_gateway_connection_payload: CreateGatewayConnectionPayload + :param create_gateway_payload: (required) + :type create_gateway_payload: CreateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -258,11 +247,10 @@ def create_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_serialize( project_id=project_id, region=region, - gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_payload=create_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -270,22 +258,21 @@ def create_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_gateway_connection_serialize( + def _create_gateway_serialize( self, project_id, region, - gateway_id, - create_gateway_connection_payload, + create_gateway_payload, _request_auth, _content_type, _headers, @@ -308,14 +295,12 @@ def _create_gateway_connection_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region.value - if gateway_id is not None: - _path_params["gatewayId"] = gateway_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_gateway_connection_payload is not None: - _body_params = create_gateway_connection_payload + if create_gateway_payload is not None: + _body_params = create_gateway_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -334,7 +319,7 @@ def _create_gateway_connection_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -348,11 +333,12 @@ def _create_gateway_connection_serialize( ) @validate_call - def create_vpn_gateway( + def create_gateway_connection( self, project_id: StrictStr, region: Region, - create_vpn_gateway_payload: CreateVPNGatewayPayload, + gateway_id: UUID, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -362,17 +348,19 @@ def create_vpn_gateway( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GatewayResponse: - """Create a VPN gateway in a project. + ) -> ConnectionResponse: + """Create a new connection on an existing VPN gateway. - Provision a new VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param create_vpn_gateway_payload: (required) - :type create_vpn_gateway_payload: CreateVPNGatewayPayload + :param gateway_id: (required) + :type gateway_id: UUID + :param create_gateway_connection_payload: + :type create_gateway_connection_payload: CreateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -395,10 +383,11 @@ def create_vpn_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._create_vpn_gateway_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, - create_vpn_gateway_payload=create_vpn_gateway_payload, + gateway_id=gateway_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -406,11 +395,11 @@ def create_vpn_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -421,11 +410,12 @@ def create_vpn_gateway( ).data @validate_call - def create_vpn_gateway_with_http_info( + def create_gateway_connection_with_http_info( self, project_id: StrictStr, region: Region, - create_vpn_gateway_payload: CreateVPNGatewayPayload, + gateway_id: UUID, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -435,17 +425,19 @@ def create_vpn_gateway_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GatewayResponse]: - """Create a VPN gateway in a project. + ) -> ApiResponse[ConnectionResponse]: + """Create a new connection on an existing VPN gateway. - Provision a new VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param create_vpn_gateway_payload: (required) - :type create_vpn_gateway_payload: CreateVPNGatewayPayload + :param gateway_id: (required) + :type gateway_id: UUID + :param create_gateway_connection_payload: + :type create_gateway_connection_payload: CreateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -468,10 +460,11 @@ def create_vpn_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_vpn_gateway_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, - create_vpn_gateway_payload=create_vpn_gateway_payload, + gateway_id=gateway_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -479,11 +472,11 @@ def create_vpn_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -494,11 +487,12 @@ def create_vpn_gateway_with_http_info( ) @validate_call - def create_vpn_gateway_without_preload_content( + def create_gateway_connection_without_preload_content( self, project_id: StrictStr, region: Region, - create_vpn_gateway_payload: CreateVPNGatewayPayload, + gateway_id: UUID, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -509,16 +503,18 @@ def create_vpn_gateway_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a VPN gateway in a project. + """Create a new connection on an existing VPN gateway. - Provision a new VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param create_vpn_gateway_payload: (required) - :type create_vpn_gateway_payload: CreateVPNGatewayPayload + :param gateway_id: (required) + :type gateway_id: UUID + :param create_gateway_connection_payload: + :type create_gateway_connection_payload: CreateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -541,10 +537,11 @@ def create_vpn_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_vpn_gateway_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, - create_vpn_gateway_payload=create_vpn_gateway_payload, + gateway_id=gateway_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -552,21 +549,22 @@ def create_vpn_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_vpn_gateway_serialize( + def _create_gateway_connection_serialize( self, project_id, region, - create_vpn_gateway_payload, + gateway_id, + create_gateway_connection_payload, _request_auth, _content_type, _headers, @@ -589,12 +587,14 @@ def _create_vpn_gateway_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region.value + if gateway_id is not None: + _path_params["gatewayId"] = gateway_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_vpn_gateway_payload is not None: - _body_params = create_vpn_gateway_payload + if create_gateway_connection_payload is not None: + _body_params = create_gateway_connection_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -613,7 +613,7 @@ def _create_vpn_gateway_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -627,12 +627,11 @@ def _create_vpn_gateway_serialize( ) @validate_call - def delete_gateway_connection( + def delete_gateway( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -643,9 +642,9 @@ def delete_gateway_connection( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete a certain connection from an existing VPN gateway. + """Delete a existing VPN gateway in a project. - Delete a certain connection from an existing VPN gateway. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -653,8 +652,6 @@ def delete_gateway_connection( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -677,11 +674,10 @@ def delete_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -693,7 +689,6 @@ def delete_gateway_connection( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -704,12 +699,11 @@ def delete_gateway_connection( ).data @validate_call - def delete_gateway_connection_with_http_info( + def delete_gateway_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -720,9 +714,9 @@ def delete_gateway_connection_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete a certain connection from an existing VPN gateway. + """Delete a existing VPN gateway in a project. - Delete a certain connection from an existing VPN gateway. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -730,8 +724,6 @@ def delete_gateway_connection_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -754,11 +746,10 @@ def delete_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -770,7 +761,6 @@ def delete_gateway_connection_with_http_info( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -781,12 +771,11 @@ def delete_gateway_connection_with_http_info( ) @validate_call - def delete_gateway_connection_without_preload_content( + def delete_gateway_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -797,9 +786,9 @@ def delete_gateway_connection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a certain connection from an existing VPN gateway. + """Delete a existing VPN gateway in a project. - Delete a certain connection from an existing VPN gateway. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -807,8 +796,6 @@ def delete_gateway_connection_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -831,11 +818,10 @@ def delete_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -847,18 +833,16 @@ def delete_gateway_connection_without_preload_content( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_gateway_connection_serialize( + def _delete_gateway_serialize( self, project_id, region, gateway_id, - connection_id, _request_auth, _content_type, _headers, @@ -883,8 +867,6 @@ def _delete_gateway_connection_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id - if connection_id is not None: - _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters @@ -899,7 +881,7 @@ def _delete_gateway_connection_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -913,11 +895,12 @@ def _delete_gateway_connection_serialize( ) @validate_call - def delete_vpn_gateway( + def delete_gateway_connection( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -928,9 +911,9 @@ def delete_vpn_gateway( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete a existing VPN gateway in a project. + """Delete a certain connection from an existing VPN gateway. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -938,6 +921,8 @@ def delete_vpn_gateway( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -960,10 +945,11 @@ def delete_vpn_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vpn_gateway_serialize( + _param = self._delete_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -975,6 +961,7 @@ def delete_vpn_gateway( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -985,11 +972,12 @@ def delete_vpn_gateway( ).data @validate_call - def delete_vpn_gateway_with_http_info( + def delete_gateway_connection_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1000,9 +988,9 @@ def delete_vpn_gateway_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete a existing VPN gateway in a project. + """Delete a certain connection from an existing VPN gateway. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1010,6 +998,8 @@ def delete_vpn_gateway_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1032,10 +1022,11 @@ def delete_vpn_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vpn_gateway_serialize( + _param = self._delete_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1047,6 +1038,7 @@ def delete_vpn_gateway_with_http_info( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1057,11 +1049,12 @@ def delete_vpn_gateway_with_http_info( ) @validate_call - def delete_vpn_gateway_without_preload_content( + def delete_gateway_connection_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1072,9 +1065,9 @@ def delete_vpn_gateway_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a existing VPN gateway in a project. + """Delete a certain connection from an existing VPN gateway. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1082,6 +1075,8 @@ def delete_vpn_gateway_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1104,10 +1099,11 @@ def delete_vpn_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vpn_gateway_serialize( + _param = self._delete_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1119,16 +1115,18 @@ def delete_vpn_gateway_without_preload_content( "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_vpn_gateway_serialize( + def _delete_gateway_connection_serialize( self, project_id, region, gateway_id, + connection_id, _request_auth, _content_type, _headers, @@ -1153,6 +1151,8 @@ def _delete_vpn_gateway_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id + if connection_id is not None: + _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters @@ -1167,7 +1167,7 @@ def _delete_vpn_gateway_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1181,12 +1181,11 @@ def _delete_vpn_gateway_serialize( ) @validate_call - def get_gateway_connection( + def get_gateway( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1196,10 +1195,10 @@ def get_gateway_connection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionResponse: - """Get a certain connection for an existing VPN gateway. + ) -> GatewayResponse: + """Get details of a VPN Gateway in a project. - Get a certain connection for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -1207,8 +1206,6 @@ def get_gateway_connection( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1231,11 +1228,10 @@ def get_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1243,7 +1239,7 @@ def get_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1258,12 +1254,11 @@ def get_gateway_connection( ).data @validate_call - def get_gateway_connection_with_http_info( + def get_gateway_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1273,10 +1268,10 @@ def get_gateway_connection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ConnectionResponse]: - """Get a certain connection for an existing VPN gateway. + ) -> ApiResponse[GatewayResponse]: + """Get details of a VPN Gateway in a project. - Get a certain connection for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -1284,8 +1279,6 @@ def get_gateway_connection_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1308,11 +1301,10 @@ def get_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1320,7 +1312,7 @@ def get_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1335,12 +1327,11 @@ def get_gateway_connection_with_http_info( ) @validate_call - def get_gateway_connection_without_preload_content( + def get_gateway_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1351,9 +1342,9 @@ def get_gateway_connection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get a certain connection for an existing VPN gateway. + """Get details of a VPN Gateway in a project. - Get a certain connection for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -1361,8 +1352,6 @@ def get_gateway_connection_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1385,11 +1374,10 @@ def get_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1397,7 +1385,7 @@ def get_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1407,12 +1395,11 @@ def get_gateway_connection_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_gateway_connection_serialize( + def _get_gateway_serialize( self, project_id, region, gateway_id, - connection_id, _request_auth, _content_type, _headers, @@ -1437,8 +1424,6 @@ def _get_gateway_connection_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id - if connection_id is not None: - _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters @@ -1453,7 +1438,7 @@ def _get_gateway_connection_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1467,7 +1452,7 @@ def _get_gateway_connection_serialize( ) @validate_call - def get_gateway_connection_status( + def get_gateway_connection( self, project_id: StrictStr, region: Region, @@ -1482,10 +1467,10 @@ def get_gateway_connection_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionStatusResponse: - """Gets the status for a specific connection. + ) -> ConnectionResponse: + """Get a certain connection for an existing VPN gateway. - Get the status for a specific connection. + Get a certain connection for an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1517,7 +1502,7 @@ def get_gateway_connection_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._get_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1529,7 +1514,7 @@ def get_gateway_connection_status( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1544,7 +1529,7 @@ def get_gateway_connection_status( ).data @validate_call - def get_gateway_connection_status_with_http_info( + def get_gateway_connection_with_http_info( self, project_id: StrictStr, region: Region, @@ -1559,10 +1544,10 @@ def get_gateway_connection_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ConnectionStatusResponse]: - """Gets the status for a specific connection. + ) -> ApiResponse[ConnectionResponse]: + """Get a certain connection for an existing VPN gateway. - Get the status for a specific connection. + Get a certain connection for an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1594,7 +1579,7 @@ def get_gateway_connection_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._get_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1606,7 +1591,7 @@ def get_gateway_connection_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1621,7 +1606,7 @@ def get_gateway_connection_status_with_http_info( ) @validate_call - def get_gateway_connection_status_without_preload_content( + def get_gateway_connection_without_preload_content( self, project_id: StrictStr, region: Region, @@ -1637,9 +1622,9 @@ def get_gateway_connection_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the status for a specific connection. + """Get a certain connection for an existing VPN gateway. - Get the status for a specific connection. + Get a certain connection for an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1671,7 +1656,7 @@ def get_gateway_connection_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._get_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1683,7 +1668,7 @@ def get_gateway_connection_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1693,7 +1678,7 @@ def get_gateway_connection_status_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_gateway_connection_status_serialize( + def _get_gateway_connection_serialize( self, project_id, region, @@ -1739,7 +1724,7 @@ def _get_gateway_connection_status_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1753,11 +1738,12 @@ def _get_gateway_connection_status_serialize( ) @validate_call - def get_vpn_gateway( + def get_gateway_connection_status( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1767,10 +1753,10 @@ def get_vpn_gateway( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GatewayResponse: - """Get details of a VPN Gateway in a project. + ) -> ConnectionStatusResponse: + """Gets the status for a specific connection. - Get details of a VPN Gateway in a project. + Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1778,6 +1764,8 @@ def get_vpn_gateway( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1800,10 +1788,11 @@ def get_vpn_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_serialize( + _param = self._get_gateway_connection_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1811,7 +1800,7 @@ def get_vpn_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionStatusResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1826,11 +1815,12 @@ def get_vpn_gateway( ).data @validate_call - def get_vpn_gateway_with_http_info( + def get_gateway_connection_status_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1840,10 +1830,10 @@ def get_vpn_gateway_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GatewayResponse]: - """Get details of a VPN Gateway in a project. + ) -> ApiResponse[ConnectionStatusResponse]: + """Gets the status for a specific connection. - Get details of a VPN Gateway in a project. + Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1851,6 +1841,8 @@ def get_vpn_gateway_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1873,10 +1865,11 @@ def get_vpn_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_serialize( + _param = self._get_gateway_connection_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1884,7 +1877,7 @@ def get_vpn_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionStatusResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1899,11 +1892,12 @@ def get_vpn_gateway_with_http_info( ) @validate_call - def get_vpn_gateway_without_preload_content( + def get_gateway_connection_status_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, + connection_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1914,9 +1908,9 @@ def get_vpn_gateway_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details of a VPN Gateway in a project. + """Gets the status for a specific connection. - Get details of a VPN Gateway in a project. + Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1924,6 +1918,8 @@ def get_vpn_gateway_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param connection_id: (required) + :type connection_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1946,10 +1942,11 @@ def get_vpn_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_serialize( + _param = self._get_gateway_connection_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + connection_id=connection_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1957,7 +1954,7 @@ def get_vpn_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionStatusResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1967,11 +1964,12 @@ def get_vpn_gateway_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_vpn_gateway_serialize( + def _get_gateway_connection_status_serialize( self, project_id, region, gateway_id, + connection_id, _request_auth, _content_type, _headers, @@ -1996,6 +1994,8 @@ def _get_vpn_gateway_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id + if connection_id is not None: + _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters @@ -2010,7 +2010,7 @@ def _get_vpn_gateway_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2024,7 +2024,7 @@ def _get_vpn_gateway_serialize( ) @validate_call - def get_vpn_gateway_status( + def get_gateway_status( self, project_id: StrictStr, region: Region, @@ -2071,7 +2071,7 @@ def get_vpn_gateway_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_status_serialize( + _param = self._get_gateway_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -2097,7 +2097,7 @@ def get_vpn_gateway_status( ).data @validate_call - def get_vpn_gateway_status_with_http_info( + def get_gateway_status_with_http_info( self, project_id: StrictStr, region: Region, @@ -2144,7 +2144,7 @@ def get_vpn_gateway_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_status_serialize( + _param = self._get_gateway_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -2170,7 +2170,7 @@ def get_vpn_gateway_status_with_http_info( ) @validate_call - def get_vpn_gateway_status_without_preload_content( + def get_gateway_status_without_preload_content( self, project_id: StrictStr, region: Region, @@ -2217,7 +2217,7 @@ def get_vpn_gateway_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_vpn_gateway_status_serialize( + _param = self._get_gateway_status_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -2238,7 +2238,7 @@ def get_vpn_gateway_status_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_vpn_gateway_status_serialize( + def _get_gateway_status_serialize( self, project_id, region, @@ -2281,7 +2281,7 @@ def _get_vpn_gateway_status_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2575,7 +2575,7 @@ def _list_gateway_connections_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2589,9 +2589,13 @@ def _list_gateway_connections_serialize( ) @validate_call - def list_plans( + def list_gateways( self, + project_id: StrictStr, region: Region, + label_selector: Annotated[ + Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2601,13 +2605,17 @@ def list_plans( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlanList: - """List available service plans for a project. + ) -> GatewayList: + """List VPN gateways in a project with label filtering - Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. + Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + :param project_id: (required) + :type project_id: str :param region: (required) :type region: Region + :param label_selector: Filter resources by labels. + :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2630,8 +2638,10 @@ def list_plans( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_gateways_serialize( + project_id=project_id, region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2639,9 +2649,11 @@ def list_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "GatewayList", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2651,9 +2663,13 @@ def list_plans( ).data @validate_call - def list_plans_with_http_info( + def list_gateways_with_http_info( self, + project_id: StrictStr, region: Region, + label_selector: Annotated[ + Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2663,13 +2679,17 @@ def list_plans_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlanList]: - """List available service plans for a project. + ) -> ApiResponse[GatewayList]: + """List VPN gateways in a project with label filtering - Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. + Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + :param project_id: (required) + :type project_id: str :param region: (required) :type region: Region + :param label_selector: Filter resources by labels. + :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2692,8 +2712,10 @@ def list_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_gateways_serialize( + project_id=project_id, region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2701,9 +2723,11 @@ def list_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "GatewayList", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2713,9 +2737,13 @@ def list_plans_with_http_info( ) @validate_call - def list_plans_without_preload_content( + def list_gateways_without_preload_content( self, + project_id: StrictStr, region: Region, + label_selector: Annotated[ + Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2726,12 +2754,16 @@ def list_plans_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List available service plans for a project. + """List VPN gateways in a project with label filtering - Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. + Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + :param project_id: (required) + :type project_id: str :param region: (required) :type region: Region + :param label_selector: Filter resources by labels. + :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2754,8 +2786,10 @@ def list_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_gateways_serialize( + project_id=project_id, region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2763,16 +2797,20 @@ def list_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "GatewayList", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_plans_serialize( + def _list_gateways_serialize( self, + project_id, region, + label_selector, _request_auth, _content_type, _headers, @@ -2791,9 +2829,15 @@ def _list_plans_serialize( _body_params: Optional[bytes] = None # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region.value # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -2807,7 +2851,7 @@ def _list_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/regions/{region}/plans", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2821,9 +2865,8 @@ def _list_plans_serialize( ) @validate_call - def list_quotas( + def list_plans( self, - project_id: StrictStr, region: Region, _request_timeout: Union[ None, @@ -2834,13 +2877,11 @@ def list_quotas( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> QuotaListResponse: - """List project quotas. + ) -> PlanList: + """List available service plans for a project. - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: Region :param _request_timeout: timeout setting for this request. If one @@ -2865,8 +2906,7 @@ def list_quotas( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( - project_id=project_id, + _param = self._list_plans_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, @@ -2875,7 +2915,7 @@ def list_quotas( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "PlanList", "400": "APIErrorResponse", "401": "APIErrorResponse", } @@ -2887,9 +2927,8 @@ def list_quotas( ).data @validate_call - def list_quotas_with_http_info( + def list_plans_with_http_info( self, - project_id: StrictStr, region: Region, _request_timeout: Union[ None, @@ -2900,13 +2939,11 @@ def list_quotas_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[QuotaListResponse]: - """List project quotas. + ) -> ApiResponse[PlanList]: + """List available service plans for a project. - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: Region :param _request_timeout: timeout setting for this request. If one @@ -2931,8 +2968,7 @@ def list_quotas_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( - project_id=project_id, + _param = self._list_plans_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, @@ -2941,7 +2977,7 @@ def list_quotas_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "PlanList", "400": "APIErrorResponse", "401": "APIErrorResponse", } @@ -2953,9 +2989,8 @@ def list_quotas_with_http_info( ) @validate_call - def list_quotas_without_preload_content( + def list_plans_without_preload_content( self, - project_id: StrictStr, region: Region, _request_timeout: Union[ None, @@ -2967,12 +3002,10 @@ def list_quotas_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List project quotas. + """List available service plans for a project. - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: Region :param _request_timeout: timeout setting for this request. If one @@ -2997,8 +3030,7 @@ def list_quotas_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( - project_id=project_id, + _param = self._list_plans_serialize( region=region, _request_auth=_request_auth, _content_type=_content_type, @@ -3007,16 +3039,15 @@ def list_quotas_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "PlanList", "400": "APIErrorResponse", "401": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_quotas_serialize( + def _list_plans_serialize( self, - project_id, region, _request_auth, _content_type, @@ -3036,8 +3067,6 @@ def _list_quotas_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region.value # process the query parameters @@ -3054,7 +3083,7 @@ def _list_quotas_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/quotas", + resource_path="/v1/regions/{region}/plans", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3068,13 +3097,10 @@ def _list_quotas_serialize( ) @validate_call - def list_vpn_gateways( + def list_quotas( self, project_id: StrictStr, region: Region, - label_selector: Annotated[ - Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3084,17 +3110,15 @@ def list_vpn_gateways( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GatewayList: - """List VPN gateways in a project with label filtering + ) -> QuotaListResponse: + """List project quotas. - Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param label_selector: Filter resources by labels. - :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3117,10 +3141,9 @@ def list_vpn_gateways( :return: Returns the result object. """ # noqa: E501 - _param = self._list_vpn_gateways_serialize( + _param = self._list_quotas_serialize( project_id=project_id, region=region, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3128,11 +3151,9 @@ def list_vpn_gateways( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "QuotaListResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", - "403": "APIErrorResponse", - "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3142,13 +3163,10 @@ def list_vpn_gateways( ).data @validate_call - def list_vpn_gateways_with_http_info( + def list_quotas_with_http_info( self, project_id: StrictStr, region: Region, - label_selector: Annotated[ - Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3158,17 +3176,15 @@ def list_vpn_gateways_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GatewayList]: - """List VPN gateways in a project with label filtering + ) -> ApiResponse[QuotaListResponse]: + """List project quotas. - Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param label_selector: Filter resources by labels. - :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3191,10 +3207,9 @@ def list_vpn_gateways_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_vpn_gateways_serialize( + _param = self._list_quotas_serialize( project_id=project_id, region=region, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3202,11 +3217,9 @@ def list_vpn_gateways_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "QuotaListResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", - "403": "APIErrorResponse", - "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3216,13 +3229,10 @@ def list_vpn_gateways_with_http_info( ) @validate_call - def list_vpn_gateways_without_preload_content( + def list_quotas_without_preload_content( self, project_id: StrictStr, region: Region, - label_selector: Annotated[ - Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3233,16 +3243,14 @@ def list_vpn_gateways_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List VPN gateways in a project with label filtering + """List project quotas. - Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter. + Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region - :param label_selector: Filter resources by labels. - :type label_selector: Dict[str, str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3265,10 +3273,9 @@ def list_vpn_gateways_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_vpn_gateways_serialize( + _param = self._list_quotas_serialize( project_id=project_id, region=region, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3276,20 +3283,17 @@ def list_vpn_gateways_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "QuotaListResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", - "403": "APIErrorResponse", - "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_vpn_gateways_serialize( + def _list_quotas_serialize( self, project_id, region, - label_selector, _request_auth, _content_type, _headers, @@ -3313,10 +3317,6 @@ def _list_vpn_gateways_serialize( if region is not None: _path_params["region"] = region.value # process the query parameters - if label_selector is not None: - - _query_params.append(("label_selector", label_selector)) - # process the header parameters # process the form parameters # process the body parameter @@ -3330,7 +3330,7 @@ def _list_vpn_gateways_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways", + resource_path="/v1/projects/{projectId}/regions/{region}/quotas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3344,13 +3344,12 @@ def _list_vpn_gateways_serialize( ) @validate_call - def update_gateway_connection( + def update_gateway( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, - update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, + update_gateway_payload: UpdateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3360,10 +3359,10 @@ def update_gateway_connection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionResponse: - """Update a connection on an existing VPN gateway. + ) -> GatewayResponse: + """Update a VPN gateway in a project. - Updating the configuration of an existing connection. + Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. :param project_id: (required) :type project_id: str @@ -3371,10 +3370,8 @@ def update_gateway_connection( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str - :param update_gateway_connection_payload: - :type update_gateway_connection_payload: UpdateGatewayConnectionPayload + :param update_gateway_payload: (required) + :type update_gateway_payload: UpdateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3397,12 +3394,11 @@ def update_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_connection_serialize( + _param = self._update_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, - update_gateway_connection_payload=update_gateway_connection_payload, + update_gateway_payload=update_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3410,11 +3406,11 @@ def update_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3425,13 +3421,12 @@ def update_gateway_connection( ).data @validate_call - def update_gateway_connection_with_http_info( + def update_gateway_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, - update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, + update_gateway_payload: UpdateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3441,10 +3436,10 @@ def update_gateway_connection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ConnectionResponse]: - """Update a connection on an existing VPN gateway. + ) -> ApiResponse[GatewayResponse]: + """Update a VPN gateway in a project. - Updating the configuration of an existing connection. + Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. :param project_id: (required) :type project_id: str @@ -3452,10 +3447,8 @@ def update_gateway_connection_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str - :param update_gateway_connection_payload: - :type update_gateway_connection_payload: UpdateGatewayConnectionPayload + :param update_gateway_payload: (required) + :type update_gateway_payload: UpdateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3478,12 +3471,11 @@ def update_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_connection_serialize( + _param = self._update_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, - update_gateway_connection_payload=update_gateway_connection_payload, + update_gateway_payload=update_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3491,11 +3483,11 @@ def update_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3506,13 +3498,12 @@ def update_gateway_connection_with_http_info( ) @validate_call - def update_gateway_connection_without_preload_content( + def update_gateway_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, - update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, + update_gateway_payload: UpdateGatewayPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3523,9 +3514,9 @@ def update_gateway_connection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a connection on an existing VPN gateway. + """Update a VPN gateway in a project. - Updating the configuration of an existing connection. + Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. :param project_id: (required) :type project_id: str @@ -3533,10 +3524,8 @@ def update_gateway_connection_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str - :param update_gateway_connection_payload: - :type update_gateway_connection_payload: UpdateGatewayConnectionPayload + :param update_gateway_payload: (required) + :type update_gateway_payload: UpdateGatewayPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3559,12 +3548,11 @@ def update_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_connection_serialize( + _param = self._update_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, - update_gateway_connection_payload=update_gateway_connection_payload, + update_gateway_payload=update_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3572,23 +3560,22 @@ def update_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", + "409": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_gateway_connection_serialize( + def _update_gateway_serialize( self, project_id, region, gateway_id, - connection_id, - update_gateway_connection_payload, + update_gateway_payload, _request_auth, _content_type, _headers, @@ -3613,14 +3600,12 @@ def _update_gateway_connection_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id - if connection_id is not None: - _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_gateway_connection_payload is not None: - _body_params = update_gateway_connection_payload + if update_gateway_payload is not None: + _body_params = update_gateway_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3639,7 +3624,7 @@ def _update_gateway_connection_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3653,12 +3638,13 @@ def _update_gateway_connection_serialize( ) @validate_call - def update_vpn_gateway( + def update_gateway_connection( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_vpn_gateway_payload: UpdateVPNGatewayPayload, + connection_id: StrictStr, + update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3668,10 +3654,10 @@ def update_vpn_gateway( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GatewayResponse: - """Update a VPN gateway in a project. + ) -> ConnectionResponse: + """Update a connection on an existing VPN gateway. - Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. + Updating the configuration of an existing connection. :param project_id: (required) :type project_id: str @@ -3679,8 +3665,10 @@ def update_vpn_gateway( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_vpn_gateway_payload: (required) - :type update_vpn_gateway_payload: UpdateVPNGatewayPayload + :param connection_id: (required) + :type connection_id: str + :param update_gateway_connection_payload: + :type update_gateway_connection_payload: UpdateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3703,11 +3691,12 @@ def update_vpn_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._update_vpn_gateway_serialize( + _param = self._update_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_vpn_gateway_payload=update_vpn_gateway_payload, + connection_id=connection_id, + update_gateway_connection_payload=update_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3715,11 +3704,11 @@ def update_vpn_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3730,12 +3719,13 @@ def update_vpn_gateway( ).data @validate_call - def update_vpn_gateway_with_http_info( + def update_gateway_connection_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_vpn_gateway_payload: UpdateVPNGatewayPayload, + connection_id: StrictStr, + update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3745,10 +3735,10 @@ def update_vpn_gateway_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GatewayResponse]: - """Update a VPN gateway in a project. + ) -> ApiResponse[ConnectionResponse]: + """Update a connection on an existing VPN gateway. - Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. + Updating the configuration of an existing connection. :param project_id: (required) :type project_id: str @@ -3756,8 +3746,10 @@ def update_vpn_gateway_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_vpn_gateway_payload: (required) - :type update_vpn_gateway_payload: UpdateVPNGatewayPayload + :param connection_id: (required) + :type connection_id: str + :param update_gateway_connection_payload: + :type update_gateway_connection_payload: UpdateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3780,11 +3772,12 @@ def update_vpn_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_vpn_gateway_serialize( + _param = self._update_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_vpn_gateway_payload=update_vpn_gateway_payload, + connection_id=connection_id, + update_gateway_connection_payload=update_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3792,11 +3785,11 @@ def update_vpn_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3807,12 +3800,13 @@ def update_vpn_gateway_with_http_info( ) @validate_call - def update_vpn_gateway_without_preload_content( + def update_gateway_connection_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_vpn_gateway_payload: UpdateVPNGatewayPayload, + connection_id: StrictStr, + update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3823,9 +3817,9 @@ def update_vpn_gateway_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a VPN gateway in a project. + """Update a connection on an existing VPN gateway. - Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations. + Updating the configuration of an existing connection. :param project_id: (required) :type project_id: str @@ -3833,8 +3827,10 @@ def update_vpn_gateway_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_vpn_gateway_payload: (required) - :type update_vpn_gateway_payload: UpdateVPNGatewayPayload + :param connection_id: (required) + :type connection_id: str + :param update_gateway_connection_payload: + :type update_gateway_connection_payload: UpdateGatewayConnectionPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3857,11 +3853,12 @@ def update_vpn_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_vpn_gateway_serialize( + _param = self._update_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_vpn_gateway_payload=update_vpn_gateway_payload, + connection_id=connection_id, + update_gateway_connection_payload=update_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3869,22 +3866,23 @@ def update_vpn_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "409": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_vpn_gateway_serialize( + def _update_gateway_connection_serialize( self, project_id, region, gateway_id, - update_vpn_gateway_payload, + connection_id, + update_gateway_connection_payload, _request_auth, _content_type, _headers, @@ -3909,12 +3907,14 @@ def _update_vpn_gateway_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id + if connection_id is not None: + _path_params["connectionId"] = connection_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_vpn_gateway_payload is not None: - _body_params = update_vpn_gateway_payload + if update_gateway_connection_payload is not None: + _body_params = update_gateway_connection_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3933,7 +3933,7 @@ def _update_vpn_gateway_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/vpn/src/stackit/vpn/api_client.py b/services/vpn/src/stackit/vpn/api_client.py index 9d5053fa5..4f81b385e 100644 --- a/services/vpn/src/stackit/vpn/api_client.py +++ b/services/vpn/src/stackit/vpn/api_client.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -66,6 +66,7 @@ class ApiClient: "date": datetime.date, "datetime": datetime.datetime, "decimal": decimal.Decimal, + "UUID": uuid.UUID, "object": object, } _pool = None @@ -265,7 +266,7 @@ def response_deserialize( response_text = None return_data = None try: - if response_type == "bytearray": + if response_type in ("bytearray", "bytes"): return_data = response_data.data elif response_type == "file": return_data = self.__deserialize_file(response_data) @@ -326,25 +327,20 @@ def sanitize_for_serialization(self, obj): return obj.isoformat() elif isinstance(obj, decimal.Decimal): return str(obj) - elif isinstance(obj, dict): - obj_dict = obj + return {key: self.sanitize_for_serialization(val) for key, val in obj.items()} + + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009 + obj_dict = obj.to_dict() else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009 - obj_dict = obj.to_dict() - else: - obj_dict = obj.__dict__ - - if isinstance(obj_dict, list): - # 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 - return self.sanitize_for_serialization(obj_dict) + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} + return self.sanitize_for_serialization(obj_dict) def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. @@ -417,6 +413,8 @@ def __deserialize(self, data, klass): return self.__deserialize_datetime(data) elif klass is decimal.Decimal: return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/services/vpn/src/stackit/vpn/configuration.py b/services/vpn/src/stackit/vpn/configuration.py index fd94651f4..bdb518195 100644 --- a/services/vpn/src/stackit/vpn/configuration.py +++ b/services/vpn/src/stackit/vpn/configuration.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/vpn/src/stackit/vpn/exceptions.py b/services/vpn/src/stackit/vpn/exceptions.py index 6d62709fd..843d3b588 100644 --- a/services/vpn/src/stackit/vpn/exceptions.py +++ b/services/vpn/src/stackit/vpn/exceptions.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/vpn/src/stackit/vpn/models/__init__.py b/services/vpn/src/stackit/vpn/models/__init__.py index 105031e08..bbd226953 100644 --- a/services/vpn/src/stackit/vpn/models/__init__.py +++ b/services/vpn/src/stackit/vpn/models/__init__.py @@ -6,7 +6,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -27,9 +27,9 @@ from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload, ) -from stackit.vpn.models.create_vpn_gateway_payload import CreateVPNGatewayPayload -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload import CreateGatewayPayload +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.gateway import Gateway from stackit.vpn.models.gateway_list import GatewayList @@ -54,5 +54,5 @@ from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload, ) -from stackit.vpn.models.update_vpn_gateway_payload import UpdateVPNGatewayPayload +from stackit.vpn.models.update_gateway_payload import UpdateGatewayPayload from stackit.vpn.models.vpn_tunnels import VPNTunnels diff --git a/services/vpn/src/stackit/vpn/models/api_error.py b/services/vpn/src/stackit/vpn/models/api_error.py index 5eaefdca8..7874a7772 100644 --- a/services/vpn/src/stackit/vpn/models/api_error.py +++ b/services/vpn/src/stackit/vpn/models/api_error.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.api_error_detail import APIErrorDetail @@ -35,7 +36,8 @@ class APIError(BaseModel): __properties: ClassVar[List[str]] = ["code", "details", "message", "status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/api_error_detail.py b/services/vpn/src/stackit/vpn/models/api_error_detail.py index b0a61ec6e..28806d27d 100644 --- a/services/vpn/src/stackit/vpn/models/api_error_detail.py +++ b/services/vpn/src/stackit/vpn/models/api_error_detail.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -42,7 +43,8 @@ def reason_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -53,8 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/api_error_response.py b/services/vpn/src/stackit/vpn/models/api_error_response.py index 340d4d387..c347c1335 100644 --- a/services/vpn/src/stackit/vpn/models/api_error_response.py +++ b/services/vpn/src/stackit/vpn/models/api_error_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.api_error import APIError @@ -32,7 +33,8 @@ class APIErrorResponse(BaseModel): __properties: ClassVar[List[str]] = ["error"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/bgp_gateway_config.py b/services/vpn/src/stackit/vpn/models/bgp_gateway_config.py index c7a909047..c60a82be4 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_gateway_config.py +++ b/services/vpn/src/stackit/vpn/models/bgp_gateway_config.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -41,7 +42,8 @@ class BGPGatewayConfig(BaseModel): __properties: ClassVar[List[str]] = ["localAsn", "overrideAdvertisedRoutes"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -52,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/bgp_status.py b/services/vpn/src/stackit/vpn/models/bgp_status.py index 07b7fc994..5c320dfd7 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_status.py +++ b/services/vpn/src/stackit/vpn/models/bgp_status.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.bgp_status_peers import BGPStatusPeers @@ -34,7 +35,8 @@ class BGPStatus(BaseModel): __properties: ClassVar[List[str]] = ["peers", "routes"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/bgp_status_peers.py b/services/vpn/src/stackit/vpn/models/bgp_status_peers.py index 7ff7cf26f..71ad17584 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_status_peers.py +++ b/services/vpn/src/stackit/vpn/models/bgp_status_peers.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -36,7 +37,8 @@ class BGPStatusPeers(BaseModel): __properties: ClassVar[List[str]] = ["localAs", "peerUptime", "pfxRcd", "pfxSnt", "remoteAs", "remoteIP", "state"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -47,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/bgp_status_routes.py b/services/vpn/src/stackit/vpn/models/bgp_status_routes.py index 4281e4c58..558e9c3f5 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_status_routes.py +++ b/services/vpn/src/stackit/vpn/models/bgp_status_routes.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -34,7 +35,8 @@ class BGPStatusRoutes(BaseModel): __properties: ClassVar[List[str]] = ["network", "origin", "path", "peerId", "weight"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py b/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py index b815e9463..f54288bdd 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py +++ b/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -33,7 +34,8 @@ class BGPTunnelConfig(BaseModel): __properties: ClassVar[List[str]] = ["remoteAsn"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/connection_list.py b/services/vpn/src/stackit/vpn/models/connection_list.py index a93c36ebf..1ecc08381 100644 --- a/services/vpn/src/stackit/vpn/models/connection_list.py +++ b/services/vpn/src/stackit/vpn/models/connection_list.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.connection_response import ConnectionResponse @@ -32,7 +33,8 @@ class ConnectionList(BaseModel): __properties: ClassVar[List[str]] = ["connections"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/connection_response.py b/services/vpn/src/stackit/vpn/models/connection_response.py index 38d1a1774..f69404966 100644 --- a/services/vpn/src/stackit/vpn/models/connection_response.py +++ b/services/vpn/src/stackit/vpn/models/connection_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,6 +20,7 @@ from uuid import UUID from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.tunnel_configuration import TunnelConfiguration @@ -75,12 +76,16 @@ class ConnectionResponse(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -91,8 +96,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/connection_status_response.py b/services/vpn/src/stackit/vpn/models/connection_status_response.py index b2590f036..ee045b785 100644 --- a/services/vpn/src/stackit/vpn/models/connection_status_response.py +++ b/services/vpn/src/stackit/vpn/models/connection_status_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -25,6 +25,7 @@ StrictBool, StrictStr, ) +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.tunnel_status import TunnelStatus @@ -44,7 +45,8 @@ class ConnectionStatusResponse(BaseModel): __properties: ClassVar[List[str]] = ["displayName", "enabled", "id", "tunnels"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -55,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/create_gateway_connection_payload.py b/services/vpn/src/stackit/vpn/models/create_gateway_connection_payload.py index 7e637d74f..d938507e0 100644 --- a/services/vpn/src/stackit/vpn/models/create_gateway_connection_payload.py +++ b/services/vpn/src/stackit/vpn/models/create_gateway_connection_payload.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.tunnel_configuration import TunnelConfiguration @@ -67,12 +68,16 @@ class CreateGatewayConnectionPayload(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -83,8 +88,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload.py b/services/vpn/src/stackit/vpn/models/create_gateway_payload.py similarity index 84% rename from services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload.py rename to services/vpn/src/stackit/vpn/models/create_gateway_payload.py index 95bc7e664..38e42dabc 100644 --- a/services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload.py +++ b/services/vpn/src/stackit/vpn/models/create_gateway_payload.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,21 +19,22 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.routing_type import RoutingType -class CreateVPNGatewayPayload(BaseModel): +class CreateGatewayPayload(BaseModel): """ - CreateVPNGatewayPayload + CreateGatewayPayload """ # noqa: E501 - availability_zones: CreateVPNGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") + availability_zones: CreateGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") bgp: Optional[BGPGatewayConfig] = None display_name: Annotated[str, Field(strict=True)] = Field( description="A user-friendly name for the VPN gateway.", alias="displayName" @@ -49,12 +50,16 @@ class CreateVPNGatewayPayload(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -65,12 +70,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateVPNGatewayPayload from a JSON string""" + """Create an instance of CreateGatewayPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -100,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateVPNGatewayPayload from a dict""" + """Create an instance of CreateGatewayPayload from a dict""" if obj is None: return None @@ -110,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZones": ( - CreateVPNGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) + CreateGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) if obj.get("availabilityZones") is not None else None ), diff --git a/services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload_availability_zones.py b/services/vpn/src/stackit/vpn/models/create_gateway_payload_availability_zones.py similarity index 82% rename from services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload_availability_zones.py rename to services/vpn/src/stackit/vpn/models/create_gateway_payload_availability_zones.py index e35134648..32e4d3fe2 100644 --- a/services/vpn/src/stackit/vpn/models/create_vpn_gateway_payload_availability_zones.py +++ b/services/vpn/src/stackit/vpn/models/create_gateway_payload_availability_zones.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,12 +18,13 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self -class CreateVPNGatewayPayloadAvailabilityZones(BaseModel): +class CreateGatewayPayloadAvailabilityZones(BaseModel): """ - CreateVPNGatewayPayloadAvailabilityZones + CreateGatewayPayloadAvailabilityZones """ # noqa: E501 tunnel1: StrictStr = Field(description="Object that represents an availability zone.") @@ -31,7 +32,8 @@ class CreateVPNGatewayPayloadAvailabilityZones(BaseModel): __properties: ClassVar[List[str]] = ["tunnel1", "tunnel2"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,12 +44,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateVPNGatewayPayloadAvailabilityZones from a JSON string""" + """Create an instance of CreateGatewayPayloadAvailabilityZones from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateVPNGatewayPayloadAvailabilityZones from a dict""" + """Create an instance of CreateGatewayPayloadAvailabilityZones from a dict""" if obj is None: return None diff --git a/services/vpn/src/stackit/vpn/models/gateway.py b/services/vpn/src/stackit/vpn/models/gateway.py index 6ca3d44fd..1a77072b9 100644 --- a/services/vpn/src/stackit/vpn/models/gateway.py +++ b/services/vpn/src/stackit/vpn/models/gateway.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,11 +19,12 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.routing_type import RoutingType @@ -33,7 +34,7 @@ class Gateway(BaseModel): Gateway """ # noqa: E501 - availability_zones: CreateVPNGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") + availability_zones: CreateGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") bgp: Optional[BGPGatewayConfig] = None display_name: Annotated[str, Field(strict=True)] = Field( description="A user-friendly name for the VPN gateway.", alias="displayName" @@ -49,12 +50,16 @@ class Gateway(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -65,8 +70,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -110,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZones": ( - CreateVPNGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) + CreateGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) if obj.get("availabilityZones") is not None else None ), diff --git a/services/vpn/src/stackit/vpn/models/gateway_list.py b/services/vpn/src/stackit/vpn/models/gateway_list.py index 0f22b8494..aeea89728 100644 --- a/services/vpn/src/stackit/vpn/models/gateway_list.py +++ b/services/vpn/src/stackit/vpn/models/gateway_list.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.gateway_response import GatewayResponse @@ -32,7 +33,8 @@ class GatewayList(BaseModel): __properties: ClassVar[List[str]] = ["gateways"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/gateway_response.py b/services/vpn/src/stackit/vpn/models/gateway_response.py index cc2694e02..4f3dafecb 100644 --- a/services/vpn/src/stackit/vpn/models/gateway_response.py +++ b/services/vpn/src/stackit/vpn/models/gateway_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,11 +20,12 @@ from uuid import UUID from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.gateway_status import GatewayStatus from stackit.vpn.models.routing_type import RoutingType @@ -35,7 +36,7 @@ class GatewayResponse(BaseModel): GatewayResponse """ # noqa: E501 - availability_zones: CreateVPNGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") + availability_zones: CreateGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") bgp: Optional[BGPGatewayConfig] = None display_name: Annotated[str, Field(strict=True)] = Field( description="A user-friendly name for the VPN gateway.", alias="displayName" @@ -62,12 +63,16 @@ class GatewayResponse(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -78,8 +83,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -128,7 +132,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZones": ( - CreateVPNGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) + CreateGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) if obj.get("availabilityZones") is not None else None ), diff --git a/services/vpn/src/stackit/vpn/models/gateway_status.py b/services/vpn/src/stackit/vpn/models/gateway_status.py index c3a7d7177..c382797ab 100644 --- a/services/vpn/src/stackit/vpn/models/gateway_status.py +++ b/services/vpn/src/stackit/vpn/models/gateway_status.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/vpn/src/stackit/vpn/models/gateway_status_response.py b/services/vpn/src/stackit/vpn/models/gateway_status_response.py index f61d1238c..50d2b66cd 100644 --- a/services/vpn/src/stackit/vpn/models/gateway_status_response.py +++ b/services/vpn/src/stackit/vpn/models/gateway_status_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from uuid import UUID from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.connection_status_response import ConnectionStatusResponse @@ -41,7 +42,8 @@ class GatewayStatusResponse(BaseModel): __properties: ClassVar[List[str]] = ["connections", "displayName", "gatewayStatus", "id", "tunnels"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -52,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/peering_config.py b/services/vpn/src/stackit/vpn/models/peering_config.py index a9d42d1c0..8d77ae61b 100644 --- a/services/vpn/src/stackit/vpn/models/peering_config.py +++ b/services/vpn/src/stackit/vpn/models/peering_config.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -37,6 +38,9 @@ def local_address_validate_regular_expression(cls, value): if value is None: return value + if not isinstance(value, str): + value = str(value) + if not re.match(r"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$", value): raise ValueError(r"must validate the regular expression /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/") return value @@ -47,12 +51,16 @@ def remote_address_validate_regular_expression(cls, value): if value is None: return value + if not isinstance(value, str): + value = str(value) + if not re.match(r"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$", value): raise ValueError(r"must validate the regular expression /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -63,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/phase.py b/services/vpn/src/stackit/vpn/models/phase.py index 3a74c5ba6..8e0c5b5c3 100644 --- a/services/vpn/src/stackit/vpn/models/phase.py +++ b/services/vpn/src/stackit/vpn/models/phase.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -65,7 +66,8 @@ def integrity_algorithms_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -76,8 +78,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/phase1_status.py b/services/vpn/src/stackit/vpn/models/phase1_status.py index ff75e6a95..4019bf720 100644 --- a/services/vpn/src/stackit/vpn/models/phase1_status.py +++ b/services/vpn/src/stackit/vpn/models/phase1_status.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -41,7 +42,8 @@ class Phase1Status(BaseModel): __properties: ClassVar[List[str]] = ["dhGroup", "encryptionAlgorithm", "integrityAlgorithm", "state"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -52,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/phase2_status.py b/services/vpn/src/stackit/vpn/models/phase2_status.py index 750590746..95d7416c4 100644 --- a/services/vpn/src/stackit/vpn/models/phase2_status.py +++ b/services/vpn/src/stackit/vpn/models/phase2_status.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -79,7 +80,8 @@ class Phase2Status(BaseModel): ] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -90,8 +92,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/plan.py b/services/vpn/src/stackit/vpn/models/plan.py index f53285358..9d0237a30 100644 --- a/services/vpn/src/stackit/vpn/models/plan.py +++ b/services/vpn/src/stackit/vpn/models/plan.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -42,7 +43,8 @@ class Plan(BaseModel): __properties: ClassVar[List[str]] = ["maxBandwidth", "maxConnections", "name", "planId", "sku"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -53,8 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/plan_list.py b/services/vpn/src/stackit/vpn/models/plan_list.py index 67f23f32f..8de9dfc77 100644 --- a/services/vpn/src/stackit/vpn/models/plan_list.py +++ b/services/vpn/src/stackit/vpn/models/plan_list.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.plan import Plan @@ -35,7 +36,8 @@ class PlanList(BaseModel): __properties: ClassVar[List[str]] = ["defaultPlanId", "plans"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/quota.py b/services/vpn/src/stackit/vpn/models/quota.py index cfe67dd19..6960b26b6 100644 --- a/services/vpn/src/stackit/vpn/models/quota.py +++ b/services/vpn/src/stackit/vpn/models/quota.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -31,7 +32,8 @@ class Quota(BaseModel): __properties: ClassVar[List[str]] = ["limit", "usage"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/quota_list.py b/services/vpn/src/stackit/vpn/models/quota_list.py index 9527ccbe2..5de29b106 100644 --- a/services/vpn/src/stackit/vpn/models/quota_list.py +++ b/services/vpn/src/stackit/vpn/models/quota_list.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.quota import Quota @@ -32,7 +33,8 @@ class QuotaList(BaseModel): __properties: ClassVar[List[str]] = ["gateways"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/quota_list_response.py b/services/vpn/src/stackit/vpn/models/quota_list_response.py index c3b4d6f11..3b6231f9c 100644 --- a/services/vpn/src/stackit/vpn/models/quota_list_response.py +++ b/services/vpn/src/stackit/vpn/models/quota_list_response.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.quota_list import QuotaList @@ -32,7 +33,8 @@ class QuotaListResponse(BaseModel): __properties: ClassVar[List[str]] = ["quotas"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/region.py b/services/vpn/src/stackit/vpn/models/region.py index aac90cdf4..91f24909e 100644 --- a/services/vpn/src/stackit/vpn/models/region.py +++ b/services/vpn/src/stackit/vpn/models/region.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/vpn/src/stackit/vpn/models/routing_type.py b/services/vpn/src/stackit/vpn/models/routing_type.py index 9ea70dbd2..1a1a1d50a 100644 --- a/services/vpn/src/stackit/vpn/models/routing_type.py +++ b/services/vpn/src/stackit/vpn/models/routing_type.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/vpn/src/stackit/vpn/models/tunnel_configuration.py b/services/vpn/src/stackit/vpn/models/tunnel_configuration.py index 1209d700d..c50aafdfb 100644 --- a/services/vpn/src/stackit/vpn/models/tunnel_configuration.py +++ b/services/vpn/src/stackit/vpn/models/tunnel_configuration.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.bgp_tunnel_config import BGPTunnelConfig @@ -47,12 +48,16 @@ class TunnelConfiguration(BaseModel): @field_validator("remote_address") def remote_address_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$", value): raise ValueError(r"must validate the regular expression /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -63,8 +68,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase1.py b/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase1.py index 882089d99..74c6fa47c 100644 --- a/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase1.py +++ b/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase1.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -68,7 +69,8 @@ def integrity_algorithms_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -79,8 +81,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase2.py b/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase2.py index 10fb60137..b5fa50787 100644 --- a/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase2.py +++ b/services/vpn/src/stackit/vpn/models/tunnel_configuration_phase2.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -105,7 +106,8 @@ def start_action_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -116,8 +118,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/tunnel_status.py b/services/vpn/src/stackit/vpn/models/tunnel_status.py index 7441d8da8..ea7a3c4d6 100644 --- a/services/vpn/src/stackit/vpn/models/tunnel_status.py +++ b/services/vpn/src/stackit/vpn/models/tunnel_status.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.phase1_status import Phase1Status @@ -46,7 +47,8 @@ def name_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -57,8 +59,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/update_gateway_connection_payload.py b/services/vpn/src/stackit/vpn/models/update_gateway_connection_payload.py index ae16885a7..469c9220a 100644 --- a/services/vpn/src/stackit/vpn/models/update_gateway_connection_payload.py +++ b/services/vpn/src/stackit/vpn/models/update_gateway_connection_payload.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,6 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.tunnel_configuration import TunnelConfiguration @@ -67,12 +68,16 @@ class UpdateGatewayConnectionPayload(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -83,8 +88,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/models/update_vpn_gateway_payload.py b/services/vpn/src/stackit/vpn/models/update_gateway_payload.py similarity index 84% rename from services/vpn/src/stackit/vpn/models/update_vpn_gateway_payload.py rename to services/vpn/src/stackit/vpn/models/update_gateway_payload.py index 25a1420a0..cc47a7a03 100644 --- a/services/vpn/src/stackit/vpn/models/update_vpn_gateway_payload.py +++ b/services/vpn/src/stackit/vpn/models/update_gateway_payload.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -19,21 +19,22 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig -from stackit.vpn.models.create_vpn_gateway_payload_availability_zones import ( - CreateVPNGatewayPayloadAvailabilityZones, +from stackit.vpn.models.create_gateway_payload_availability_zones import ( + CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.routing_type import RoutingType -class UpdateVPNGatewayPayload(BaseModel): +class UpdateGatewayPayload(BaseModel): """ - UpdateVPNGatewayPayload + UpdateGatewayPayload """ # noqa: E501 - availability_zones: CreateVPNGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") + availability_zones: CreateGatewayPayloadAvailabilityZones = Field(alias="availabilityZones") bgp: Optional[BGPGatewayConfig] = None display_name: Annotated[str, Field(strict=True)] = Field( description="A user-friendly name for the VPN gateway.", alias="displayName" @@ -49,12 +50,16 @@ class UpdateVPNGatewayPayload(BaseModel): @field_validator("display_name") def display_name_validate_regular_expression(cls, value): """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -65,12 +70,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateVPNGatewayPayload from a JSON string""" + """Create an instance of UpdateGatewayPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -100,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateVPNGatewayPayload from a dict""" + """Create an instance of UpdateGatewayPayload from a dict""" if obj is None: return None @@ -110,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZones": ( - CreateVPNGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) + CreateGatewayPayloadAvailabilityZones.from_dict(obj["availabilityZones"]) if obj.get("availabilityZones") is not None else None ), diff --git a/services/vpn/src/stackit/vpn/models/vpn_tunnels.py b/services/vpn/src/stackit/vpn/models/vpn_tunnels.py index 6b49121d5..4a20c0957 100644 --- a/services/vpn/src/stackit/vpn/models/vpn_tunnels.py +++ b/services/vpn/src/stackit/vpn/models/vpn_tunnels.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -18,6 +18,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python from typing_extensions import Self from stackit.vpn.models.bgp_status import BGPStatus @@ -48,7 +49,8 @@ def name_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -59,8 +61,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/services/vpn/src/stackit/vpn/rest.py b/services/vpn/src/stackit/vpn/rest.py index 0900cf371..d6a71d097 100644 --- a/services/vpn/src/stackit/vpn/rest.py +++ b/services/vpn/src/stackit/vpn/rest.py @@ -5,7 +5,7 @@ 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 - The version of the OpenAPI document: 1beta1 + The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.