diff --git a/scaleway-async/scaleway_async/edge_services/v1beta1/__init__.py b/scaleway-async/scaleway_async/edge_services/v1beta1/__init__.py index a31ea0ab6..3af265d95 100644 --- a/scaleway-async/scaleway_async/edge_services/v1beta1/__init__.py +++ b/scaleway-async/scaleway_async/edge_services/v1beta1/__init__.py @@ -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 @@ -160,6 +161,7 @@ "RuleHttpMatchPathFilter", "ScalewayLbBackendConfig", "ScalewayS3BackendConfig", + "ScalewayServerlessContainerBackendConfig", "PipelineError", "TLSSecret", "RuleHttpMatch", diff --git a/scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py b/scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py index ac3e40817..dfbe36f89 100644 --- a/scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py @@ -23,6 +23,7 @@ ScalewayLb, ScalewayLbBackendConfig, ScalewayS3BackendConfig, + ScalewayServerlessContainerBackendConfig, BackendStage, CacheStage, DNSStage, @@ -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( @@ -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) diff --git a/scaleway-async/scaleway_async/edge_services/v1beta1/types.py b/scaleway-async/scaleway_async/edge_services/v1beta1/types.py index 37a2ae5bf..bde00a0de 100644 --- a/scaleway-async/scaleway_async/edge_services/v1beta1/types.py +++ b/scaleway-async/scaleway_async/edge_services/v1beta1/types.py @@ -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 @@ -399,6 +409,10 @@ class BackendStage: scaleway_lb: Optional[ScalewayLbBackendConfig] = None + scaleway_serverless_container: Optional[ + ScalewayServerlessContainerBackendConfig + ] = None + @dataclass class CacheStage: diff --git a/scaleway/scaleway/edge_services/v1beta1/__init__.py b/scaleway/scaleway/edge_services/v1beta1/__init__.py index a31ea0ab6..3af265d95 100644 --- a/scaleway/scaleway/edge_services/v1beta1/__init__.py +++ b/scaleway/scaleway/edge_services/v1beta1/__init__.py @@ -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 @@ -160,6 +161,7 @@ "RuleHttpMatchPathFilter", "ScalewayLbBackendConfig", "ScalewayS3BackendConfig", + "ScalewayServerlessContainerBackendConfig", "PipelineError", "TLSSecret", "RuleHttpMatch", diff --git a/scaleway/scaleway/edge_services/v1beta1/marshalling.py b/scaleway/scaleway/edge_services/v1beta1/marshalling.py index ac3e40817..dfbe36f89 100644 --- a/scaleway/scaleway/edge_services/v1beta1/marshalling.py +++ b/scaleway/scaleway/edge_services/v1beta1/marshalling.py @@ -23,6 +23,7 @@ ScalewayLb, ScalewayLbBackendConfig, ScalewayS3BackendConfig, + ScalewayServerlessContainerBackendConfig, BackendStage, CacheStage, DNSStage, @@ -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( @@ -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) diff --git a/scaleway/scaleway/edge_services/v1beta1/types.py b/scaleway/scaleway/edge_services/v1beta1/types.py index 37a2ae5bf..bde00a0de 100644 --- a/scaleway/scaleway/edge_services/v1beta1/types.py +++ b/scaleway/scaleway/edge_services/v1beta1/types.py @@ -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 @@ -399,6 +409,10 @@ class BackendStage: scaleway_lb: Optional[ScalewayLbBackendConfig] = None + scaleway_serverless_container: Optional[ + ScalewayServerlessContainerBackendConfig + ] = None + @dataclass class CacheStage: