From 36307df766c46dc3696c30999539d86bc03ee594 Mon Sep 17 00:00:00 2001 From: Estelle Soulard Date: Thu, 26 Mar 2026 13:06:39 +0100 Subject: [PATCH] chore(container): handle deprecated_optional fields --- .../scaleway_async/container/v1beta1/api.py | 10 +++---- .../container/v1beta1/marshalling.py | 12 ++++---- .../scaleway_async/container/v1beta1/types.py | 28 +++++++++---------- scaleway/scaleway/container/v1beta1/api.py | 10 +++---- .../scaleway/container/v1beta1/marshalling.py | 12 ++++---- scaleway/scaleway/container/v1beta1/types.py | 28 +++++++++---------- 6 files changed, 48 insertions(+), 52 deletions(-) diff --git a/scaleway-async/scaleway_async/container/v1beta1/api.py b/scaleway-async/scaleway_async/container/v1beta1/api.py index fa0cf522f..3f75db9f2 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/api.py +++ b/scaleway-async/scaleway_async/container/v1beta1/api.py @@ -267,7 +267,6 @@ 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, @@ -275,11 +274,11 @@ async def create_namespace( description: Optional[str] = None, secret_environment_variables: Optional[list[Secret]] = None, tags: Optional[list[str]] = None, + activate_vpc_integration: Optional[bool] = None, ) -> Namespace: """ Create a new namespace. Create a new namespace in a specified region. - :param activate_vpc_integration: Setting this field to true doesn't matter anymore. It will be removed in a near future. :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. @@ -287,14 +286,13 @@ async def create_namespace( :param description: Description of the namespace to create. :param secret_environment_variables: Secret environment variables of the namespace to create. :param tags: Tags of the Serverless Container Namespace. + :param activate_vpc_integration: Setting this field to true doesn't matter anymore. It will be removed in a near future. :return: :class:`Namespace ` Usage: :: - result = await api.create_namespace( - activate_vpc_integration=False, - ) + result = await api.create_namespace() """ param_region = validate_path_param( @@ -306,7 +304,6 @@ 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, @@ -314,6 +311,7 @@ async def create_namespace( description=description, secret_environment_variables=secret_environment_variables, tags=tags, + activate_vpc_integration=activate_vpc_integration, ), self.client, ), diff --git a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py index ff8bb1cd5..c073fc2d6 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py @@ -563,12 +563,6 @@ def unmarshal_Namespace(data: Any) -> Namespace: else: args["tags"] = [] - field = data.get("vpc_integration_activated", None) - if field is not None: - args["vpc_integration_activated"] = field - else: - args["vpc_integration_activated"] = False - field = data.get("description", None) if field is not None: args["description"] = field @@ -587,6 +581,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) diff --git a/scaleway-async/scaleway_async/container/v1beta1/types.py b/scaleway-async/scaleway_async/container/v1beta1/types.py index 08e934001..6f645841b 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/types.py +++ b/scaleway-async/scaleway_async/container/v1beta1/types.py @@ -655,11 +655,6 @@ class Namespace: List of tags applied to the Serverless Container Namespace. """ - vpc_integration_activated: bool - """ - The value of this field doesn't matter anymore, and will be removed in a near future. - """ - error_message: Optional[str] = None """ Last error message of the namesace. @@ -680,6 +675,11 @@ class Namespace: Last update date of the namespace. """ + vpc_integration_activated: Optional[bool] = None + """ + The value of this field doesn't matter anymore, and will be removed in a near future. + """ + @dataclass class Token: @@ -693,14 +693,14 @@ class Token: Identifier of the token. """ - public_key: str + status: TokenStatus """ - Public key of the token. + Status of the token. """ - status: TokenStatus + public_key: Optional[str] = None """ - Status of the token. + Public key of the token. """ description: Optional[str] = None @@ -949,11 +949,6 @@ class CreateDomainRequest: @dataclass class CreateNamespaceRequest: - activate_vpc_integration: bool - """ - Setting this field to true doesn't matter anymore. It will be removed in a near future. - """ - region: Optional[ScwRegion] = None """ Region to target. If none is passed will use default region from the config. @@ -989,6 +984,11 @@ class CreateNamespaceRequest: Tags of the Serverless Container Namespace. """ + activate_vpc_integration: Optional[bool] = None + """ + Setting this field to true doesn't matter anymore. It will be removed in a near future. + """ + @dataclass class CreateTokenRequest: diff --git a/scaleway/scaleway/container/v1beta1/api.py b/scaleway/scaleway/container/v1beta1/api.py index 32ca5401f..2107b60d3 100644 --- a/scaleway/scaleway/container/v1beta1/api.py +++ b/scaleway/scaleway/container/v1beta1/api.py @@ -265,7 +265,6 @@ 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, @@ -273,11 +272,11 @@ def create_namespace( description: Optional[str] = None, secret_environment_variables: Optional[list[Secret]] = None, tags: Optional[list[str]] = None, + activate_vpc_integration: Optional[bool] = None, ) -> Namespace: """ Create a new namespace. Create a new namespace in a specified region. - :param activate_vpc_integration: Setting this field to true doesn't matter anymore. It will be removed in a near future. :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. @@ -285,14 +284,13 @@ def create_namespace( :param description: Description of the namespace to create. :param secret_environment_variables: Secret environment variables of the namespace to create. :param tags: Tags of the Serverless Container Namespace. + :param activate_vpc_integration: Setting this field to true doesn't matter anymore. It will be removed in a near future. :return: :class:`Namespace ` Usage: :: - result = api.create_namespace( - activate_vpc_integration=False, - ) + result = api.create_namespace() """ param_region = validate_path_param( @@ -304,7 +302,6 @@ 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, @@ -312,6 +309,7 @@ def create_namespace( description=description, secret_environment_variables=secret_environment_variables, tags=tags, + activate_vpc_integration=activate_vpc_integration, ), self.client, ), diff --git a/scaleway/scaleway/container/v1beta1/marshalling.py b/scaleway/scaleway/container/v1beta1/marshalling.py index ff8bb1cd5..c073fc2d6 100644 --- a/scaleway/scaleway/container/v1beta1/marshalling.py +++ b/scaleway/scaleway/container/v1beta1/marshalling.py @@ -563,12 +563,6 @@ def unmarshal_Namespace(data: Any) -> Namespace: else: args["tags"] = [] - field = data.get("vpc_integration_activated", None) - if field is not None: - args["vpc_integration_activated"] = field - else: - args["vpc_integration_activated"] = False - field = data.get("description", None) if field is not None: args["description"] = field @@ -587,6 +581,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) diff --git a/scaleway/scaleway/container/v1beta1/types.py b/scaleway/scaleway/container/v1beta1/types.py index 08e934001..6f645841b 100644 --- a/scaleway/scaleway/container/v1beta1/types.py +++ b/scaleway/scaleway/container/v1beta1/types.py @@ -655,11 +655,6 @@ class Namespace: List of tags applied to the Serverless Container Namespace. """ - vpc_integration_activated: bool - """ - The value of this field doesn't matter anymore, and will be removed in a near future. - """ - error_message: Optional[str] = None """ Last error message of the namesace. @@ -680,6 +675,11 @@ class Namespace: Last update date of the namespace. """ + vpc_integration_activated: Optional[bool] = None + """ + The value of this field doesn't matter anymore, and will be removed in a near future. + """ + @dataclass class Token: @@ -693,14 +693,14 @@ class Token: Identifier of the token. """ - public_key: str + status: TokenStatus """ - Public key of the token. + Status of the token. """ - status: TokenStatus + public_key: Optional[str] = None """ - Status of the token. + Public key of the token. """ description: Optional[str] = None @@ -949,11 +949,6 @@ class CreateDomainRequest: @dataclass class CreateNamespaceRequest: - activate_vpc_integration: bool - """ - Setting this field to true doesn't matter anymore. It will be removed in a near future. - """ - region: Optional[ScwRegion] = None """ Region to target. If none is passed will use default region from the config. @@ -989,6 +984,11 @@ class CreateNamespaceRequest: Tags of the Serverless Container Namespace. """ + activate_vpc_integration: Optional[bool] = None + """ + Setting this field to true doesn't matter anymore. It will be removed in a near future. + """ + @dataclass class CreateTokenRequest: