Skip to content
Open
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
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .types import ListPrivateNetworksRequestOrderBy
from .types import ListSubnetsRequestOrderBy
from .types import ListVPCsRequestOrderBy
from .types import RouteType
from .types import Subnet
from .types import PrivateNetwork
from .types import Route
Expand Down Expand Up @@ -47,6 +48,7 @@
"ListPrivateNetworksRequestOrderBy",
"ListSubnetsRequestOrderBy",
"ListVPCsRequestOrderBy",
"RouteType",
"Subnet",
"PrivateNetwork",
"Route",
Expand Down
7 changes: 7 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.profile import ProfileDefaults
from .types import (
RouteType,
Subnet,
PrivateNetwork,
Route,
Expand Down Expand Up @@ -242,6 +243,12 @@ def unmarshal_Route(data: Any) -> Route:
else:
args["updated_at"] = None

field = data.get("type", None)
if field is not None:
args["type_"] = field
else:
args["type_"] = RouteType.UNKNOWN_ROUTE_TYPE

return Route(**args)


Expand Down
17 changes: 17 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ def __str__(self) -> str:
return str(self.value)


class RouteType(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_ROUTE_TYPE = "unknown_route_type"
SUBNET = "subnet"
DEFAULT = "default"
CUSTOM = "custom"
INTERLINK = "interlink"
S2S_VPN = "s2s_vpn"

def __str__(self) -> str:
return str(self.value)


@dataclass
class Subnet:
id: str
Expand Down Expand Up @@ -220,6 +232,11 @@ class Route:
Date the Route was last modified.
"""

type_: Optional[RouteType] = RouteType.UNKNOWN_ROUTE_TYPE
"""
Type of the Route.
"""


@dataclass
class AclRule:
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/vpc/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .types import ListPrivateNetworksRequestOrderBy
from .types import ListSubnetsRequestOrderBy
from .types import ListVPCsRequestOrderBy
from .types import RouteType
from .types import Subnet
from .types import PrivateNetwork
from .types import Route
Expand Down Expand Up @@ -47,6 +48,7 @@
"ListPrivateNetworksRequestOrderBy",
"ListSubnetsRequestOrderBy",
"ListVPCsRequestOrderBy",
"RouteType",
"Subnet",
"PrivateNetwork",
"Route",
Expand Down
7 changes: 7 additions & 0 deletions scaleway/scaleway/vpc/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.profile import ProfileDefaults
from .types import (
RouteType,
Subnet,
PrivateNetwork,
Route,
Expand Down Expand Up @@ -242,6 +243,12 @@ def unmarshal_Route(data: Any) -> Route:
else:
args["updated_at"] = None

field = data.get("type", None)
if field is not None:
args["type_"] = field
else:
args["type_"] = RouteType.UNKNOWN_ROUTE_TYPE

return Route(**args)


Expand Down
17 changes: 17 additions & 0 deletions scaleway/scaleway/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ def __str__(self) -> str:
return str(self.value)


class RouteType(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_ROUTE_TYPE = "unknown_route_type"
SUBNET = "subnet"
DEFAULT = "default"
CUSTOM = "custom"
INTERLINK = "interlink"
S2S_VPN = "s2s_vpn"

def __str__(self) -> str:
return str(self.value)


@dataclass
class Subnet:
id: str
Expand Down Expand Up @@ -220,6 +232,11 @@ class Route:
Date the Route was last modified.
"""

type_: Optional[RouteType] = RouteType.UNKNOWN_ROUTE_TYPE
"""
Type of the Route.
"""


@dataclass
class AclRule:
Expand Down