Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/s2s_vpn/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
from .content import VPN_GATEWAY_TRANSIENT_STATUSES
from .types import BgpSession
from .types import ConnectionCipher
from .types import CreateVpnGatewayRequestDualIpTunnel
from .types import CreateVpnGatewayRequestSingleIpTunnel
from .types import VpnGatewayPrivateConfig
from .types import VpnGatewayPublicConfig
from .types import CreateConnectionRequestBgpConfig
from .types import Connection
from .types import CreateVpnGatewayRequestPublicConfig
from .types import CreateVpnGatewayRequestPublicTunnelConfig
from .types import CustomerGateway
from .types import RoutingPolicy
from .types import GatewayType
Expand Down Expand Up @@ -77,11 +80,14 @@
"VPN_GATEWAY_TRANSIENT_STATUSES",
"BgpSession",
"ConnectionCipher",
"CreateVpnGatewayRequestDualIpTunnel",
"CreateVpnGatewayRequestSingleIpTunnel",
"VpnGatewayPrivateConfig",
"VpnGatewayPublicConfig",
"CreateConnectionRequestBgpConfig",
"Connection",
"CreateVpnGatewayRequestPublicConfig",
"CreateVpnGatewayRequestPublicTunnelConfig",
"CustomerGateway",
"RoutingPolicy",
"GatewayType",
Expand Down
9 changes: 8 additions & 1 deletion scaleway-async/scaleway_async/s2s_vpn/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CreateRoutingPolicyRequest,
CreateVpnGatewayRequest,
CreateVpnGatewayRequestPublicConfig,
CreateVpnGatewayRequestPublicTunnelConfig,
CustomerGateway,
DetachRoutingPolicyRequest,
GatewayType,
Expand Down Expand Up @@ -351,6 +352,9 @@ async def create_vpn_gateway(
project_id: Optional[str] = None,
tags: Optional[list[str]] = None,
public_config: Optional[CreateVpnGatewayRequestPublicConfig] = None,
public_tunnel_config: Optional[
CreateVpnGatewayRequestPublicTunnelConfig
] = None,
ipam_private_ipv4_id: Optional[str] = None,
ipam_private_ipv6_id: Optional[str] = None,
zone: Optional[ScwZone] = None,
Expand All @@ -364,7 +368,9 @@ async def create_vpn_gateway(
:param project_id: ID of the Project to create the VPN gateway in.
:param tags: List of tags to apply to the VPN gateway.
:param public_config: Public endpoint configuration of the VPN gateway.
One-Of ('endpoint'): at most one of 'public_config' could be set.
One-Of ('endpoint'): at most one of 'public_config', 'public_tunnel_config' could be set.
:param public_tunnel_config:
One-Of ('endpoint'): at most one of 'public_config', 'public_tunnel_config' could be set.
:param ipam_private_ipv4_id: ID of the IPAM private IPv4 address to attach to the VPN gateway.
:param ipam_private_ipv6_id: ID of the IPAM private IPv6 address to attach to the VPN gateway.
:param zone: Availability Zone where the VPN gateway should be provisioned. If no zone is specified, the VPN gateway will be automatically placed.
Expand Down Expand Up @@ -399,6 +405,7 @@ async def create_vpn_gateway(
ipam_private_ipv6_id=ipam_private_ipv6_id,
zone=zone,
public_config=public_config,
public_tunnel_config=public_tunnel_config,
),
self.client,
),
Expand Down
65 changes: 65 additions & 0 deletions scaleway-async/scaleway_async/s2s_vpn/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
CreateConnectionRequest,
CreateCustomerGatewayRequest,
CreateRoutingPolicyRequest,
CreateVpnGatewayRequestDualIpTunnel,
CreateVpnGatewayRequestSingleIpTunnel,
CreateVpnGatewayRequestPublicConfig,
CreateVpnGatewayRequestPublicTunnelConfig,
CreateVpnGatewayRequest,
DetachRoutingPolicyRequest,
SetRoutingPolicyRequest,
Expand Down Expand Up @@ -947,6 +950,33 @@ def marshal_CreateRoutingPolicyRequest(
return output


def marshal_CreateVpnGatewayRequestDualIpTunnel(
request: CreateVpnGatewayRequestDualIpTunnel,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.ipam_ipv4_id is not None:
output["ipam_ipv4_id"] = request.ipam_ipv4_id

if request.ipam_ipv6_id is not None:
output["ipam_ipv6_id"] = request.ipam_ipv6_id

return output


def marshal_CreateVpnGatewayRequestSingleIpTunnel(
request: CreateVpnGatewayRequestSingleIpTunnel,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.ipam_id is not None:
output["ipam_id"] = request.ipam_id

return output


def marshal_CreateVpnGatewayRequestPublicConfig(
request: CreateVpnGatewayRequestPublicConfig,
defaults: ProfileDefaults,
Expand All @@ -962,6 +992,36 @@ def marshal_CreateVpnGatewayRequestPublicConfig(
return output


def marshal_CreateVpnGatewayRequestPublicTunnelConfig(
request: CreateVpnGatewayRequestPublicTunnelConfig,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}
output.update(
resolve_one_of(
[
OneOfPossibility(
param="single_ipv4_tunnel",
value=request.single_ipv4_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestSingleIpTunnel,
),
OneOfPossibility(
param="single_ipv6_tunnel",
value=request.single_ipv6_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestSingleIpTunnel,
),
OneOfPossibility(
param="dual_ipv4v6_tunnel",
value=request.dual_ipv4v6_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestDualIpTunnel,
),
]
),
)

return output


def marshal_CreateVpnGatewayRequest(
request: CreateVpnGatewayRequest,
defaults: ProfileDefaults,
Expand All @@ -975,6 +1035,11 @@ def marshal_CreateVpnGatewayRequest(
value=request.public_config,
marshal_func=marshal_CreateVpnGatewayRequestPublicConfig,
),
OneOfPossibility(
param="public_tunnel_config",
value=request.public_tunnel_config,
marshal_func=marshal_CreateVpnGatewayRequestPublicTunnelConfig,
),
]
),
)
Expand Down
22 changes: 22 additions & 0 deletions scaleway-async/scaleway_async/s2s_vpn/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ class ConnectionCipher:
dh_group: Optional[ConnectionDhGroup] = None


@dataclass
class CreateVpnGatewayRequestDualIpTunnel:
ipam_ipv4_id: Optional[str] = None
ipam_ipv6_id: Optional[str] = None


@dataclass
class CreateVpnGatewayRequestSingleIpTunnel:
ipam_id: Optional[str] = None


@dataclass
class VpnGatewayPrivateConfig:
pass
Expand Down Expand Up @@ -329,6 +340,15 @@ class CreateVpnGatewayRequestPublicConfig:
ipam_ipv6_id: Optional[str] = None


@dataclass
class CreateVpnGatewayRequestPublicTunnelConfig:
single_ipv4_tunnel: Optional[CreateVpnGatewayRequestSingleIpTunnel] = None

single_ipv6_tunnel: Optional[CreateVpnGatewayRequestSingleIpTunnel] = None

dual_ipv4v6_tunnel: Optional[CreateVpnGatewayRequestDualIpTunnel] = None


@dataclass
class CustomerGateway:
id: str
Expand Down Expand Up @@ -755,6 +775,8 @@ class CreateVpnGatewayRequest:

public_config: Optional[CreateVpnGatewayRequestPublicConfig] = None

public_tunnel_config: Optional[CreateVpnGatewayRequestPublicTunnelConfig] = None


@dataclass
class DeleteConnectionRequest:
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/s2s_vpn/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
from .content import VPN_GATEWAY_TRANSIENT_STATUSES
from .types import BgpSession
from .types import ConnectionCipher
from .types import CreateVpnGatewayRequestDualIpTunnel
from .types import CreateVpnGatewayRequestSingleIpTunnel
from .types import VpnGatewayPrivateConfig
from .types import VpnGatewayPublicConfig
from .types import CreateConnectionRequestBgpConfig
from .types import Connection
from .types import CreateVpnGatewayRequestPublicConfig
from .types import CreateVpnGatewayRequestPublicTunnelConfig
from .types import CustomerGateway
from .types import RoutingPolicy
from .types import GatewayType
Expand Down Expand Up @@ -77,11 +80,14 @@
"VPN_GATEWAY_TRANSIENT_STATUSES",
"BgpSession",
"ConnectionCipher",
"CreateVpnGatewayRequestDualIpTunnel",
"CreateVpnGatewayRequestSingleIpTunnel",
"VpnGatewayPrivateConfig",
"VpnGatewayPublicConfig",
"CreateConnectionRequestBgpConfig",
"Connection",
"CreateVpnGatewayRequestPublicConfig",
"CreateVpnGatewayRequestPublicTunnelConfig",
"CustomerGateway",
"RoutingPolicy",
"GatewayType",
Expand Down
9 changes: 8 additions & 1 deletion scaleway/scaleway/s2s_vpn/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CreateRoutingPolicyRequest,
CreateVpnGatewayRequest,
CreateVpnGatewayRequestPublicConfig,
CreateVpnGatewayRequestPublicTunnelConfig,
CustomerGateway,
DetachRoutingPolicyRequest,
GatewayType,
Expand Down Expand Up @@ -349,6 +350,9 @@ def create_vpn_gateway(
project_id: Optional[str] = None,
tags: Optional[list[str]] = None,
public_config: Optional[CreateVpnGatewayRequestPublicConfig] = None,
public_tunnel_config: Optional[
CreateVpnGatewayRequestPublicTunnelConfig
] = None,
ipam_private_ipv4_id: Optional[str] = None,
ipam_private_ipv6_id: Optional[str] = None,
zone: Optional[ScwZone] = None,
Expand All @@ -362,7 +366,9 @@ def create_vpn_gateway(
:param project_id: ID of the Project to create the VPN gateway in.
:param tags: List of tags to apply to the VPN gateway.
:param public_config: Public endpoint configuration of the VPN gateway.
One-Of ('endpoint'): at most one of 'public_config' could be set.
One-Of ('endpoint'): at most one of 'public_config', 'public_tunnel_config' could be set.
:param public_tunnel_config:
One-Of ('endpoint'): at most one of 'public_config', 'public_tunnel_config' could be set.
:param ipam_private_ipv4_id: ID of the IPAM private IPv4 address to attach to the VPN gateway.
:param ipam_private_ipv6_id: ID of the IPAM private IPv6 address to attach to the VPN gateway.
:param zone: Availability Zone where the VPN gateway should be provisioned. If no zone is specified, the VPN gateway will be automatically placed.
Expand Down Expand Up @@ -397,6 +403,7 @@ def create_vpn_gateway(
ipam_private_ipv6_id=ipam_private_ipv6_id,
zone=zone,
public_config=public_config,
public_tunnel_config=public_tunnel_config,
),
self.client,
),
Expand Down
65 changes: 65 additions & 0 deletions scaleway/scaleway/s2s_vpn/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
CreateConnectionRequest,
CreateCustomerGatewayRequest,
CreateRoutingPolicyRequest,
CreateVpnGatewayRequestDualIpTunnel,
CreateVpnGatewayRequestSingleIpTunnel,
CreateVpnGatewayRequestPublicConfig,
CreateVpnGatewayRequestPublicTunnelConfig,
CreateVpnGatewayRequest,
DetachRoutingPolicyRequest,
SetRoutingPolicyRequest,
Expand Down Expand Up @@ -947,6 +950,33 @@ def marshal_CreateRoutingPolicyRequest(
return output


def marshal_CreateVpnGatewayRequestDualIpTunnel(
request: CreateVpnGatewayRequestDualIpTunnel,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.ipam_ipv4_id is not None:
output["ipam_ipv4_id"] = request.ipam_ipv4_id

if request.ipam_ipv6_id is not None:
output["ipam_ipv6_id"] = request.ipam_ipv6_id

return output


def marshal_CreateVpnGatewayRequestSingleIpTunnel(
request: CreateVpnGatewayRequestSingleIpTunnel,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.ipam_id is not None:
output["ipam_id"] = request.ipam_id

return output


def marshal_CreateVpnGatewayRequestPublicConfig(
request: CreateVpnGatewayRequestPublicConfig,
defaults: ProfileDefaults,
Expand All @@ -962,6 +992,36 @@ def marshal_CreateVpnGatewayRequestPublicConfig(
return output


def marshal_CreateVpnGatewayRequestPublicTunnelConfig(
request: CreateVpnGatewayRequestPublicTunnelConfig,
defaults: ProfileDefaults,
) -> dict[str, Any]:
output: dict[str, Any] = {}
output.update(
resolve_one_of(
[
OneOfPossibility(
param="single_ipv4_tunnel",
value=request.single_ipv4_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestSingleIpTunnel,
),
OneOfPossibility(
param="single_ipv6_tunnel",
value=request.single_ipv6_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestSingleIpTunnel,
),
OneOfPossibility(
param="dual_ipv4v6_tunnel",
value=request.dual_ipv4v6_tunnel,
marshal_func=marshal_CreateVpnGatewayRequestDualIpTunnel,
),
]
),
)

return output


def marshal_CreateVpnGatewayRequest(
request: CreateVpnGatewayRequest,
defaults: ProfileDefaults,
Expand All @@ -975,6 +1035,11 @@ def marshal_CreateVpnGatewayRequest(
value=request.public_config,
marshal_func=marshal_CreateVpnGatewayRequestPublicConfig,
),
OneOfPossibility(
param="public_tunnel_config",
value=request.public_tunnel_config,
marshal_func=marshal_CreateVpnGatewayRequestPublicTunnelConfig,
),
]
),
)
Expand Down
Loading
Loading