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
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/interlink/v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .types import ListPopsRequestOrderBy
from .types import ListRoutingPoliciesRequestOrderBy
from .types import BgpConfig
from .types import Range
from .types import PartnerHost
from .types import SelfHost
from .types import DedicatedConnection
Expand Down Expand Up @@ -62,6 +63,7 @@
"ListPopsRequestOrderBy",
"ListRoutingPoliciesRequestOrderBy",
"BgpConfig",
"Range",
"PartnerHost",
"SelfHost",
"DedicatedConnection",
Expand Down
30 changes: 30 additions & 0 deletions scaleway-async/scaleway_async/interlink/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BgpStatus,
DedicatedConnectionStatus,
LinkStatus,
Range,
DedicatedConnection,
BgpConfig,
PartnerHost,
Expand All @@ -37,6 +38,29 @@
)


def unmarshal_Range(data: Any) -> Range:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'Range' failed as data isn't a dictionary."
)

args: dict[str, Any] = {}

field = data.get("start", None)
if field is not None:
args["start"] = field
else:
args["start"] = None

field = data.get("end", None)
if field is not None:
args["end"] = field
else:
args["end"] = None

return Range(**args)


def unmarshal_DedicatedConnection(data: Any) -> DedicatedConnection:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -123,6 +147,12 @@ def unmarshal_DedicatedConnection(data: Any) -> DedicatedConnection:
else:
args["demarcation_info"] = None

field = data.get("vlan_range", None)
if field is not None:
args["vlan_range"] = unmarshal_Range(field)
else:
args["vlan_range"] = None

return DedicatedConnection(**args)


Expand Down
11 changes: 11 additions & 0 deletions scaleway-async/scaleway_async/interlink/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ class BgpConfig:
"""


@dataclass
class Range:
start: int
end: int


@dataclass
class PartnerHost:
partner_id: str
Expand Down Expand Up @@ -230,6 +236,11 @@ class DedicatedConnection:
Demarcation details required by the data center to set up the supporting Cross Connect. This generally includes the physical space in the facility, the cabinet or rack the connection should land in, the patch panel to go in, the port designation, and the media type.
"""

vlan_range: Optional[Range] = None
"""
Range in which to pick vlan for self-hosted links on this dedicated connection. Both start & end are included. Any range defined here must be itself included in the greater allowed range of vlans from 1500 to 3899 (this range is hardware dependent and can change over time, but actual range will be enforced).
"""


@dataclass
class Link:
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/interlink/v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .types import ListPopsRequestOrderBy
from .types import ListRoutingPoliciesRequestOrderBy
from .types import BgpConfig
from .types import Range
from .types import PartnerHost
from .types import SelfHost
from .types import DedicatedConnection
Expand Down Expand Up @@ -62,6 +63,7 @@
"ListPopsRequestOrderBy",
"ListRoutingPoliciesRequestOrderBy",
"BgpConfig",
"Range",
"PartnerHost",
"SelfHost",
"DedicatedConnection",
Expand Down
30 changes: 30 additions & 0 deletions scaleway/scaleway/interlink/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BgpStatus,
DedicatedConnectionStatus,
LinkStatus,
Range,
DedicatedConnection,
BgpConfig,
PartnerHost,
Expand All @@ -37,6 +38,29 @@
)


def unmarshal_Range(data: Any) -> Range:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'Range' failed as data isn't a dictionary."
)

args: dict[str, Any] = {}

field = data.get("start", None)
if field is not None:
args["start"] = field
else:
args["start"] = None

field = data.get("end", None)
if field is not None:
args["end"] = field
else:
args["end"] = None

return Range(**args)


def unmarshal_DedicatedConnection(data: Any) -> DedicatedConnection:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -123,6 +147,12 @@ def unmarshal_DedicatedConnection(data: Any) -> DedicatedConnection:
else:
args["demarcation_info"] = None

field = data.get("vlan_range", None)
if field is not None:
args["vlan_range"] = unmarshal_Range(field)
else:
args["vlan_range"] = None

return DedicatedConnection(**args)


Expand Down
11 changes: 11 additions & 0 deletions scaleway/scaleway/interlink/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ class BgpConfig:
"""


@dataclass
class Range:
start: int
end: int


@dataclass
class PartnerHost:
partner_id: str
Expand Down Expand Up @@ -230,6 +236,11 @@ class DedicatedConnection:
Demarcation details required by the data center to set up the supporting Cross Connect. This generally includes the physical space in the facility, the cabinet or rack the connection should land in, the patch panel to go in, the port designation, and the media type.
"""

vlan_range: Optional[Range] = None
"""
Range in which to pick vlan for self-hosted links on this dedicated connection. Both start & end are included. Any range defined here must be itself included in the greater allowed range of vlans from 1500 to 3899 (this range is hardware dependent and can change over time, but actual range will be enforced).
"""


@dataclass
class Link:
Expand Down