From 8bc24f79ffc9efdcb72fd5ab0481a0f559322e4b Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 16 May 2025 15:01:52 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/container/v1beta1/api.py | 13 +++++++- .../container/v1beta1/marshalling.py | 33 +++++++++++++++---- .../scaleway_async/container/v1beta1/types.py | 20 ++++++++--- scaleway/scaleway/container/v1beta1/api.py | 13 +++++++- .../scaleway/container/v1beta1/marshalling.py | 33 +++++++++++++++---- scaleway/scaleway/container/v1beta1/types.py | 20 ++++++++--- 6 files changed, 108 insertions(+), 24 deletions(-) diff --git a/scaleway-async/scaleway_async/container/v1beta1/api.py b/scaleway-async/scaleway_async/container/v1beta1/api.py index 9e82e482e..b321bdbea 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/api.py +++ b/scaleway-async/scaleway_async/container/v1beta1/api.py @@ -267,6 +267,7 @@ async def wait_for_namespace( async def create_namespace( self, *, + activate_vpc_integration: bool, region: Optional[ScwRegion] = None, name: Optional[str] = None, environment_variables: Optional[Dict[str, str]] = None, @@ -278,6 +279,7 @@ async def create_namespace( """ Create a new namespace. Create a new namespace in a specified region. + :param activate_vpc_integration: :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the namespace to create. :param environment_variables: Environment variables of the namespace to create. @@ -290,7 +292,9 @@ async def create_namespace( Usage: :: - result = await api.create_namespace() + result = await api.create_namespace( + activate_vpc_integration=False, + ) """ param_region = validate_path_param( @@ -302,6 +306,7 @@ async def create_namespace( f"/containers/v1beta1/regions/{param_region}/namespaces", body=marshal_CreateNamespaceRequest( CreateNamespaceRequest( + activate_vpc_integration=activate_vpc_integration, region=region, name=name or random_name(prefix="cns"), environment_variables=environment_variables, @@ -606,6 +611,7 @@ async def create_container( scaling_option: Optional[ContainerScalingOption] = None, health_check: Optional[ContainerHealthCheckSpec] = None, tags: Optional[List[str]] = None, + private_network_id: Optional[str] = None, ) -> Container: """ Create a new container. @@ -637,6 +643,7 @@ async def create_container( - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :param tags: Tags of the Serverless Container. + :param private_network_id: :return: :class:`Container ` Usage: @@ -679,6 +686,7 @@ async def create_container( scaling_option=scaling_option, health_check=health_check, tags=tags, + private_network_id=private_network_id, ), self.client, ), @@ -712,6 +720,7 @@ async def update_container( scaling_option: Optional[ContainerScalingOption] = None, health_check: Optional[ContainerHealthCheckSpec] = None, tags: Optional[List[str]] = None, + private_network_id: Optional[str] = None, ) -> Container: """ Update an existing container. @@ -743,6 +752,7 @@ async def update_container( - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :param tags: Tags of the Serverless Container. + :param private_network_id: :return: :class:`Container ` Usage: @@ -785,6 +795,7 @@ async def update_container( scaling_option=scaling_option, health_check=health_check, tags=tags, + private_network_id=private_network_id, ), self.client, ), diff --git a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py index 95e0e5273..ce0bd5879 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py @@ -303,6 +303,12 @@ def unmarshal_Container(data: Any) -> Container: else: args["ready_at"] = None + field = data.get("private_network_id", None) + if field is not None: + args["private_network_id"] = field + else: + args["private_network_id"] = None + return Container(**args) @@ -416,6 +422,12 @@ def unmarshal_Namespace(data: Any) -> Namespace: if field is not None: args["registry_namespace_id"] = field + field = data.get("error_message", None) + if field is not None: + args["error_message"] = field + else: + args["error_message"] = None + field = data.get("registry_endpoint", None) if field is not None: args["registry_endpoint"] = field @@ -436,12 +448,6 @@ def unmarshal_Namespace(data: Any) -> Namespace: if field is not None: args["tags"] = field - field = data.get("error_message", None) - if field is not None: - args["error_message"] = field - else: - args["error_message"] = None - field = data.get("description", None) if field is not None: args["description"] = field @@ -460,6 +466,12 @@ def unmarshal_Namespace(data: Any) -> Namespace: else: args["updated_at"] = None + field = data.get("vpc_integration_activated", None) + if field is not None: + args["vpc_integration_activated"] = field + else: + args["vpc_integration_activated"] = None + return Namespace(**args) @@ -948,6 +960,9 @@ def marshal_CreateContainerRequest( if request.tags is not None: output["tags"] = request.tags + if request.private_network_id is not None: + output["private_network_id"] = request.private_network_id + return output @@ -993,6 +1008,9 @@ def marshal_CreateNamespaceRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + if request.name is not None: output["name"] = request.name @@ -1200,6 +1218,9 @@ def marshal_UpdateContainerRequest( if request.tags is not None: output["tags"] = request.tags + if request.private_network_id is not None: + output["private_network_id"] = request.private_network_id + return output diff --git a/scaleway-async/scaleway_async/container/v1beta1/types.py b/scaleway-async/scaleway_async/container/v1beta1/types.py index f4e775dcb..29d6cdfc5 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/types.py +++ b/scaleway-async/scaleway_async/container/v1beta1/types.py @@ -511,6 +511,8 @@ class Container: Last date when the container was successfully deployed and set to ready. """ + private_network_id: Optional[str] + @dataclass class Cron: @@ -615,6 +617,11 @@ class Namespace: UUID of the registry namespace. """ + error_message: Optional[str] + """ + Last error message of the namesace. + """ + registry_endpoint: str """ Registry endpoint of the namespace. @@ -635,11 +642,6 @@ class Namespace: List of tags applied to the Serverless Container Namespace. """ - error_message: Optional[str] - """ - Last error message of the namesace. - """ - description: Optional[str] """ Description of the endpoint. @@ -655,6 +657,8 @@ class Namespace: Last update date of the namespace. """ + vpc_integration_activated: Optional[bool] + @dataclass class Token: @@ -861,6 +865,8 @@ class CreateContainerRequest: Tags of the Serverless Container. """ + private_network_id: Optional[str] + @dataclass class CreateCronRequest: @@ -910,6 +916,8 @@ class CreateDomainRequest: @dataclass class CreateNamespaceRequest: + activate_vpc_integration: bool + region: Optional[ScwRegion] """ Region to target. If none is passed will use default region from the config. @@ -1545,6 +1553,8 @@ class UpdateContainerRequest: Tags of the Serverless Container. """ + private_network_id: Optional[str] + @dataclass class UpdateCronRequest: diff --git a/scaleway/scaleway/container/v1beta1/api.py b/scaleway/scaleway/container/v1beta1/api.py index c157950cc..d924c0f4a 100644 --- a/scaleway/scaleway/container/v1beta1/api.py +++ b/scaleway/scaleway/container/v1beta1/api.py @@ -265,6 +265,7 @@ def wait_for_namespace( def create_namespace( self, *, + activate_vpc_integration: bool, region: Optional[ScwRegion] = None, name: Optional[str] = None, environment_variables: Optional[Dict[str, str]] = None, @@ -276,6 +277,7 @@ def create_namespace( """ Create a new namespace. Create a new namespace in a specified region. + :param activate_vpc_integration: :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the namespace to create. :param environment_variables: Environment variables of the namespace to create. @@ -288,7 +290,9 @@ def create_namespace( Usage: :: - result = api.create_namespace() + result = api.create_namespace( + activate_vpc_integration=False, + ) """ param_region = validate_path_param( @@ -300,6 +304,7 @@ def create_namespace( f"/containers/v1beta1/regions/{param_region}/namespaces", body=marshal_CreateNamespaceRequest( CreateNamespaceRequest( + activate_vpc_integration=activate_vpc_integration, region=region, name=name or random_name(prefix="cns"), environment_variables=environment_variables, @@ -602,6 +607,7 @@ def create_container( scaling_option: Optional[ContainerScalingOption] = None, health_check: Optional[ContainerHealthCheckSpec] = None, tags: Optional[List[str]] = None, + private_network_id: Optional[str] = None, ) -> Container: """ Create a new container. @@ -633,6 +639,7 @@ def create_container( - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :param tags: Tags of the Serverless Container. + :param private_network_id: :return: :class:`Container ` Usage: @@ -675,6 +682,7 @@ def create_container( scaling_option=scaling_option, health_check=health_check, tags=tags, + private_network_id=private_network_id, ), self.client, ), @@ -708,6 +716,7 @@ def update_container( scaling_option: Optional[ContainerScalingOption] = None, health_check: Optional[ContainerHealthCheckSpec] = None, tags: Optional[List[str]] = None, + private_network_id: Optional[str] = None, ) -> Container: """ Update an existing container. @@ -739,6 +748,7 @@ def update_container( - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :param tags: Tags of the Serverless Container. + :param private_network_id: :return: :class:`Container ` Usage: @@ -781,6 +791,7 @@ def update_container( scaling_option=scaling_option, health_check=health_check, tags=tags, + private_network_id=private_network_id, ), self.client, ), diff --git a/scaleway/scaleway/container/v1beta1/marshalling.py b/scaleway/scaleway/container/v1beta1/marshalling.py index 95e0e5273..ce0bd5879 100644 --- a/scaleway/scaleway/container/v1beta1/marshalling.py +++ b/scaleway/scaleway/container/v1beta1/marshalling.py @@ -303,6 +303,12 @@ def unmarshal_Container(data: Any) -> Container: else: args["ready_at"] = None + field = data.get("private_network_id", None) + if field is not None: + args["private_network_id"] = field + else: + args["private_network_id"] = None + return Container(**args) @@ -416,6 +422,12 @@ def unmarshal_Namespace(data: Any) -> Namespace: if field is not None: args["registry_namespace_id"] = field + field = data.get("error_message", None) + if field is not None: + args["error_message"] = field + else: + args["error_message"] = None + field = data.get("registry_endpoint", None) if field is not None: args["registry_endpoint"] = field @@ -436,12 +448,6 @@ def unmarshal_Namespace(data: Any) -> Namespace: if field is not None: args["tags"] = field - field = data.get("error_message", None) - if field is not None: - args["error_message"] = field - else: - args["error_message"] = None - field = data.get("description", None) if field is not None: args["description"] = field @@ -460,6 +466,12 @@ def unmarshal_Namespace(data: Any) -> Namespace: else: args["updated_at"] = None + field = data.get("vpc_integration_activated", None) + if field is not None: + args["vpc_integration_activated"] = field + else: + args["vpc_integration_activated"] = None + return Namespace(**args) @@ -948,6 +960,9 @@ def marshal_CreateContainerRequest( if request.tags is not None: output["tags"] = request.tags + if request.private_network_id is not None: + output["private_network_id"] = request.private_network_id + return output @@ -993,6 +1008,9 @@ def marshal_CreateNamespaceRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + if request.name is not None: output["name"] = request.name @@ -1200,6 +1218,9 @@ def marshal_UpdateContainerRequest( if request.tags is not None: output["tags"] = request.tags + if request.private_network_id is not None: + output["private_network_id"] = request.private_network_id + return output diff --git a/scaleway/scaleway/container/v1beta1/types.py b/scaleway/scaleway/container/v1beta1/types.py index f4e775dcb..29d6cdfc5 100644 --- a/scaleway/scaleway/container/v1beta1/types.py +++ b/scaleway/scaleway/container/v1beta1/types.py @@ -511,6 +511,8 @@ class Container: Last date when the container was successfully deployed and set to ready. """ + private_network_id: Optional[str] + @dataclass class Cron: @@ -615,6 +617,11 @@ class Namespace: UUID of the registry namespace. """ + error_message: Optional[str] + """ + Last error message of the namesace. + """ + registry_endpoint: str """ Registry endpoint of the namespace. @@ -635,11 +642,6 @@ class Namespace: List of tags applied to the Serverless Container Namespace. """ - error_message: Optional[str] - """ - Last error message of the namesace. - """ - description: Optional[str] """ Description of the endpoint. @@ -655,6 +657,8 @@ class Namespace: Last update date of the namespace. """ + vpc_integration_activated: Optional[bool] + @dataclass class Token: @@ -861,6 +865,8 @@ class CreateContainerRequest: Tags of the Serverless Container. """ + private_network_id: Optional[str] + @dataclass class CreateCronRequest: @@ -910,6 +916,8 @@ class CreateDomainRequest: @dataclass class CreateNamespaceRequest: + activate_vpc_integration: bool + region: Optional[ScwRegion] """ Region to target. If none is passed will use default region from the config. @@ -1545,6 +1553,8 @@ class UpdateContainerRequest: Tags of the Serverless Container. """ + private_network_id: Optional[str] + @dataclass class UpdateCronRequest: