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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from .types import RuleHttpMatchPathFilter
from .types import ScalewayLbBackendConfig
from .types import ScalewayS3BackendConfig
from .types import ScalewayServerlessContainerBackendConfig
from .types import PipelineError
from .types import TLSSecret
from .types import RuleHttpMatch
Expand Down Expand Up @@ -160,6 +161,7 @@
"RuleHttpMatchPathFilter",
"ScalewayLbBackendConfig",
"ScalewayS3BackendConfig",
"ScalewayServerlessContainerBackendConfig",
"PipelineError",
"TLSSecret",
"RuleHttpMatch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ScalewayLb,
ScalewayLbBackendConfig,
ScalewayS3BackendConfig,
ScalewayServerlessContainerBackendConfig,
BackendStage,
CacheStage,
DNSStage,
Expand Down Expand Up @@ -187,6 +188,31 @@ def unmarshal_ScalewayS3BackendConfig(data: Any) -> ScalewayS3BackendConfig:
return ScalewayS3BackendConfig(**args)


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

args: dict[str, Any] = {}

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

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

return ScalewayServerlessContainerBackendConfig(**args)


def unmarshal_BackendStage(data: Any) -> BackendStage:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -231,6 +257,14 @@ def unmarshal_BackendStage(data: Any) -> BackendStage:
else:
args["scaleway_lb"] = None

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

return BackendStage(**args)


Expand Down
14 changes: 14 additions & 0 deletions scaleway-async/scaleway_async/edge_services/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@ class ScalewayS3BackendConfig:
"""


@dataclass
class ScalewayServerlessContainerBackendConfig:
region: ScwRegion
"""
Region to target. If none is passed will use default region from the config.
"""

container_id: str


@dataclass
class PipelineError:
stage: PipelineErrorStage
Expand Down Expand Up @@ -399,6 +409,10 @@ class BackendStage:

scaleway_lb: Optional[ScalewayLbBackendConfig] = None

scaleway_serverless_container: Optional[
ScalewayServerlessContainerBackendConfig
] = None


@dataclass
class CacheStage:
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from .types import RuleHttpMatchPathFilter
from .types import ScalewayLbBackendConfig
from .types import ScalewayS3BackendConfig
from .types import ScalewayServerlessContainerBackendConfig
from .types import PipelineError
from .types import TLSSecret
from .types import RuleHttpMatch
Expand Down Expand Up @@ -160,6 +161,7 @@
"RuleHttpMatchPathFilter",
"ScalewayLbBackendConfig",
"ScalewayS3BackendConfig",
"ScalewayServerlessContainerBackendConfig",
"PipelineError",
"TLSSecret",
"RuleHttpMatch",
Expand Down
34 changes: 34 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ScalewayLb,
ScalewayLbBackendConfig,
ScalewayS3BackendConfig,
ScalewayServerlessContainerBackendConfig,
BackendStage,
CacheStage,
DNSStage,
Expand Down Expand Up @@ -187,6 +188,31 @@ def unmarshal_ScalewayS3BackendConfig(data: Any) -> ScalewayS3BackendConfig:
return ScalewayS3BackendConfig(**args)


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

args: dict[str, Any] = {}

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

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

return ScalewayServerlessContainerBackendConfig(**args)


def unmarshal_BackendStage(data: Any) -> BackendStage:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -231,6 +257,14 @@ def unmarshal_BackendStage(data: Any) -> BackendStage:
else:
args["scaleway_lb"] = None

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

return BackendStage(**args)


Expand Down
14 changes: 14 additions & 0 deletions scaleway/scaleway/edge_services/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@ class ScalewayS3BackendConfig:
"""


@dataclass
class ScalewayServerlessContainerBackendConfig:
region: ScwRegion
"""
Region to target. If none is passed will use default region from the config.
"""

container_id: str


@dataclass
class PipelineError:
stage: PipelineErrorStage
Expand Down Expand Up @@ -399,6 +409,10 @@ class BackendStage:

scaleway_lb: Optional[ScalewayLbBackendConfig] = None

scaleway_serverless_container: Optional[
ScalewayServerlessContainerBackendConfig
] = None


@dataclass
class CacheStage:
Expand Down