From ed8bd928e5761561f1c2dc54226dc7f31349c859 Mon Sep 17 00:00:00 2001 From: Prototool Bot Date: Wed, 27 May 2026 14:38:03 +0000 Subject: [PATCH] feat: update generated APIs --- .../s2s_vpn/v1alpha1/__init__.py | 10 ++- .../scaleway_async/s2s_vpn/v1alpha1/api.py | 63 ++++++++++++++++++- .../s2s_vpn/v1alpha1/marshalling.py | 62 ++++++++++++++++++ .../scaleway_async/s2s_vpn/v1alpha1/types.py | 53 +++++++++++++--- .../scaleway/s2s_vpn/v1alpha1/__init__.py | 10 ++- scaleway/scaleway/s2s_vpn/v1alpha1/api.py | 63 ++++++++++++++++++- .../scaleway/s2s_vpn/v1alpha1/marshalling.py | 62 ++++++++++++++++++ scaleway/scaleway/s2s_vpn/v1alpha1/types.py | 53 +++++++++++++--- 8 files changed, 354 insertions(+), 22 deletions(-) diff --git a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/__init__.py b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/__init__.py index f55317582..dd5755db7 100644 --- a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/__init__.py @@ -20,15 +20,18 @@ from .types import CreateVpnGatewayRequestSingleIpTunnel from .types import VpnGatewayPrivateConfig from .types import VpnGatewayPublicConfig +from .types import ChangeConnectionPskRequestSecret +from .types import Connection from .types import CreateConnectionRequestBgpConfig from .types import CreateConnectionRequestSecret -from .types import Connection from .types import CreateVpnGatewayRequestPublicConfig from .types import CreateVpnGatewayRequestPublicTunnelConfig from .types import CustomerGateway from .types import RoutingPolicy from .types import GatewayType from .types import VpnGateway +from .types import ChangeConnectionPskRequest +from .types import ChangeConnectionPskResponse from .types import CreateConnectionRequest from .types import CreateConnectionResponse from .types import CreateCustomerGatewayRequest @@ -85,15 +88,18 @@ "CreateVpnGatewayRequestSingleIpTunnel", "VpnGatewayPrivateConfig", "VpnGatewayPublicConfig", + "ChangeConnectionPskRequestSecret", + "Connection", "CreateConnectionRequestBgpConfig", "CreateConnectionRequestSecret", - "Connection", "CreateVpnGatewayRequestPublicConfig", "CreateVpnGatewayRequestPublicTunnelConfig", "CustomerGateway", "RoutingPolicy", "GatewayType", "VpnGateway", + "ChangeConnectionPskRequest", + "ChangeConnectionPskResponse", "CreateConnectionRequest", "CreateConnectionResponse", "CreateCustomerGatewayRequest", diff --git a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/api.py b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/api.py index ccde945b4..d00de152b 100644 --- a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/api.py @@ -22,6 +22,9 @@ ListRoutingPoliciesRequestOrderBy, ListVpnGatewaysRequestOrderBy, VpnGatewayStatus, + ChangeConnectionPskRequest, + ChangeConnectionPskRequestSecret, + ChangeConnectionPskResponse, Connection, ConnectionCipher, CreateConnectionRequest, @@ -41,6 +44,7 @@ ListRoutingPoliciesResponse, ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, + RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, @@ -58,6 +62,7 @@ unmarshal_CustomerGateway, unmarshal_RoutingPolicy, unmarshal_VpnGateway, + unmarshal_ChangeConnectionPskResponse, unmarshal_CreateConnectionResponse, unmarshal_ListConnectionsResponse, unmarshal_ListCustomerGatewaysResponse, @@ -65,11 +70,13 @@ unmarshal_ListVpnGatewayTypesResponse, unmarshal_ListVpnGatewaysResponse, unmarshal_RenewConnectionPskResponse, + marshal_ChangeConnectionPskRequest, marshal_CreateConnectionRequest, marshal_CreateCustomerGatewayRequest, marshal_CreateRoutingPolicyRequest, marshal_CreateVpnGatewayRequest, marshal_DetachRoutingPolicyRequest, + marshal_RenewConnectionPskRequest, marshal_SetRoutingPolicyRequest, marshal_UpdateConnectionRequest, marshal_UpdateCustomerGatewayRequest, @@ -841,12 +848,14 @@ async def renew_connection_psk( *, connection_id: str, region: Optional[ScwRegion] = None, + generate_revision: Optional[bool] = None, ) -> RenewConnectionPskResponse: """ Renew pre-shared key. Renew pre-shared key for a given connection. :param connection_id: ID of the connection to renew the PSK. :param region: Region to target. If none is passed will use default region from the config. + :param generate_revision: Generate a new revision or update to the latest existing one. :return: :class:`RenewConnectionPskResponse ` Usage: @@ -865,12 +874,64 @@ async def renew_connection_psk( res = self._request( "POST", f"/s2s-vpn/v1alpha1/regions/{param_region}/connections/{param_connection_id}/renew-psk", - body={}, + body=marshal_RenewConnectionPskRequest( + RenewConnectionPskRequest( + connection_id=connection_id, + region=region, + generate_revision=generate_revision, + ), + self.client, + ), ) self._throw_on_error(res) return unmarshal_RenewConnectionPskResponse(res.json()) + async def change_connection_psk( + self, + *, + connection_id: str, + secret: ChangeConnectionPskRequestSecret, + region: Optional[ScwRegion] = None, + ) -> ChangeConnectionPskResponse: + """ + Change pre-shared key. + Change pre-shared key for a given connection. + :param connection_id: ID of the connection to renew the PSK. + :param secret: New PSK Secret of the connection. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ChangeConnectionPskResponse ` + + Usage: + :: + + result = await api.change_connection_psk( + connection_id="example", + secret=ChangeConnectionPskRequestSecret(), + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_connection_id = validate_path_param("connection_id", connection_id) + + res = self._request( + "POST", + f"/s2s-vpn/v1alpha1/regions/{param_region}/connections/{param_connection_id}/change-psk", + body=marshal_ChangeConnectionPskRequest( + ChangeConnectionPskRequest( + connection_id=connection_id, + secret=secret, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_ChangeConnectionPskResponse(res.json()) + async def set_routing_policy( self, *, diff --git a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/marshalling.py index a0ea51155..988bd45b9 100644 --- a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/marshalling.py @@ -23,6 +23,7 @@ VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGateway, + ChangeConnectionPskResponse, CreateConnectionResponse, ListConnectionsResponse, ListCustomerGatewaysResponse, @@ -31,6 +32,8 @@ ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, RenewConnectionPskResponse, + ChangeConnectionPskRequestSecret, + ChangeConnectionPskRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestSecret, CreateConnectionRequest, @@ -42,6 +45,7 @@ CreateVpnGatewayRequestPublicTunnelConfig, CreateVpnGatewayRequest, DetachRoutingPolicyRequest, + RenewConnectionPskRequest, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, @@ -590,6 +594,23 @@ def unmarshal_VpnGateway(data: Any) -> VpnGateway: return VpnGateway(**args) +def unmarshal_ChangeConnectionPskResponse(data: Any) -> ChangeConnectionPskResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ChangeConnectionPskResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("connection", None) + if field is not None: + args["connection"] = unmarshal_Connection(field) + else: + args["connection"] = None + + return ChangeConnectionPskResponse(**args) + + def unmarshal_CreateConnectionResponse(data: Any) -> CreateConnectionResponse: if not isinstance(data, dict): raise TypeError( @@ -802,6 +823,35 @@ def unmarshal_RenewConnectionPskResponse(data: Any) -> RenewConnectionPskRespons return RenewConnectionPskResponse(**args) +def marshal_ChangeConnectionPskRequestSecret( + request: ChangeConnectionPskRequestSecret, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.id is not None: + output["id"] = request.id + + if request.revision is not None: + output["revision"] = request.revision + + return output + + +def marshal_ChangeConnectionPskRequest( + request: ChangeConnectionPskRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.secret is not None: + output["secret"] = marshal_ChangeConnectionPskRequestSecret( + request.secret, defaults + ) + + return output + + def marshal_ConnectionCipher( request: ConnectionCipher, defaults: ProfileDefaults, @@ -1119,6 +1169,18 @@ def marshal_DetachRoutingPolicyRequest( return output +def marshal_RenewConnectionPskRequest( + request: RenewConnectionPskRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.generate_revision is not None: + output["generate_revision"] = request.generate_revision + + return output + + def marshal_SetRoutingPolicyRequest( request: SetRoutingPolicyRequest, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/types.py b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/types.py index 057c8ce9d..f507d5a73 100644 --- a/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/s2s_vpn/v1alpha1/types.py @@ -200,14 +200,7 @@ class VpnGatewayPublicConfig: @dataclass -class CreateConnectionRequestBgpConfig: - routing_policy_id: str - private_ip: Optional[str] = None - peer_private_ip: Optional[str] = None - - -@dataclass -class CreateConnectionRequestSecret: +class ChangeConnectionPskRequestSecret: id: str revision: Optional[int] = None @@ -340,6 +333,19 @@ class Connection: """ +@dataclass +class CreateConnectionRequestBgpConfig: + routing_policy_id: str + private_ip: Optional[str] = None + peer_private_ip: Optional[str] = None + + +@dataclass +class CreateConnectionRequestSecret: + id: str + revision: Optional[int] = None + + @dataclass class CreateVpnGatewayRequestPublicConfig: ipam_ipv4_id: Optional[str] = None @@ -575,6 +581,32 @@ class VpnGateway: private_config: Optional[VpnGatewayPrivateConfig] = None +@dataclass +class ChangeConnectionPskRequest: + connection_id: str + """ + ID of the connection to renew the PSK. + """ + + secret: ChangeConnectionPskRequestSecret + """ + New PSK Secret of the connection. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class ChangeConnectionPskResponse: + connection: Optional[Connection] = None + """ + This connection. + """ + + @dataclass class CreateConnectionRequest: name: str @@ -1254,6 +1286,11 @@ class RenewConnectionPskRequest: Region to target. If none is passed will use default region from the config. """ + generate_revision: Optional[bool] = False + """ + Generate a new revision or update to the latest existing one. + """ + @dataclass class RenewConnectionPskResponse: diff --git a/scaleway/scaleway/s2s_vpn/v1alpha1/__init__.py b/scaleway/scaleway/s2s_vpn/v1alpha1/__init__.py index f55317582..dd5755db7 100644 --- a/scaleway/scaleway/s2s_vpn/v1alpha1/__init__.py +++ b/scaleway/scaleway/s2s_vpn/v1alpha1/__init__.py @@ -20,15 +20,18 @@ from .types import CreateVpnGatewayRequestSingleIpTunnel from .types import VpnGatewayPrivateConfig from .types import VpnGatewayPublicConfig +from .types import ChangeConnectionPskRequestSecret +from .types import Connection from .types import CreateConnectionRequestBgpConfig from .types import CreateConnectionRequestSecret -from .types import Connection from .types import CreateVpnGatewayRequestPublicConfig from .types import CreateVpnGatewayRequestPublicTunnelConfig from .types import CustomerGateway from .types import RoutingPolicy from .types import GatewayType from .types import VpnGateway +from .types import ChangeConnectionPskRequest +from .types import ChangeConnectionPskResponse from .types import CreateConnectionRequest from .types import CreateConnectionResponse from .types import CreateCustomerGatewayRequest @@ -85,15 +88,18 @@ "CreateVpnGatewayRequestSingleIpTunnel", "VpnGatewayPrivateConfig", "VpnGatewayPublicConfig", + "ChangeConnectionPskRequestSecret", + "Connection", "CreateConnectionRequestBgpConfig", "CreateConnectionRequestSecret", - "Connection", "CreateVpnGatewayRequestPublicConfig", "CreateVpnGatewayRequestPublicTunnelConfig", "CustomerGateway", "RoutingPolicy", "GatewayType", "VpnGateway", + "ChangeConnectionPskRequest", + "ChangeConnectionPskResponse", "CreateConnectionRequest", "CreateConnectionResponse", "CreateCustomerGatewayRequest", diff --git a/scaleway/scaleway/s2s_vpn/v1alpha1/api.py b/scaleway/scaleway/s2s_vpn/v1alpha1/api.py index 417dd3ec9..4ffa9ea9d 100644 --- a/scaleway/scaleway/s2s_vpn/v1alpha1/api.py +++ b/scaleway/scaleway/s2s_vpn/v1alpha1/api.py @@ -22,6 +22,9 @@ ListRoutingPoliciesRequestOrderBy, ListVpnGatewaysRequestOrderBy, VpnGatewayStatus, + ChangeConnectionPskRequest, + ChangeConnectionPskRequestSecret, + ChangeConnectionPskResponse, Connection, ConnectionCipher, CreateConnectionRequest, @@ -41,6 +44,7 @@ ListRoutingPoliciesResponse, ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, + RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, @@ -58,6 +62,7 @@ unmarshal_CustomerGateway, unmarshal_RoutingPolicy, unmarshal_VpnGateway, + unmarshal_ChangeConnectionPskResponse, unmarshal_CreateConnectionResponse, unmarshal_ListConnectionsResponse, unmarshal_ListCustomerGatewaysResponse, @@ -65,11 +70,13 @@ unmarshal_ListVpnGatewayTypesResponse, unmarshal_ListVpnGatewaysResponse, unmarshal_RenewConnectionPskResponse, + marshal_ChangeConnectionPskRequest, marshal_CreateConnectionRequest, marshal_CreateCustomerGatewayRequest, marshal_CreateRoutingPolicyRequest, marshal_CreateVpnGatewayRequest, marshal_DetachRoutingPolicyRequest, + marshal_RenewConnectionPskRequest, marshal_SetRoutingPolicyRequest, marshal_UpdateConnectionRequest, marshal_UpdateCustomerGatewayRequest, @@ -839,12 +846,14 @@ def renew_connection_psk( *, connection_id: str, region: Optional[ScwRegion] = None, + generate_revision: Optional[bool] = None, ) -> RenewConnectionPskResponse: """ Renew pre-shared key. Renew pre-shared key for a given connection. :param connection_id: ID of the connection to renew the PSK. :param region: Region to target. If none is passed will use default region from the config. + :param generate_revision: Generate a new revision or update to the latest existing one. :return: :class:`RenewConnectionPskResponse ` Usage: @@ -863,12 +872,64 @@ def renew_connection_psk( res = self._request( "POST", f"/s2s-vpn/v1alpha1/regions/{param_region}/connections/{param_connection_id}/renew-psk", - body={}, + body=marshal_RenewConnectionPskRequest( + RenewConnectionPskRequest( + connection_id=connection_id, + region=region, + generate_revision=generate_revision, + ), + self.client, + ), ) self._throw_on_error(res) return unmarshal_RenewConnectionPskResponse(res.json()) + def change_connection_psk( + self, + *, + connection_id: str, + secret: ChangeConnectionPskRequestSecret, + region: Optional[ScwRegion] = None, + ) -> ChangeConnectionPskResponse: + """ + Change pre-shared key. + Change pre-shared key for a given connection. + :param connection_id: ID of the connection to renew the PSK. + :param secret: New PSK Secret of the connection. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ChangeConnectionPskResponse ` + + Usage: + :: + + result = api.change_connection_psk( + connection_id="example", + secret=ChangeConnectionPskRequestSecret(), + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_connection_id = validate_path_param("connection_id", connection_id) + + res = self._request( + "POST", + f"/s2s-vpn/v1alpha1/regions/{param_region}/connections/{param_connection_id}/change-psk", + body=marshal_ChangeConnectionPskRequest( + ChangeConnectionPskRequest( + connection_id=connection_id, + secret=secret, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_ChangeConnectionPskResponse(res.json()) + def set_routing_policy( self, *, diff --git a/scaleway/scaleway/s2s_vpn/v1alpha1/marshalling.py b/scaleway/scaleway/s2s_vpn/v1alpha1/marshalling.py index a0ea51155..988bd45b9 100644 --- a/scaleway/scaleway/s2s_vpn/v1alpha1/marshalling.py +++ b/scaleway/scaleway/s2s_vpn/v1alpha1/marshalling.py @@ -23,6 +23,7 @@ VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGateway, + ChangeConnectionPskResponse, CreateConnectionResponse, ListConnectionsResponse, ListCustomerGatewaysResponse, @@ -31,6 +32,8 @@ ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, RenewConnectionPskResponse, + ChangeConnectionPskRequestSecret, + ChangeConnectionPskRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestSecret, CreateConnectionRequest, @@ -42,6 +45,7 @@ CreateVpnGatewayRequestPublicTunnelConfig, CreateVpnGatewayRequest, DetachRoutingPolicyRequest, + RenewConnectionPskRequest, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, @@ -590,6 +594,23 @@ def unmarshal_VpnGateway(data: Any) -> VpnGateway: return VpnGateway(**args) +def unmarshal_ChangeConnectionPskResponse(data: Any) -> ChangeConnectionPskResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ChangeConnectionPskResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("connection", None) + if field is not None: + args["connection"] = unmarshal_Connection(field) + else: + args["connection"] = None + + return ChangeConnectionPskResponse(**args) + + def unmarshal_CreateConnectionResponse(data: Any) -> CreateConnectionResponse: if not isinstance(data, dict): raise TypeError( @@ -802,6 +823,35 @@ def unmarshal_RenewConnectionPskResponse(data: Any) -> RenewConnectionPskRespons return RenewConnectionPskResponse(**args) +def marshal_ChangeConnectionPskRequestSecret( + request: ChangeConnectionPskRequestSecret, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.id is not None: + output["id"] = request.id + + if request.revision is not None: + output["revision"] = request.revision + + return output + + +def marshal_ChangeConnectionPskRequest( + request: ChangeConnectionPskRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.secret is not None: + output["secret"] = marshal_ChangeConnectionPskRequestSecret( + request.secret, defaults + ) + + return output + + def marshal_ConnectionCipher( request: ConnectionCipher, defaults: ProfileDefaults, @@ -1119,6 +1169,18 @@ def marshal_DetachRoutingPolicyRequest( return output +def marshal_RenewConnectionPskRequest( + request: RenewConnectionPskRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.generate_revision is not None: + output["generate_revision"] = request.generate_revision + + return output + + def marshal_SetRoutingPolicyRequest( request: SetRoutingPolicyRequest, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/s2s_vpn/v1alpha1/types.py b/scaleway/scaleway/s2s_vpn/v1alpha1/types.py index 057c8ce9d..f507d5a73 100644 --- a/scaleway/scaleway/s2s_vpn/v1alpha1/types.py +++ b/scaleway/scaleway/s2s_vpn/v1alpha1/types.py @@ -200,14 +200,7 @@ class VpnGatewayPublicConfig: @dataclass -class CreateConnectionRequestBgpConfig: - routing_policy_id: str - private_ip: Optional[str] = None - peer_private_ip: Optional[str] = None - - -@dataclass -class CreateConnectionRequestSecret: +class ChangeConnectionPskRequestSecret: id: str revision: Optional[int] = None @@ -340,6 +333,19 @@ class Connection: """ +@dataclass +class CreateConnectionRequestBgpConfig: + routing_policy_id: str + private_ip: Optional[str] = None + peer_private_ip: Optional[str] = None + + +@dataclass +class CreateConnectionRequestSecret: + id: str + revision: Optional[int] = None + + @dataclass class CreateVpnGatewayRequestPublicConfig: ipam_ipv4_id: Optional[str] = None @@ -575,6 +581,32 @@ class VpnGateway: private_config: Optional[VpnGatewayPrivateConfig] = None +@dataclass +class ChangeConnectionPskRequest: + connection_id: str + """ + ID of the connection to renew the PSK. + """ + + secret: ChangeConnectionPskRequestSecret + """ + New PSK Secret of the connection. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class ChangeConnectionPskResponse: + connection: Optional[Connection] = None + """ + This connection. + """ + + @dataclass class CreateConnectionRequest: name: str @@ -1254,6 +1286,11 @@ class RenewConnectionPskRequest: Region to target. If none is passed will use default region from the config. """ + generate_revision: Optional[bool] = False + """ + Generate a new revision or update to the latest existing one. + """ + @dataclass class RenewConnectionPskResponse: