From 9ca4bec739cf6c274140044053d73758ed7d7c62 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 15 Jul 2026 14:52:13 +0000 Subject: [PATCH] Generate vpn --- services/vpn/oas_commit | 2 +- services/vpn/src/stackit/vpn/__init__.py | 34 + .../vpn/src/stackit/vpn/api/default_api.py | 3707 +++++++++++++++-- services/vpn/src/stackit/vpn/exceptions.py | 8 +- .../vpn/src/stackit/vpn/models/__init__.py | 19 + .../stackit/vpn/models/api_error_detail.py | 10 +- .../vpn/src/stackit/vpn/models/bgp_filter.py | 103 + .../src/stackit/vpn/models/bgp_filter_list.py | 99 + .../src/stackit/vpn/models/bgp_filter_rule.py | 119 + .../vpn/models/bgp_filter_rule_list.py | 97 + .../vpn/models/bgp_filter_rule_match.py | 147 + .../stackit/vpn/models/bgp_filter_rule_set.py | 86 + .../stackit/vpn/models/bgp_tunnel_config.py | 15 +- .../create_gateway_bgp_filter_payload.py | 103 + .../create_gateway_bgp_filter_rule_payload.py | 119 + .../vpn/models/create_gateway_payload.py | 18 +- .../vpn/src/stackit/vpn/models/gateway.py | 18 +- .../stackit/vpn/models/gateway_response.py | 9 + .../src/stackit/vpn/models/network_config.py | 92 + .../update_gateway_bgp_filter_payload.py | 103 + .../update_gateway_bgp_filter_rule_payload.py | 119 + .../vpn/models/update_gateway_payload.py | 18 +- 22 files changed, 4676 insertions(+), 369 deletions(-) create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter.py create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter_list.py create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter_rule.py create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter_rule_list.py create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter_rule_match.py create mode 100644 services/vpn/src/stackit/vpn/models/bgp_filter_rule_set.py create mode 100644 services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_payload.py create mode 100644 services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_rule_payload.py create mode 100644 services/vpn/src/stackit/vpn/models/network_config.py create mode 100644 services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_payload.py create mode 100644 services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_rule_payload.py diff --git a/services/vpn/oas_commit b/services/vpn/oas_commit index ffaaf3db1..9d092cee5 100644 --- a/services/vpn/oas_commit +++ b/services/vpn/oas_commit @@ -1 +1 @@ -18e00f0b26b2cd1f3403bbf0c2e64e7fe333b4d1 +6e07a1c9aa4071d66de3185f756617a6a971ab95 diff --git a/services/vpn/src/stackit/vpn/__init__.py b/services/vpn/src/stackit/vpn/__init__.py index 1a781c62b..db1d965e7 100644 --- a/services/vpn/src/stackit/vpn/__init__.py +++ b/services/vpn/src/stackit/vpn/__init__.py @@ -31,6 +31,12 @@ "APIError", "APIErrorDetail", "APIErrorResponse", + "BGPFilter", + "BGPFilterList", + "BGPFilterRule", + "BGPFilterRuleList", + "BGPFilterRuleMatch", + "BGPFilterRuleSet", "BGPGatewayConfig", "BGPStatus", "BGPStatusPeers", @@ -39,6 +45,8 @@ "ConnectionList", "ConnectionResponse", "ConnectionStatusResponse", + "CreateGatewayBGPFilterPayload", + "CreateGatewayBGPFilterRulePayload", "CreateGatewayConnectionPayload", "CreateGatewayPayload", "CreateGatewayPayloadAvailabilityZones", @@ -47,6 +55,7 @@ "GatewayResponse", "GatewayStatus", "GatewayStatusResponse", + "NetworkConfig", "PeeringConfig", "Phase", "Phase1Status", @@ -62,6 +71,8 @@ "TunnelConfigurationPhase1", "TunnelConfigurationPhase2", "TunnelStatus", + "UpdateGatewayBGPFilterPayload", + "UpdateGatewayBGPFilterRulePayload", "UpdateGatewayConnectionPayload", "UpdateGatewayPayload", "VPNTunnels", @@ -85,6 +96,16 @@ from stackit.vpn.models.api_error import APIError as APIError from stackit.vpn.models.api_error_detail import APIErrorDetail as APIErrorDetail from stackit.vpn.models.api_error_response import APIErrorResponse as APIErrorResponse +from stackit.vpn.models.bgp_filter import BGPFilter as BGPFilter +from stackit.vpn.models.bgp_filter_list import BGPFilterList as BGPFilterList +from stackit.vpn.models.bgp_filter_rule import BGPFilterRule as BGPFilterRule +from stackit.vpn.models.bgp_filter_rule_list import ( + BGPFilterRuleList as BGPFilterRuleList, +) +from stackit.vpn.models.bgp_filter_rule_match import ( + BGPFilterRuleMatch as BGPFilterRuleMatch, +) +from stackit.vpn.models.bgp_filter_rule_set import BGPFilterRuleSet as BGPFilterRuleSet from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig as BGPGatewayConfig from stackit.vpn.models.bgp_status import BGPStatus as BGPStatus from stackit.vpn.models.bgp_status_peers import BGPStatusPeers as BGPStatusPeers @@ -97,6 +118,12 @@ from stackit.vpn.models.connection_status_response import ( ConnectionStatusResponse as ConnectionStatusResponse, ) +from stackit.vpn.models.create_gateway_bgp_filter_payload import ( + CreateGatewayBGPFilterPayload as CreateGatewayBGPFilterPayload, +) +from stackit.vpn.models.create_gateway_bgp_filter_rule_payload import ( + CreateGatewayBGPFilterRulePayload as CreateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload as CreateGatewayConnectionPayload, ) @@ -113,6 +140,7 @@ from stackit.vpn.models.gateway_status_response import ( GatewayStatusResponse as GatewayStatusResponse, ) +from stackit.vpn.models.network_config import NetworkConfig as NetworkConfig from stackit.vpn.models.peering_config import PeeringConfig as PeeringConfig from stackit.vpn.models.phase import Phase as Phase from stackit.vpn.models.phase1_status import Phase1Status as Phase1Status @@ -136,6 +164,12 @@ TunnelConfigurationPhase2 as TunnelConfigurationPhase2, ) from stackit.vpn.models.tunnel_status import TunnelStatus as TunnelStatus +from stackit.vpn.models.update_gateway_bgp_filter_payload import ( + UpdateGatewayBGPFilterPayload as UpdateGatewayBGPFilterPayload, +) +from stackit.vpn.models.update_gateway_bgp_filter_rule_payload import ( + UpdateGatewayBGPFilterRulePayload as UpdateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload as UpdateGatewayConnectionPayload, ) diff --git a/services/vpn/src/stackit/vpn/api/default_api.py b/services/vpn/src/stackit/vpn/api/default_api.py index c47f17b51..c5f8668a2 100644 --- a/services/vpn/src/stackit/vpn/api/default_api.py +++ b/services/vpn/src/stackit/vpn/api/default_api.py @@ -20,9 +20,19 @@ from stackit.vpn.api_client import ApiClient, RequestSerialized from stackit.vpn.api_response import ApiResponse +from stackit.vpn.models.bgp_filter import BGPFilter +from stackit.vpn.models.bgp_filter_list import BGPFilterList +from stackit.vpn.models.bgp_filter_rule import BGPFilterRule +from stackit.vpn.models.bgp_filter_rule_list import BGPFilterRuleList from stackit.vpn.models.connection_list import ConnectionList from stackit.vpn.models.connection_response import ConnectionResponse from stackit.vpn.models.connection_status_response import ConnectionStatusResponse +from stackit.vpn.models.create_gateway_bgp_filter_payload import ( + CreateGatewayBGPFilterPayload, +) +from stackit.vpn.models.create_gateway_bgp_filter_rule_payload import ( + CreateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload, ) @@ -33,6 +43,12 @@ from stackit.vpn.models.plan_list import PlanList from stackit.vpn.models.quota_list_response import QuotaListResponse from stackit.vpn.models.region import Region +from stackit.vpn.models.update_gateway_bgp_filter_payload import ( + UpdateGatewayBGPFilterPayload, +) +from stackit.vpn.models.update_gateway_bgp_filter_rule_payload import ( + UpdateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload, ) @@ -333,12 +349,12 @@ def _create_gateway_serialize( ) @validate_call - def create_gateway_connection( + def create_gateway_bgp_filter( self, project_id: StrictStr, region: Region, gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -348,10 +364,10 @@ 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. + ) -> BGPFilter: + """Create a new empty BGP filter. - Create a new connection on an existing VPN gateway. + Creates the filter metadata. Rules are managed via the nested /rules sub-resource. NOTE: an empty filter attached to a tunnel denies all incoming routes (implicit DENY). :param project_id: (required) :type project_id: str @@ -359,8 +375,8 @@ def create_gateway_connection( :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_bgp_filter_payload: (required) + :type create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload :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 @@ -383,11 +399,11 @@ def create_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_bgp_filter_payload=create_gateway_bgp_filter_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -395,11 +411,13 @@ def create_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -410,12 +428,12 @@ def create_gateway_connection( ).data @validate_call - def create_gateway_connection_with_http_info( + def create_gateway_bgp_filter_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -425,10 +443,10 @@ 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[BGPFilter]: + """Create a new empty BGP filter. - Create a new connection on an existing VPN gateway. + Creates the filter metadata. Rules are managed via the nested /rules sub-resource. NOTE: an empty filter attached to a tunnel denies all incoming routes (implicit DENY). :param project_id: (required) :type project_id: str @@ -436,8 +454,8 @@ def create_gateway_connection_with_http_info( :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_bgp_filter_payload: (required) + :type create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload :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 @@ -460,11 +478,11 @@ def create_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_bgp_filter_payload=create_gateway_bgp_filter_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -472,11 +490,13 @@ def create_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -487,12 +507,12 @@ def create_gateway_connection_with_http_info( ) @validate_call - def create_gateway_connection_without_preload_content( + def create_gateway_bgp_filter_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, + create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -503,9 +523,9 @@ 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 new empty BGP filter. - Create a new connection on an existing VPN gateway. + Creates the filter metadata. Rules are managed via the nested /rules sub-resource. NOTE: an empty filter attached to a tunnel denies all incoming routes (implicit DENY). :param project_id: (required) :type project_id: str @@ -513,8 +533,8 @@ def create_gateway_connection_without_preload_content( :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_bgp_filter_payload: (required) + :type create_gateway_bgp_filter_payload: CreateGatewayBGPFilterPayload :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 @@ -537,11 +557,11 @@ def create_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_gateway_connection_serialize( + _param = self._create_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - create_gateway_connection_payload=create_gateway_connection_payload, + create_gateway_bgp_filter_payload=create_gateway_bgp_filter_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -549,22 +569,24 @@ def create_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "201": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "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_bgp_filter_serialize( self, project_id, region, gateway_id, - create_gateway_connection_payload, + create_gateway_bgp_filter_payload, _request_auth, _content_type, _headers, @@ -593,8 +615,8 @@ def _create_gateway_connection_serialize( # 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_bgp_filter_payload is not None: + _body_params = create_gateway_bgp_filter_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -613,7 +635,7 @@ def _create_gateway_connection_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -627,11 +649,13 @@ def _create_gateway_connection_serialize( ) @validate_call - def delete_gateway( + def create_gateway_bgp_filter_rule( self, project_id: StrictStr, region: Region, gateway_id: UUID, + filter_id: UUID, + create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -641,10 +665,9 @@ def delete_gateway( _content_type: Optional[StrictStr] = None, _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. + ) -> BGPFilterRule: + """Add a new rule to a BGP filter. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -652,6 +675,10 @@ def delete_gateway( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param create_gateway_bgp_filter_rule_payload: (required) + :type create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload :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 @@ -674,10 +701,12 @@ def delete_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_serialize( + _param = self._create_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + filter_id=filter_id, + create_gateway_bgp_filter_rule_payload=create_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -685,10 +714,13 @@ def delete_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "201": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -699,11 +731,13 @@ def delete_gateway( ).data @validate_call - def delete_gateway_with_http_info( + def create_gateway_bgp_filter_rule_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, + filter_id: UUID, + create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -713,10 +747,9 @@ def delete_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[None]: - """Delete a existing VPN gateway in a project. + ) -> ApiResponse[BGPFilterRule]: + """Add a new rule to a BGP filter. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -724,6 +757,10 @@ def delete_gateway_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param create_gateway_bgp_filter_rule_payload: (required) + :type create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload :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 @@ -746,10 +783,12 @@ def delete_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_serialize( + _param = self._create_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + filter_id=filter_id, + create_gateway_bgp_filter_rule_payload=create_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -757,10 +796,13 @@ def delete_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "201": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -771,11 +813,13 @@ def delete_gateway_with_http_info( ) @validate_call - def delete_gateway_without_preload_content( + def create_gateway_bgp_filter_rule_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, + filter_id: UUID, + create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -786,9 +830,8 @@ def delete_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. + """Add a new rule to a BGP filter. - Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -796,6 +839,10 @@ def delete_gateway_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param create_gateway_bgp_filter_rule_payload: (required) + :type create_gateway_bgp_filter_rule_payload: CreateGatewayBGPFilterRulePayload :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 @@ -818,10 +865,12 @@ def delete_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_serialize( + _param = self._create_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, + filter_id=filter_id, + create_gateway_bgp_filter_rule_payload=create_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -829,20 +878,25 @@ def delete_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "201": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_gateway_serialize( + def _create_gateway_bgp_filter_rule_serialize( self, project_id, region, gateway_id, + filter_id, + create_gateway_bgp_filter_rule_payload, _request_auth, _content_type, _headers, @@ -867,21 +921,33 @@ def _delete_gateway_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id + if filter_id is not None: + _path_params["filterId"] = filter_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_gateway_bgp_filter_rule_payload is not None: + _body_params = create_gateway_bgp_filter_rule_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + method="POST", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}/rules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -895,12 +961,12 @@ def _delete_gateway_serialize( ) @validate_call - def delete_gateway_connection( + def create_gateway_connection( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -910,10 +976,10 @@ def delete_gateway_connection( _content_type: Optional[StrictStr] = None, _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. + ) -> ConnectionResponse: + """Create a new connection on an existing VPN gateway. - Delete a certain connection from an existing VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -921,8 +987,8 @@ def delete_gateway_connection( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str + :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 @@ -945,11 +1011,11 @@ def delete_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -957,7 +1023,7 @@ def delete_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -972,12 +1038,12 @@ def delete_gateway_connection( ).data @validate_call - def delete_gateway_connection_with_http_info( + def create_gateway_connection_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -987,10 +1053,10 @@ def delete_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[None]: - """Delete a certain connection from an existing VPN gateway. + ) -> ApiResponse[ConnectionResponse]: + """Create a new connection on an existing VPN gateway. - Delete a certain connection from an existing VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -998,8 +1064,8 @@ 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 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 @@ -1022,11 +1088,11 @@ def delete_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1034,7 +1100,7 @@ def delete_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1049,12 +1115,12 @@ def delete_gateway_connection_with_http_info( ) @validate_call - def delete_gateway_connection_without_preload_content( + def create_gateway_connection_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1065,9 +1131,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. + """Create a new connection on an existing VPN gateway. - Delete a certain connection from an existing VPN gateway. + Create a new connection on an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -1075,8 +1141,8 @@ 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 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 @@ -1099,11 +1165,11 @@ def delete_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_gateway_connection_serialize( + _param = self._create_gateway_connection_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + create_gateway_connection_payload=create_gateway_connection_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1111,7 +1177,7 @@ def delete_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "200": "ConnectionResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -1121,12 +1187,12 @@ def delete_gateway_connection_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_gateway_connection_serialize( + def _create_gateway_connection_serialize( self, project_id, region, gateway_id, - connection_id, + create_gateway_connection_payload, _request_auth, _content_type, _headers, @@ -1151,23 +1217,31 @@ 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 # process the body parameter + 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: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + method="POST", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1181,7 +1255,7 @@ def _delete_gateway_connection_serialize( ) @validate_call - def get_gateway( + def delete_gateway( self, project_id: StrictStr, region: Region, @@ -1195,10 +1269,10 @@ def get_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. + ) -> None: + """Delete a existing VPN gateway in a project. - Get details of a VPN Gateway in a project. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -1228,7 +1302,7 @@ def get_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1239,11 +1313,10 @@ def get_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1254,7 +1327,7 @@ def get_gateway( ).data @validate_call - def get_gateway_with_http_info( + def delete_gateway_with_http_info( self, project_id: StrictStr, region: Region, @@ -1268,10 +1341,10 @@ def get_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[None]: + """Delete a existing VPN gateway in a project. - Get details of a VPN Gateway in a project. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -1301,7 +1374,7 @@ def get_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1312,11 +1385,10 @@ def get_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", - "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1327,7 +1399,7 @@ def get_gateway_with_http_info( ) @validate_call - def get_gateway_without_preload_content( + def delete_gateway_without_preload_content( self, project_id: StrictStr, region: Region, @@ -1342,9 +1414,9 @@ def get_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. + """Delete a existing VPN gateway in a project. - Get details of a VPN Gateway in a project. + Permanently remove a VPN gateway and all its associated connections. This operation is irreversible. :param project_id: (required) :type project_id: str @@ -1374,7 +1446,7 @@ def get_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_serialize( + _param = self._delete_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, @@ -1385,17 +1457,16 @@ def get_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": None, "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 _get_gateway_serialize( + def _delete_gateway_serialize( self, project_id, region, @@ -1437,7 +1508,7 @@ def _get_gateway_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", path_params=_path_params, query_params=_query_params, @@ -1452,12 +1523,12 @@ def _get_gateway_serialize( ) @validate_call - def get_gateway_connection( + def delete_gateway_bgp_filter( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1467,10 +1538,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. + ) -> None: + """Delete a BGP filter. - Get a certain connection for an existing VPN gateway. + Fails with 409 Conflict if the filter is referenced by any connection's tunnel.bgp.inboundFilterId. The error response body's details[] contains one entry per referencing connection with metadata { connectionId, displayName, tunnel: 'tunnel1'|'tunnel2' } and reason RESOURCE_IN_USE so the caller can detach them first. :param project_id: (required) :type project_id: str @@ -1478,8 +1549,8 @@ def get_gateway_connection( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str + :param filter_id: (required) + :type filter_id: UUID :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 @@ -1502,11 +1573,11 @@ def get_gateway_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._delete_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1514,11 +1585,13 @@ def get_gateway_connection( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1529,12 +1602,12 @@ def get_gateway_connection( ).data @validate_call - def get_gateway_connection_with_http_info( + def delete_gateway_bgp_filter_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1544,10 +1617,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[None]: + """Delete a BGP filter. - Get a certain connection for an existing VPN gateway. + Fails with 409 Conflict if the filter is referenced by any connection's tunnel.bgp.inboundFilterId. The error response body's details[] contains one entry per referencing connection with metadata { connectionId, displayName, tunnel: 'tunnel1'|'tunnel2' } and reason RESOURCE_IN_USE so the caller can detach them first. :param project_id: (required) :type project_id: str @@ -1555,8 +1628,8 @@ 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 filter_id: (required) + :type filter_id: UUID :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 @@ -1579,11 +1652,11 @@ def get_gateway_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._delete_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1591,11 +1664,13 @@ def get_gateway_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1606,12 +1681,12 @@ def get_gateway_connection_with_http_info( ) @validate_call - def get_gateway_connection_without_preload_content( + def delete_gateway_bgp_filter_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1622,9 +1697,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. + """Delete a BGP filter. - Get a certain connection for an existing VPN gateway. + Fails with 409 Conflict if the filter is referenced by any connection's tunnel.bgp.inboundFilterId. The error response body's details[] contains one entry per referencing connection with metadata { connectionId, displayName, tunnel: 'tunnel1'|'tunnel2' } and reason RESOURCE_IN_USE so the caller can detach them first. :param project_id: (required) :type project_id: str @@ -1632,8 +1707,8 @@ 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 filter_id: (required) + :type filter_id: UUID :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 @@ -1656,11 +1731,11 @@ def get_gateway_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_serialize( + _param = self._delete_gateway_bgp_filter_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1668,22 +1743,24 @@ def get_gateway_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_gateway_connection_serialize( + def _delete_gateway_bgp_filter_serialize( self, project_id, region, gateway_id, - connection_id, + filter_id, _request_auth, _content_type, _headers, @@ -1708,8 +1785,8 @@ 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 + if filter_id is not None: + _path_params["filterId"] = filter_id # process the query parameters # process the header parameters # process the form parameters @@ -1723,8 +1800,8 @@ def _get_gateway_connection_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1738,12 +1815,13 @@ def _get_gateway_connection_serialize( ) @validate_call - def get_gateway_connection_status( + def delete_gateway_bgp_filter_rule( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1753,10 +1831,9 @@ 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. + ) -> None: + """Delete a specific rule. - Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1764,8 +1841,10 @@ def get_gateway_connection_status( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -1788,11 +1867,12 @@ def get_gateway_connection_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._delete_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1800,11 +1880,12 @@ def get_gateway_connection_status( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1815,12 +1896,13 @@ def get_gateway_connection_status( ).data @validate_call - def get_gateway_connection_status_with_http_info( + def delete_gateway_bgp_filter_rule_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1830,10 +1912,9 @@ 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[None]: + """Delete a specific rule. - Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1841,8 +1922,10 @@ def get_gateway_connection_status_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -1865,11 +1948,12 @@ def get_gateway_connection_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._delete_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1877,11 +1961,12 @@ def get_gateway_connection_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1892,12 +1977,13 @@ def get_gateway_connection_status_with_http_info( ) @validate_call - def get_gateway_connection_status_without_preload_content( + def delete_gateway_bgp_filter_rule_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - connection_id: StrictStr, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1908,9 +1994,8 @@ 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. + """Delete a specific rule. - Get the status for a specific connection. :param project_id: (required) :type project_id: str @@ -1918,8 +2003,10 @@ def get_gateway_connection_status_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param connection_id: (required) - :type connection_id: str + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -1942,11 +2029,12 @@ def get_gateway_connection_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_connection_status_serialize( + _param = self._delete_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - connection_id=connection_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1954,22 +2042,24 @@ def get_gateway_connection_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionStatusResponse", + "204": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", "404": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_gateway_connection_status_serialize( + def _delete_gateway_bgp_filter_rule_serialize( self, project_id, region, gateway_id, - connection_id, + filter_id, + rule_id, _request_auth, _content_type, _headers, @@ -1994,8 +2084,10 @@ def _get_gateway_connection_status_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 + if filter_id is not None: + _path_params["filterId"] = filter_id + if rule_id is not None: + _path_params["ruleId"] = rule_id # process the query parameters # process the header parameters # process the form parameters @@ -2009,8 +2101,8 @@ def _get_gateway_connection_status_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status", + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}/rules/{ruleId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2024,11 +2116,12 @@ def _get_gateway_connection_status_serialize( ) @validate_call - def get_gateway_status( + 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)], @@ -2038,10 +2131,10 @@ def get_gateway_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GatewayStatusResponse: - """Get the status of a VPN gateway in a project. + ) -> None: + """Delete a certain connection from an existing VPN gateway. - Get the status of a VPN gateway in a project. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -2049,6 +2142,8 @@ def get_gateway_status( :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 @@ -2071,10 +2166,11 @@ def get_gateway_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_status_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, @@ -2082,7 +2178,7 @@ def get_gateway_status( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayStatusResponse", + "200": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2097,11 +2193,12 @@ def get_gateway_status( ).data @validate_call - def get_gateway_status_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)], @@ -2111,10 +2208,10 @@ def get_gateway_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[GatewayStatusResponse]: - """Get the status of a VPN gateway in a project. + ) -> ApiResponse[None]: + """Delete a certain connection from an existing VPN gateway. - Get the status of a VPN gateway in a project. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -2122,6 +2219,8 @@ def get_gateway_status_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 @@ -2144,10 +2243,11 @@ def get_gateway_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_status_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, @@ -2155,7 +2255,7 @@ def get_gateway_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayStatusResponse", + "200": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2170,11 +2270,12 @@ def get_gateway_status_with_http_info( ) @validate_call - def get_gateway_status_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)], @@ -2185,9 +2286,9 @@ def get_gateway_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the status of a VPN gateway in a project. + """Delete a certain connection from an existing VPN gateway. - Get the status of a VPN gateway in a project. + Delete a certain connection from an existing VPN gateway. :param project_id: (required) :type project_id: str @@ -2195,6 +2296,8 @@ def get_gateway_status_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 @@ -2217,10 +2320,11 @@ def get_gateway_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_gateway_status_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, @@ -2228,7 +2332,7 @@ def get_gateway_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayStatusResponse", + "200": None, "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2238,11 +2342,12 @@ def get_gateway_status_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_gateway_status_serialize( + def _delete_gateway_connection_serialize( self, project_id, region, gateway_id, + connection_id, _request_auth, _content_type, _headers, @@ -2267,6 +2372,8 @@ def _get_gateway_status_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 @@ -2280,8 +2387,8 @@ def _get_gateway_status_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status", + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2295,14 +2402,11 @@ def _get_gateway_status_serialize( ) @validate_call - def list_gateway_connections( + def get_gateway( self, project_id: StrictStr, region: Region, gateway_id: UUID, - 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)], @@ -2312,10 +2416,10 @@ def list_gateway_connections( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionList: - """List connections for an existing VPN gateway. + ) -> GatewayResponse: + """Get details of a VPN Gateway in a project. - List connections for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -2323,8 +2427,6 @@ def list_gateway_connections( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :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 @@ -2347,11 +2449,10 @@ def list_gateway_connections( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateway_connections_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2359,7 +2460,7 @@ def list_gateway_connections( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionList", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2374,14 +2475,11 @@ def list_gateway_connections( ).data @validate_call - def list_gateway_connections_with_http_info( + def get_gateway_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - 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)], @@ -2391,10 +2489,10 @@ def list_gateway_connections_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[ConnectionList]: - """List connections for an existing VPN gateway. + ) -> ApiResponse[GatewayResponse]: + """Get details of a VPN Gateway in a project. - List connections for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -2402,8 +2500,6 @@ def list_gateway_connections_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :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 @@ -2426,11 +2522,10 @@ def list_gateway_connections_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateway_connections_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2438,7 +2533,7 @@ def list_gateway_connections_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionList", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2453,14 +2548,11 @@ def list_gateway_connections_with_http_info( ) @validate_call - def list_gateway_connections_without_preload_content( + def get_gateway_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - 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)], @@ -2471,9 +2563,9 @@ def list_gateway_connections_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List connections for an existing VPN gateway. + """Get details of a VPN Gateway in a project. - List connections for an existing VPN gateway. + Get details of a VPN Gateway in a project. :param project_id: (required) :type project_id: str @@ -2481,8 +2573,6 @@ def list_gateway_connections_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :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 @@ -2505,11 +2595,10 @@ def list_gateway_connections_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateway_connections_serialize( + _param = self._get_gateway_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2517,7 +2606,7 @@ def list_gateway_connections_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ConnectionList", + "200": "GatewayResponse", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", @@ -2527,12 +2616,11 @@ def list_gateway_connections_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_gateway_connections_serialize( + def _get_gateway_serialize( self, project_id, region, gateway_id, - label_selector, _request_auth, _content_type, _headers, @@ -2558,10 +2646,6 @@ def _list_gateway_connections_serialize( if gateway_id is not None: _path_params["gatewayId"] = gateway_id # 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 @@ -2575,7 +2659,7 @@ def _list_gateway_connections_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2589,13 +2673,12 @@ def _list_gateway_connections_serialize( ) @validate_call - def list_gateways( + def get_gateway_bgp_filter( self, project_id: StrictStr, region: Region, - label_selector: Annotated[ - Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.") - ] = None, + gateway_id: UUID, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2605,17 +2688,18 @@ def list_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 + ) -> BGPFilter: + """Get BGP filter metadata. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID :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 @@ -2638,10 +2722,11 @@ def list_gateways( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateways_serialize( + _param = self._get_gateway_bgp_filter_serialize( project_id=project_id, region=region, - label_selector=label_selector, + gateway_id=gateway_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2649,10 +2734,11 @@ def list_gateways( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2663,13 +2749,12 @@ def list_gateways( ).data @validate_call - def list_gateways_with_http_info( + def get_gateway_bgp_filter_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, + gateway_id: UUID, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2679,17 +2764,18 @@ def list_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[BGPFilter]: + """Get BGP filter metadata. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID :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 @@ -2712,10 +2798,11 @@ def list_gateways_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateways_serialize( + _param = self._get_gateway_bgp_filter_serialize( project_id=project_id, region=region, - label_selector=label_selector, + gateway_id=gateway_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2723,10 +2810,11 @@ def list_gateways_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2737,13 +2825,12 @@ def list_gateways_with_http_info( ) @validate_call - def list_gateways_without_preload_content( + def get_gateway_bgp_filter_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, + gateway_id: UUID, + filter_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2754,16 +2841,17 @@ def list_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 + """Get BGP filter metadata. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID :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 @@ -2786,10 +2874,11 @@ def list_gateways_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_gateways_serialize( + _param = self._get_gateway_bgp_filter_serialize( project_id=project_id, region=region, - label_selector=label_selector, + gateway_id=gateway_id, + filter_id=filter_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2797,20 +2886,22 @@ def list_gateways_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayList", + "200": "BGPFilter", "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 _list_gateways_serialize( + def _get_gateway_bgp_filter_serialize( self, project_id, region, - label_selector, + gateway_id, + filter_id, _request_auth, _content_type, _headers, @@ -2833,11 +2924,11 @@ def _list_gateways_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 + if filter_id is not None: + _path_params["filterId"] = filter_id # 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 @@ -2851,7 +2942,7 @@ def _list_gateways_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2865,9 +2956,13 @@ def _list_gateways_serialize( ) @validate_call - def list_plans( + def get_gateway_bgp_filter_rule( self, + project_id: StrictStr, region: Region, + gateway_id: UUID, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2877,13 +2972,20 @@ 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. + ) -> BGPFilterRule: + """Get a specific rule from a BGP filter. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -2906,8 +3008,12 @@ def list_plans( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_gateway_bgp_filter_rule_serialize( + project_id=project_id, region=region, + gateway_id=gateway_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2915,9 +3021,12 @@ def list_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2927,9 +3036,13 @@ def list_plans( ).data @validate_call - def list_plans_with_http_info( + def get_gateway_bgp_filter_rule_with_http_info( self, + project_id: StrictStr, region: Region, + gateway_id: UUID, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2939,13 +3052,20 @@ 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[BGPFilterRule]: + """Get a specific rule from a BGP filter. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -2968,8 +3088,12 @@ def list_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_gateway_bgp_filter_rule_serialize( + project_id=project_id, region=region, + gateway_id=gateway_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2977,9 +3101,12 @@ def list_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2989,9 +3116,13 @@ def list_plans_with_http_info( ) @validate_call - def list_plans_without_preload_content( + def get_gateway_bgp_filter_rule_without_preload_content( self, + project_id: StrictStr, region: Region, + gateway_id: UUID, + filter_id: UUID, + rule_id: UUID, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3002,12 +3133,19 @@ 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. + """Get a specific rule from a BGP filter. - 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 gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID :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 @@ -3030,8 +3168,12 @@ def list_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_gateway_bgp_filter_rule_serialize( + project_id=project_id, region=region, + gateway_id=gateway_id, + filter_id=filter_id, + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3039,16 +3181,23 @@ def list_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlanList", + "200": "BGPFilterRule", "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 _list_plans_serialize( + def _get_gateway_bgp_filter_rule_serialize( self, + project_id, region, + gateway_id, + filter_id, + rule_id, _request_auth, _content_type, _headers, @@ -3067,8 +3216,16 @@ 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 + if gateway_id is not None: + _path_params["gatewayId"] = gateway_id + if filter_id is not None: + _path_params["filterId"] = filter_id + if rule_id is not None: + _path_params["ruleId"] = rule_id # process the query parameters # process the header parameters # process the form parameters @@ -3083,7 +3240,7 @@ def _list_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/regions/{region}/plans", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}/rules/{ruleId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3097,7 +3254,2203 @@ def _list_plans_serialize( ) @validate_call - def list_quotas( + def get_gateway_connection( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + connection_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + Get a certain connection for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + Get a certain connection for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _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 a certain connection for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionResponse", + "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 _get_gateway_connection_serialize( + self, + project_id, + region, + gateway_id, + connection_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + Get the status for a specific connection. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionStatusResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + Get the status for a specific connection. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionStatusResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _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 the status for a specific connection. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionStatusResponse", + "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 _get_gateway_connection_status_serialize( + self, + project_id, + region, + gateway_id, + connection_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_gateway_status( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GatewayStatusResponse: + """Get the status of a VPN gateway in a project. + + Get the status of a VPN gateway in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_gateway_status_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GatewayStatusResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_gateway_status_with_http_info( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GatewayStatusResponse]: + """Get the status of a VPN gateway in a project. + + Get the status of a VPN gateway in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_gateway_status_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GatewayStatusResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_gateway_status_without_preload_content( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the status of a VPN gateway in a project. + + Get the status of a VPN gateway in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_gateway_status_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GatewayStatusResponse", + "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 _get_gateway_status_serialize( + self, + project_id, + region, + gateway_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_gateway_bgp_filter_rules( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + filter_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BGPFilterRuleList: + """List all rules inside a specific BGP filter. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filter_rules_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + filter_id=filter_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterRuleList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_gateway_bgp_filter_rules_with_http_info( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + filter_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BGPFilterRuleList]: + """List all rules inside a specific BGP filter. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filter_rules_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + filter_id=filter_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterRuleList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_gateway_bgp_filter_rules_without_preload_content( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + filter_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all rules inside a specific BGP filter. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filter_rules_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + filter_id=filter_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterRuleList", + "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 _list_gateway_bgp_filter_rules_serialize( + self, + project_id, + region, + gateway_id, + filter_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + if gateway_id is not None: + _path_params["gatewayId"] = gateway_id + if filter_id is not None: + _path_params["filterId"] = filter_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}/rules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_gateway_bgp_filters( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BGPFilterList: + """List BGP filters for a gateway. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filters_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_gateway_bgp_filters_with_http_info( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BGPFilterList]: + """List BGP filters for a gateway. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filters_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_gateway_bgp_filters_without_preload_content( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List BGP filters for a gateway. + + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_bgp_filters_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilterList", + "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 _list_gateway_bgp_filters_serialize( + self, + project_id, + region, + gateway_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_gateway_connections( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectionList: + """List connections for an existing VPN gateway. + + List connections for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_connections_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_gateway_connections_with_http_info( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConnectionList]: + """List connections for an existing VPN gateway. + + List connections for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_connections_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_gateway_connections_without_preload_content( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List connections for an existing VPN gateway. + + List connections for an existing 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_gateway_connections_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ConnectionList", + "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 _list_gateway_connections_serialize( + self, + project_id, + region, + gateway_id, + label_selector, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + if gateway_id is not None: + _path_params["gatewayId"] = gateway_id + # 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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 + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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 + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _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 + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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_gateways_serialize( + self, + project_id, + region, + label_selector, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_plans( + self, + region: Region, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + 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 region: (required) + :type region: Region + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlanList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_plans_with_http_info( + self, + region: Region, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + 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 region: (required) + :type region: Region + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlanList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_plans_without_preload_content( + self, + region: Region, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List available service plans for a project. + + 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 region: (required) + :type region: Region + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlanList", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_plans_serialize( + self, + region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if region is not None: + _path_params["region"] = region.value + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/regions/{region}/plans", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_quotas( self, project_id: StrictStr, region: Region, @@ -3113,12 +5466,419 @@ def list_quotas( ) -> QuotaListResponse: """List project quotas. - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + 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 _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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_quotas_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_quotas_with_http_info( + self, + project_id: StrictStr, + region: Region, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + 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 _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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_quotas_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_quotas_without_preload_content( + self, + project_id: StrictStr, + region: Region, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List project quotas. + + 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 _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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_quotas_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_quotas_serialize( + self, + project_id, + region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/quotas", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_gateway( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + update_gateway_payload: UpdateGatewayPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + 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 + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_gateway_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + update_gateway_payload=update_gateway_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GatewayResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "409": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_gateway_with_http_info( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + update_gateway_payload: UpdateGatewayPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _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. + + 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 + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_gateway_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + update_gateway_payload=update_gateway_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GatewayResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "409": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_gateway_without_preload_content( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + update_gateway_payload: UpdateGatewayPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a VPN gateway in a project. + + 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 :param region: (required) :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :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 @@ -3141,9 +5901,11 @@ def list_quotas( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( + _param = self._update_gateway_serialize( project_id=project_id, region=region, + gateway_id=gateway_id, + update_gateway_payload=update_gateway_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3151,9 +5913,158 @@ def list_quotas( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "GatewayResponse", + "400": "APIErrorResponse", + "401": "APIErrorResponse", + "403": "APIErrorResponse", + "409": "APIErrorResponse", + "500": "APIErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_gateway_serialize( + self, + project_id, + region, + gateway_id, + update_gateway_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _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 + 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 update_gateway_payload is not None: + _body_params = update_gateway_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_gateway_bgp_filter( + self, + project_id: StrictStr, + region: Region, + gateway_id: UUID, + filter_id: UUID, + update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BGPFilter: + """Update BGP filter metadata (name, description). + + Rules are managed via the nested /rules sub-resource and are not modified by this endpoint. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param update_gateway_bgp_filter_payload: (required) + :type update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_gateway_bgp_filter_serialize( + project_id=project_id, + region=region, + gateway_id=gateway_id, + filter_id=filter_id, + update_gateway_bgp_filter_payload=update_gateway_bgp_filter_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3163,10 +6074,13 @@ def list_quotas( ).data @validate_call - def list_quotas_with_http_info( + def update_gateway_bgp_filter_with_http_info( self, project_id: StrictStr, region: Region, + gateway_id: UUID, + filter_id: UUID, + update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3176,15 +6090,21 @@ 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[BGPFilter]: + """Update BGP filter metadata (name, description). - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + Rules are managed via the nested /rules sub-resource and are not modified by this endpoint. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param update_gateway_bgp_filter_payload: (required) + :type update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload :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 @@ -3207,9 +6127,12 @@ def list_quotas_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( + _param = self._update_gateway_bgp_filter_serialize( project_id=project_id, region=region, + gateway_id=gateway_id, + filter_id=filter_id, + update_gateway_bgp_filter_payload=update_gateway_bgp_filter_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3217,9 +6140,14 @@ def list_quotas_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3229,10 +6157,13 @@ def list_quotas_with_http_info( ) @validate_call - def list_quotas_without_preload_content( + def update_gateway_bgp_filter_without_preload_content( self, project_id: StrictStr, region: Region, + gateway_id: UUID, + filter_id: UUID, + update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3243,14 +6174,20 @@ 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. + """Update BGP filter metadata (name, description). - Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region. + Rules are managed via the nested /rules sub-resource and are not modified by this endpoint. :param project_id: (required) :type project_id: str :param region: (required) :type region: Region + :param gateway_id: (required) + :type gateway_id: UUID + :param filter_id: (required) + :type filter_id: UUID + :param update_gateway_bgp_filter_payload: (required) + :type update_gateway_bgp_filter_payload: UpdateGatewayBGPFilterPayload :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 @@ -3273,9 +6210,12 @@ def list_quotas_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_quotas_serialize( + _param = self._update_gateway_bgp_filter_serialize( project_id=project_id, region=region, + gateway_id=gateway_id, + filter_id=filter_id, + update_gateway_bgp_filter_payload=update_gateway_bgp_filter_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3283,17 +6223,25 @@ def list_quotas_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "QuotaListResponse", + "200": "BGPFilter", "400": "APIErrorResponse", "401": "APIErrorResponse", + "403": "APIErrorResponse", + "404": "APIErrorResponse", + "409": "APIErrorResponse", + "429": "APIErrorResponse", + "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_quotas_serialize( + def _update_gateway_bgp_filter_serialize( self, project_id, region, + gateway_id, + filter_id, + update_gateway_bgp_filter_payload, _request_auth, _content_type, _headers, @@ -3316,21 +6264,35 @@ def _list_quotas_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 + if filter_id is not None: + _path_params["filterId"] = filter_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if update_gateway_bgp_filter_payload is not None: + _body_params = update_gateway_bgp_filter_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/quotas", + method="PUT", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3344,12 +6306,14 @@ def _list_quotas_serialize( ) @validate_call - def update_gateway( + def update_gateway_bgp_filter_rule( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_gateway_payload: UpdateGatewayPayload, + filter_id: UUID, + rule_id: UUID, + update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3359,10 +6323,9 @@ def update_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. + ) -> BGPFilterRule: + """Update a specific rule. - 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 @@ -3370,8 +6333,12 @@ def update_gateway( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_gateway_payload: (required) - :type update_gateway_payload: UpdateGatewayPayload + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID + :param update_gateway_bgp_filter_rule_payload: (required) + :type update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload :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 @@ -3394,11 +6361,13 @@ def update_gateway( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_serialize( + _param = self._update_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_gateway_payload=update_gateway_payload, + filter_id=filter_id, + rule_id=rule_id, + update_gateway_bgp_filter_rule_payload=update_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3406,11 +6375,13 @@ def update_gateway( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3421,12 +6392,14 @@ def update_gateway( ).data @validate_call - def update_gateway_with_http_info( + def update_gateway_bgp_filter_rule_with_http_info( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_gateway_payload: UpdateGatewayPayload, + filter_id: UUID, + rule_id: UUID, + update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3436,10 +6409,9 @@ def update_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[BGPFilterRule]: + """Update a specific rule. - 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 @@ -3447,8 +6419,12 @@ def update_gateway_with_http_info( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_gateway_payload: (required) - :type update_gateway_payload: UpdateGatewayPayload + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID + :param update_gateway_bgp_filter_rule_payload: (required) + :type update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload :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 @@ -3471,11 +6447,13 @@ def update_gateway_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_serialize( + _param = self._update_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_gateway_payload=update_gateway_payload, + filter_id=filter_id, + rule_id=rule_id, + update_gateway_bgp_filter_rule_payload=update_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3483,11 +6461,13 @@ def update_gateway_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3498,12 +6478,14 @@ def update_gateway_with_http_info( ) @validate_call - def update_gateway_without_preload_content( + def update_gateway_bgp_filter_rule_without_preload_content( self, project_id: StrictStr, region: Region, gateway_id: UUID, - update_gateway_payload: UpdateGatewayPayload, + filter_id: UUID, + rule_id: UUID, + update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3514,9 +6496,8 @@ def update_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 specific rule. - 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 @@ -3524,8 +6505,12 @@ def update_gateway_without_preload_content( :type region: Region :param gateway_id: (required) :type gateway_id: UUID - :param update_gateway_payload: (required) - :type update_gateway_payload: UpdateGatewayPayload + :param filter_id: (required) + :type filter_id: UUID + :param rule_id: (required) + :type rule_id: UUID + :param update_gateway_bgp_filter_rule_payload: (required) + :type update_gateway_bgp_filter_rule_payload: UpdateGatewayBGPFilterRulePayload :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 @@ -3548,11 +6533,13 @@ def update_gateway_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_gateway_serialize( + _param = self._update_gateway_bgp_filter_rule_serialize( project_id=project_id, region=region, gateway_id=gateway_id, - update_gateway_payload=update_gateway_payload, + filter_id=filter_id, + rule_id=rule_id, + update_gateway_bgp_filter_rule_payload=update_gateway_bgp_filter_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3560,22 +6547,26 @@ def update_gateway_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GatewayResponse", + "200": "BGPFilterRule", "400": "APIErrorResponse", "401": "APIErrorResponse", "403": "APIErrorResponse", + "404": "APIErrorResponse", "409": "APIErrorResponse", + "429": "APIErrorResponse", "500": "APIErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_gateway_serialize( + def _update_gateway_bgp_filter_rule_serialize( self, project_id, region, gateway_id, - update_gateway_payload, + filter_id, + rule_id, + update_gateway_bgp_filter_rule_payload, _request_auth, _content_type, _headers, @@ -3600,12 +6591,16 @@ def _update_gateway_serialize( _path_params["region"] = region.value if gateway_id is not None: _path_params["gatewayId"] = gateway_id + if filter_id is not None: + _path_params["filterId"] = filter_id + if rule_id is not None: + _path_params["ruleId"] = rule_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_gateway_payload is not None: - _body_params = update_gateway_payload + if update_gateway_bgp_filter_rule_payload is not None: + _body_params = update_gateway_bgp_filter_rule_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3624,7 +6619,7 @@ def _update_gateway_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}", + resource_path="/v1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/bgp-filters/{filterId}/rules/{ruleId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/vpn/src/stackit/vpn/exceptions.py b/services/vpn/src/stackit/vpn/exceptions.py index 843d3b588..fb21c4055 100644 --- a/services/vpn/src/stackit/vpn/exceptions.py +++ b/services/vpn/src/stackit/vpn/exceptions.py @@ -45,7 +45,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) + super(ApiTypeError, self).__init__(full_msg, path_to_item, valid_classes, key_type) class ApiValueError(OpenApiException, ValueError): @@ -63,7 +63,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) + super(ApiValueError, self).__init__(full_msg, path_to_item) class ApiAttributeError(OpenApiException, AttributeError): @@ -82,7 +82,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) + super(ApiAttributeError, self).__init__(full_msg, path_to_item) class ApiKeyError(OpenApiException, KeyError): @@ -99,7 +99,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) + super(ApiKeyError, self).__init__(full_msg, path_to_item) class ApiException(OpenApiException): diff --git a/services/vpn/src/stackit/vpn/models/__init__.py b/services/vpn/src/stackit/vpn/models/__init__.py index bbd226953..72257aac2 100644 --- a/services/vpn/src/stackit/vpn/models/__init__.py +++ b/services/vpn/src/stackit/vpn/models/__init__.py @@ -16,6 +16,12 @@ from stackit.vpn.models.api_error import APIError from stackit.vpn.models.api_error_detail import APIErrorDetail from stackit.vpn.models.api_error_response import APIErrorResponse +from stackit.vpn.models.bgp_filter import BGPFilter +from stackit.vpn.models.bgp_filter_list import BGPFilterList +from stackit.vpn.models.bgp_filter_rule import BGPFilterRule +from stackit.vpn.models.bgp_filter_rule_list import BGPFilterRuleList +from stackit.vpn.models.bgp_filter_rule_match import BGPFilterRuleMatch +from stackit.vpn.models.bgp_filter_rule_set import BGPFilterRuleSet from stackit.vpn.models.bgp_gateway_config import BGPGatewayConfig from stackit.vpn.models.bgp_status import BGPStatus from stackit.vpn.models.bgp_status_peers import BGPStatusPeers @@ -24,6 +30,12 @@ from stackit.vpn.models.connection_list import ConnectionList from stackit.vpn.models.connection_response import ConnectionResponse from stackit.vpn.models.connection_status_response import ConnectionStatusResponse +from stackit.vpn.models.create_gateway_bgp_filter_payload import ( + CreateGatewayBGPFilterPayload, +) +from stackit.vpn.models.create_gateway_bgp_filter_rule_payload import ( + CreateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.create_gateway_connection_payload import ( CreateGatewayConnectionPayload, ) @@ -36,6 +48,7 @@ from stackit.vpn.models.gateway_response import GatewayResponse from stackit.vpn.models.gateway_status import GatewayStatus from stackit.vpn.models.gateway_status_response import GatewayStatusResponse +from stackit.vpn.models.network_config import NetworkConfig from stackit.vpn.models.peering_config import PeeringConfig from stackit.vpn.models.phase import Phase from stackit.vpn.models.phase1_status import Phase1Status @@ -51,6 +64,12 @@ from stackit.vpn.models.tunnel_configuration_phase1 import TunnelConfigurationPhase1 from stackit.vpn.models.tunnel_configuration_phase2 import TunnelConfigurationPhase2 from stackit.vpn.models.tunnel_status import TunnelStatus +from stackit.vpn.models.update_gateway_bgp_filter_payload import ( + UpdateGatewayBGPFilterPayload, +) +from stackit.vpn.models.update_gateway_bgp_filter_rule_payload import ( + UpdateGatewayBGPFilterRulePayload, +) from stackit.vpn.models.update_gateway_connection_payload import ( UpdateGatewayConnectionPayload, ) 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 28806d27d..c72373794 100644 --- a/services/vpn/src/stackit/vpn/models/api_error_detail.py +++ b/services/vpn/src/stackit/vpn/models/api_error_detail.py @@ -32,14 +32,18 @@ class APIErrorDetail(BaseModel): default=None, description="Metadata contains more information. For bad requests this would be field information.", ) - reason: StrictStr = Field(description="The reason why the error occurs.") + reason: StrictStr = Field( + description="The reason why the error occurs. RESOURCE_IN_USE is returned when a referenced resource cannot be deleted; the 'metadata.references' field then lists the referencing resources (e.g. connection IDs and displayNames pointing at a BGPFilter on DELETE). " + ) __properties: ClassVar[List[str]] = ["domain", "metadata", "reason"] @field_validator("reason") def reason_validate_enum(cls, value): """Validates the enum""" - if value not in set(["INVALID_FIELD", "INVALID_PATH_PARAMETER"]): - raise ValueError("must be one of enum values ('INVALID_FIELD', 'INVALID_PATH_PARAMETER')") + if value not in set(["INVALID_FIELD", "INVALID_PATH_PARAMETER", "RESOURCE_IN_USE"]): + raise ValueError( + "must be one of enum values ('INVALID_FIELD', 'INVALID_PATH_PARAMETER', 'RESOURCE_IN_USE')" + ) return value model_config = ConfigDict( diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter.py b/services/vpn/src/stackit/vpn/models/bgp_filter.py new file mode 100644 index 000000000..8b1ef82cb --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class BGPFilter(BaseModel): + """ + A named BGP route filter. Internally a BGPFilter holds an ordered set of rules (managed via the nested /rules sub-resource); a route is evaluated against each rule in 'sequence' order and the first match decides the outcome. An implicit DENY is applied after the last rule, so a route that matches no PERMIT rule is dropped. Attaching an empty filter to a tunnel therefore denies every route. Resource limits: the maximum number of filters per gateway equals the gateway plan's maxConnections value; the maximum number of rules per filter is 10. + """ # noqa: E501 + + display_name: Annotated[str, Field(strict=True)] = Field( + description="A user-friendly name for the filter. Display only — not enforced unique across a gateway.", + alias="displayName", + ) + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the filter.") + __properties: ClassVar[List[str]] = ["displayName", "id"] + + @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( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"displayName": obj.get("displayName"), "id": obj.get("id")}) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter_list.py b/services/vpn/src/stackit/vpn/models/bgp_filter_list.py new file mode 100644 index 000000000..fd1e2e208 --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter_list.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +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.bgp_filter import BGPFilter + + +class BGPFilterList(BaseModel): + """ + Response wrapper for listing BGP filters. + """ # noqa: E501 + + bgp_filters: List[BGPFilter] = Field(alias="bgpFilters") + __properties: ClassVar[List[str]] = ["bgpFilters"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilterList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bgp_filters (list) + _items = [] + if self.bgp_filters: + for _item_bgp_filters in self.bgp_filters: + if _item_bgp_filters: + _items.append(_item_bgp_filters.to_dict()) + _dict["bgpFilters"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilterList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bgpFilters": ( + [BGPFilter.from_dict(_item) for _item in obj["bgpFilters"]] + if obj.get("bgpFilters") is not None + else None + ) + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter_rule.py b/services/vpn/src/stackit/vpn/models/bgp_filter_rule.py new file mode 100644 index 000000000..b22385396 --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter_rule.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +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_filter_rule_match import BGPFilterRuleMatch +from stackit.vpn.models.bgp_filter_rule_set import BGPFilterRuleSet + + +class BGPFilterRule(BaseModel): + """ + A single rule within a BGPFilter. All non-empty fields within the 'match' block are AND-combined. Rules within a filter are evaluated in 'sequence' order; the first matching rule decides the outcome (logical OR across rules). An implicit DENY follows the last rule. + """ # noqa: E501 + + action: StrictStr = Field(description="The action to take if the route matches all criteria. Case-sensitive.") + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the specific rule.") + match: Optional[BGPFilterRuleMatch] = None + sequence: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field( + default=None, + description="The evaluation order of the rule. Lower numbers are evaluated first. Must be unique within a filter. On POST, this field is optional: when omitted the server auto-assigns max(existing)+10 (the first rule starts at 10). On PUT this field is required — sending a partial update without 'sequence' returns 400. ", + ) + set: Optional[BGPFilterRuleSet] = None + __properties: ClassVar[List[str]] = ["action", "id", "match", "sequence", "set"] + + @field_validator("action") + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["PERMIT", "DENY"]): + raise ValueError("must be one of enum values ('PERMIT', 'DENY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilterRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of match + if self.match: + _dict["match"] = self.match.to_dict() + # override the default output from pydantic by calling `to_dict()` of set + if self.set: + _dict["set"] = self.set.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilterRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "action": obj.get("action"), + "id": obj.get("id"), + "match": BGPFilterRuleMatch.from_dict(obj["match"]) if obj.get("match") is not None else None, + "sequence": obj.get("sequence"), + "set": BGPFilterRuleSet.from_dict(obj["set"]) if obj.get("set") is not None else None, + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter_rule_list.py b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_list.py new file mode 100644 index 000000000..93fc9c2aa --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_list.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +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_filter_rule import BGPFilterRule + + +class BGPFilterRuleList(BaseModel): + """ + Response wrapper for listing rules within a BGP filter. + """ # noqa: E501 + + rules: List[BGPFilterRule] + __properties: ClassVar[List[str]] = ["rules"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilterRuleList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilterRuleList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "rules": ( + [BGPFilterRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None + ) + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter_rule_match.py b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_match.py new file mode 100644 index 000000000..1e9ee701b --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_match.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +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 + + +class BGPFilterRuleMatch(BaseModel): + """ + Optional matching criteria. If omitted entirely, the rule acts as match-all. All non-empty fields in this block must match (logical AND). + """ # noqa: E501 + + as_path_contains_any: Optional[ + Annotated[List[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]], Field(max_length=10)] + ] = Field( + default=None, + description="Matches if the AS-PATH contains any one of the listed ASNs (logical OR within the list). Treated as an unordered set; ordering is not preserved by the storage layer. When combined with firstASN, both conditions must hold (logical AND, consistent with the rest of the match block). If firstASN is also listed here, its presence as the first hop is sufficient to satisfy this list; no duplicate hop is required. ", + alias="asPathContainsAny", + ) + communities: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=20)]] = Field( + default=None, + description="Matches if the route carries any one of these BGP standard communities (logical OR within the list). Format is 'asn:value' per RFC 1997 (both halves must fit in a uint32, i.e. 0..4294967295). Extended, large and well-known communities are not supported. ", + ) + first_asn: Optional[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]] = Field( + default=None, + description="Matches if the first ASN (immediate neighbor) in the AS-PATH equals this ASN. Combines with asPathContainsAny using logical AND: when both are set, the first ASN must equal firstASN AND the path must additionally contain at least one ASN from asPathContainsAny. ", + alias="firstASN", + ) + max_prefix_length: Optional[Annotated[int, Field(le=32, strict=True, ge=0)]] = Field( + default=None, + description="Maximum subnet mask length for matched prefixes. May be set together with 'prefixes' (narrows matches to subnets at most this long) or alone (matches any IPv4 route with a mask length <= this value, equivalent to implicit 'prefixes: [0.0.0.0/0]'). ", + alias="maxPrefixLength", + ) + min_prefix_length: Optional[Annotated[int, Field(le=32, strict=True, ge=0)]] = Field( + default=None, + description="Minimum subnet mask length for matched prefixes. May be set together with 'prefixes' (narrows matches to subnets at least this long) or alone (matches any IPv4 route with a mask length >= this value, equivalent to implicit 'prefixes: [0.0.0.0/0]'). If both minPrefixLength and maxPrefixLength are set, minPrefixLength must be <= maxPrefixLength. ", + alias="minPrefixLength", + ) + peer: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="Matches the exact IPv4 address of the BGP neighbor that advertised the route. Useful when the same filter is attached to multiple tunnels with different neighbor IPs (allows per-peer rules in a shared filter). When a filter is attached to a single tunnel, this field is effectively a no-op because the route-map is already neighbor-scoped. ", + ) + prefixes: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=20)]] = Field( + default=None, + description="List of IPv4 networks to match. A route's prefix matches if it equals one of these (subject to minPrefixLength/maxPrefixLength refinement). If omitted, an implicit 0.0.0.0/0 base is used when minPrefixLength or maxPrefixLength is set; if all three are omitted, prefix matching is not performed at all. Each entry must parse as a valid IPv4 CIDR; the network portion is normalised (10.0.0.5/24 → 10.0.0.0/24). ", + ) + __properties: ClassVar[List[str]] = [ + "asPathContainsAny", + "communities", + "firstASN", + "maxPrefixLength", + "minPrefixLength", + "peer", + "prefixes", + ] + + @field_validator("peer") + def peer_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilterRuleMatch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilterRuleMatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "asPathContainsAny": obj.get("asPathContainsAny"), + "communities": obj.get("communities"), + "firstASN": obj.get("firstASN"), + "maxPrefixLength": obj.get("maxPrefixLength"), + "minPrefixLength": obj.get("minPrefixLength"), + "peer": obj.get("peer"), + "prefixes": obj.get("prefixes"), + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/bgp_filter_rule_set.py b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_set.py new file mode 100644 index 000000000..9e1426c0b --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/bgp_filter_rule_set.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +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 + + +class BGPFilterRuleSet(BaseModel): + """ + Optional BGP attributes to apply when 'action' is PERMIT. Ignored for DENY rules. + """ # noqa: E501 + + local_preference: Optional[Annotated[int, Field(le=65535, strict=True, ge=0)]] = Field( + default=None, + description="BGP LOCAL_PREF to set on the route. Higher values are preferred during best-path selection. Default BGP LOCAL_PREF is 100; any value here overrides. ", + alias="localPreference", + ) + __properties: ClassVar[List[str]] = ["localPreference"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BGPFilterRuleSet from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPFilterRuleSet from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"localPreference": obj.get("localPreference")}) + return _obj 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 f54288bdd..674100e16 100644 --- a/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py +++ b/services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py @@ -16,6 +16,7 @@ import json import pprint from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python @@ -27,11 +28,16 @@ class BGPTunnelConfig(BaseModel): BGPTunnelConfig """ # noqa: E501 + inbound_filter_id: Optional[UUID] = Field( + default=None, + description="UUID of the BGPFilter to apply to incoming routes from this tunnel's BGP neighbor. The filter must exist in the same gateway. Multiple tunnels may reference the same BGPFilter; in that case the rules' 'match.peer' field can be used to scope behavior per neighbor. Outbound filtering is not yet supported; use gateway.bgp.overrideAdvertisedRoutes to control what is advertised. ", + alias="inboundFilterId", + ) remote_asn: Annotated[int, Field(le=4294967294, strict=True, ge=64512)] = Field( description="ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). ", alias="remoteAsn", ) - __properties: ClassVar[List[str]] = ["remoteAsn"] + __properties: ClassVar[List[str]] = ["inboundFilterId", "remoteAsn"] model_config = ConfigDict( validate_by_name=True, @@ -70,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if inbound_filter_id (nullable) is None + # and model_fields_set contains the field + if self.inbound_filter_id is None and "inbound_filter_id" in self.model_fields_set: + _dict["inboundFilterId"] = None + return _dict @classmethod @@ -81,5 +92,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"remoteAsn": obj.get("remoteAsn")}) + _obj = cls.model_validate({"inboundFilterId": obj.get("inboundFilterId"), "remoteAsn": obj.get("remoteAsn")}) return _obj diff --git a/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_payload.py b/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_payload.py new file mode 100644 index 000000000..ba03da3a6 --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_payload.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CreateGatewayBGPFilterPayload(BaseModel): + """ + A named BGP route filter. Internally a BGPFilter holds an ordered set of rules (managed via the nested /rules sub-resource); a route is evaluated against each rule in 'sequence' order and the first match decides the outcome. An implicit DENY is applied after the last rule, so a route that matches no PERMIT rule is dropped. Attaching an empty filter to a tunnel therefore denies every route. Resource limits: the maximum number of filters per gateway equals the gateway plan's maxConnections value; the maximum number of rules per filter is 10. + """ # noqa: E501 + + display_name: Annotated[str, Field(strict=True)] = Field( + description="A user-friendly name for the filter. Display only — not enforced unique across a gateway.", + alias="displayName", + ) + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the filter.") + __properties: ClassVar[List[str]] = ["displayName", "id"] + + @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( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateGatewayBGPFilterPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateGatewayBGPFilterPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"displayName": obj.get("displayName"), "id": obj.get("id")}) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_rule_payload.py b/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_rule_payload.py new file mode 100644 index 000000000..c8035e9f0 --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/create_gateway_bgp_filter_rule_payload.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +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_filter_rule_match import BGPFilterRuleMatch +from stackit.vpn.models.bgp_filter_rule_set import BGPFilterRuleSet + + +class CreateGatewayBGPFilterRulePayload(BaseModel): + """ + A single rule within a BGPFilter. All non-empty fields within the 'match' block are AND-combined. Rules within a filter are evaluated in 'sequence' order; the first matching rule decides the outcome (logical OR across rules). An implicit DENY follows the last rule. + """ # noqa: E501 + + action: StrictStr = Field(description="The action to take if the route matches all criteria. Case-sensitive.") + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the specific rule.") + match: Optional[BGPFilterRuleMatch] = None + sequence: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field( + default=None, + description="The evaluation order of the rule. Lower numbers are evaluated first. Must be unique within a filter. On POST, this field is optional: when omitted the server auto-assigns max(existing)+10 (the first rule starts at 10). On PUT this field is required — sending a partial update without 'sequence' returns 400. ", + ) + set: Optional[BGPFilterRuleSet] = None + __properties: ClassVar[List[str]] = ["action", "id", "match", "sequence", "set"] + + @field_validator("action") + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["PERMIT", "DENY"]): + raise ValueError("must be one of enum values ('PERMIT', 'DENY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateGatewayBGPFilterRulePayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of match + if self.match: + _dict["match"] = self.match.to_dict() + # override the default output from pydantic by calling `to_dict()` of set + if self.set: + _dict["set"] = self.set.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateGatewayBGPFilterRulePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "action": obj.get("action"), + "id": obj.get("id"), + "match": BGPFilterRuleMatch.from_dict(obj["match"]) if obj.get("match") is not None else None, + "sequence": obj.get("sequence"), + "set": BGPFilterRuleSet.from_dict(obj["set"]) if obj.get("set") is not None else None, + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/create_gateway_payload.py b/services/vpn/src/stackit/vpn/models/create_gateway_payload.py index 38e42dabc..96ee97315 100644 --- a/services/vpn/src/stackit/vpn/models/create_gateway_payload.py +++ b/services/vpn/src/stackit/vpn/models/create_gateway_payload.py @@ -26,6 +26,7 @@ from stackit.vpn.models.create_gateway_payload_availability_zones import ( CreateGatewayPayloadAvailabilityZones, ) +from stackit.vpn.models.network_config import NetworkConfig from stackit.vpn.models.routing_type import RoutingType @@ -43,9 +44,18 @@ class CreateGatewayPayload(BaseModel): default=None, description="Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. ", ) + network_config: Optional[NetworkConfig] = Field(default=None, alias="networkConfig") plan_id: StrictStr = Field(description="The service plan identifier.", alias="planId") routing_type: RoutingType = Field(alias="routingType") - __properties: ClassVar[List[str]] = ["availabilityZones", "bgp", "displayName", "labels", "planId", "routingType"] + __properties: ClassVar[List[str]] = [ + "availabilityZones", + "bgp", + "displayName", + "labels", + "networkConfig", + "planId", + "routingType", + ] @field_validator("display_name") def display_name_validate_regular_expression(cls, value): @@ -100,6 +110,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of bgp if self.bgp: _dict["bgp"] = self.bgp.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_config + if self.network_config: + _dict["networkConfig"] = self.network_config.to_dict() return _dict @classmethod @@ -121,6 +134,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bgp": BGPGatewayConfig.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None, "displayName": obj.get("displayName"), "labels": obj.get("labels"), + "networkConfig": ( + NetworkConfig.from_dict(obj["networkConfig"]) if obj.get("networkConfig") is not None else None + ), "planId": obj.get("planId"), "routingType": obj.get("routingType"), } diff --git a/services/vpn/src/stackit/vpn/models/gateway.py b/services/vpn/src/stackit/vpn/models/gateway.py index 1a77072b9..5f0a712c0 100644 --- a/services/vpn/src/stackit/vpn/models/gateway.py +++ b/services/vpn/src/stackit/vpn/models/gateway.py @@ -26,6 +26,7 @@ from stackit.vpn.models.create_gateway_payload_availability_zones import ( CreateGatewayPayloadAvailabilityZones, ) +from stackit.vpn.models.network_config import NetworkConfig from stackit.vpn.models.routing_type import RoutingType @@ -43,9 +44,18 @@ class Gateway(BaseModel): default=None, description="Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. ", ) + network_config: Optional[NetworkConfig] = Field(default=None, alias="networkConfig") plan_id: StrictStr = Field(description="The service plan identifier.", alias="planId") routing_type: RoutingType = Field(alias="routingType") - __properties: ClassVar[List[str]] = ["availabilityZones", "bgp", "displayName", "labels", "planId", "routingType"] + __properties: ClassVar[List[str]] = [ + "availabilityZones", + "bgp", + "displayName", + "labels", + "networkConfig", + "planId", + "routingType", + ] @field_validator("display_name") def display_name_validate_regular_expression(cls, value): @@ -100,6 +110,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of bgp if self.bgp: _dict["bgp"] = self.bgp.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_config + if self.network_config: + _dict["networkConfig"] = self.network_config.to_dict() return _dict @classmethod @@ -121,6 +134,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bgp": BGPGatewayConfig.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None, "displayName": obj.get("displayName"), "labels": obj.get("labels"), + "networkConfig": ( + NetworkConfig.from_dict(obj["networkConfig"]) if obj.get("networkConfig") is not None else None + ), "planId": obj.get("planId"), "routingType": obj.get("routingType"), } diff --git a/services/vpn/src/stackit/vpn/models/gateway_response.py b/services/vpn/src/stackit/vpn/models/gateway_response.py index 4f3dafecb..c78eb0c1a 100644 --- a/services/vpn/src/stackit/vpn/models/gateway_response.py +++ b/services/vpn/src/stackit/vpn/models/gateway_response.py @@ -28,6 +28,7 @@ CreateGatewayPayloadAvailabilityZones, ) from stackit.vpn.models.gateway_status import GatewayStatus +from stackit.vpn.models.network_config import NetworkConfig from stackit.vpn.models.routing_type import RoutingType @@ -45,6 +46,7 @@ class GatewayResponse(BaseModel): default=None, description="Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. ", ) + network_config: Optional[NetworkConfig] = Field(default=None, alias="networkConfig") plan_id: StrictStr = Field(description="The service plan identifier.", alias="planId") routing_type: RoutingType = Field(alias="routingType") id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the VPN gateway.") @@ -54,6 +56,7 @@ class GatewayResponse(BaseModel): "bgp", "displayName", "labels", + "networkConfig", "planId", "routingType", "id", @@ -118,6 +121,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of bgp if self.bgp: _dict["bgp"] = self.bgp.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_config + if self.network_config: + _dict["networkConfig"] = self.network_config.to_dict() return _dict @classmethod @@ -139,6 +145,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bgp": BGPGatewayConfig.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None, "displayName": obj.get("displayName"), "labels": obj.get("labels"), + "networkConfig": ( + NetworkConfig.from_dict(obj["networkConfig"]) if obj.get("networkConfig") is not None else None + ), "planId": obj.get("planId"), "routingType": obj.get("routingType"), "id": obj.get("id"), diff --git a/services/vpn/src/stackit/vpn/models/network_config.py b/services/vpn/src/stackit/vpn/models/network_config.py new file mode 100644 index 000000000..93f46640a --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/network_config.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class NetworkConfig(BaseModel): + """ + NetworkConfig + """ # noqa: E501 + + predefined_network_prefix: Optional[List[Annotated[str, Field(strict=True)]]] = Field( + default=None, + description="The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. ", + alias="predefinedNetworkPrefix", + ) + routing_table_id: Optional[UUID] = Field( + default=None, description="Custom routing table ID for the VPN gateway", alias="routingTableId" + ) + __properties: ClassVar[List[str]] = ["predefinedNetworkPrefix", "routingTableId"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"predefinedNetworkPrefix": obj.get("predefinedNetworkPrefix"), "routingTableId": obj.get("routingTableId")} + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_payload.py b/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_payload.py new file mode 100644 index 000000000..3f9fc216a --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_payload.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class UpdateGatewayBGPFilterPayload(BaseModel): + """ + A named BGP route filter. Internally a BGPFilter holds an ordered set of rules (managed via the nested /rules sub-resource); a route is evaluated against each rule in 'sequence' order and the first match decides the outcome. An implicit DENY is applied after the last rule, so a route that matches no PERMIT rule is dropped. Attaching an empty filter to a tunnel therefore denies every route. Resource limits: the maximum number of filters per gateway equals the gateway plan's maxConnections value; the maximum number of rules per filter is 10. + """ # noqa: E501 + + display_name: Annotated[str, Field(strict=True)] = Field( + description="A user-friendly name for the filter. Display only — not enforced unique across a gateway.", + alias="displayName", + ) + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the filter.") + __properties: ClassVar[List[str]] = ["displayName", "id"] + + @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( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateGatewayBGPFilterPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateGatewayBGPFilterPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"displayName": obj.get("displayName"), "id": obj.get("id")}) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_rule_payload.py b/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_rule_payload.py new file mode 100644 index 000000000..5259ad69f --- /dev/null +++ b/services/vpn/src/stackit/vpn/models/update_gateway_bgp_filter_rule_payload.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + STACKIT VPN API + + 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: 1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +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_filter_rule_match import BGPFilterRuleMatch +from stackit.vpn.models.bgp_filter_rule_set import BGPFilterRuleSet + + +class UpdateGatewayBGPFilterRulePayload(BaseModel): + """ + A single rule within a BGPFilter. All non-empty fields within the 'match' block are AND-combined. Rules within a filter are evaluated in 'sequence' order; the first matching rule decides the outcome (logical OR across rules). An implicit DENY follows the last rule. + """ # noqa: E501 + + action: StrictStr = Field(description="The action to take if the route matches all criteria. Case-sensitive.") + id: Optional[UUID] = Field(default=None, description="The server-generated UUID of the specific rule.") + match: Optional[BGPFilterRuleMatch] = None + sequence: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field( + default=None, + description="The evaluation order of the rule. Lower numbers are evaluated first. Must be unique within a filter. On POST, this field is optional: when omitted the server auto-assigns max(existing)+10 (the first rule starts at 10). On PUT this field is required — sending a partial update without 'sequence' returns 400. ", + ) + set: Optional[BGPFilterRuleSet] = None + __properties: ClassVar[List[str]] = ["action", "id", "match", "sequence", "set"] + + @field_validator("action") + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["PERMIT", "DENY"]): + raise ValueError("must be one of enum values ('PERMIT', 'DENY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateGatewayBGPFilterRulePayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of match + if self.match: + _dict["match"] = self.match.to_dict() + # override the default output from pydantic by calling `to_dict()` of set + if self.set: + _dict["set"] = self.set.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateGatewayBGPFilterRulePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "action": obj.get("action"), + "id": obj.get("id"), + "match": BGPFilterRuleMatch.from_dict(obj["match"]) if obj.get("match") is not None else None, + "sequence": obj.get("sequence"), + "set": BGPFilterRuleSet.from_dict(obj["set"]) if obj.get("set") is not None else None, + } + ) + return _obj diff --git a/services/vpn/src/stackit/vpn/models/update_gateway_payload.py b/services/vpn/src/stackit/vpn/models/update_gateway_payload.py index cc47a7a03..e1725a474 100644 --- a/services/vpn/src/stackit/vpn/models/update_gateway_payload.py +++ b/services/vpn/src/stackit/vpn/models/update_gateway_payload.py @@ -26,6 +26,7 @@ from stackit.vpn.models.create_gateway_payload_availability_zones import ( CreateGatewayPayloadAvailabilityZones, ) +from stackit.vpn.models.network_config import NetworkConfig from stackit.vpn.models.routing_type import RoutingType @@ -43,9 +44,18 @@ class UpdateGatewayPayload(BaseModel): default=None, description="Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. ", ) + network_config: Optional[NetworkConfig] = Field(default=None, alias="networkConfig") plan_id: StrictStr = Field(description="The service plan identifier.", alias="planId") routing_type: RoutingType = Field(alias="routingType") - __properties: ClassVar[List[str]] = ["availabilityZones", "bgp", "displayName", "labels", "planId", "routingType"] + __properties: ClassVar[List[str]] = [ + "availabilityZones", + "bgp", + "displayName", + "labels", + "networkConfig", + "planId", + "routingType", + ] @field_validator("display_name") def display_name_validate_regular_expression(cls, value): @@ -100,6 +110,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of bgp if self.bgp: _dict["bgp"] = self.bgp.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_config + if self.network_config: + _dict["networkConfig"] = self.network_config.to_dict() return _dict @classmethod @@ -121,6 +134,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bgp": BGPGatewayConfig.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None, "displayName": obj.get("displayName"), "labels": obj.get("labels"), + "networkConfig": ( + NetworkConfig.from_dict(obj["networkConfig"]) if obj.get("networkConfig") is not None else None + ), "planId": obj.get("planId"), "routingType": obj.get("routingType"), }