diff --git a/scaleway-async/scaleway_async/function/v1beta1/api.py b/scaleway-async/scaleway_async/function/v1beta1/api.py index a5b36eeb4..cf47a7a5a 100644 --- a/scaleway-async/scaleway_async/function/v1beta1/api.py +++ b/scaleway-async/scaleway_async/function/v1beta1/api.py @@ -271,7 +271,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, @@ -279,11 +278,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 Organization or Project. - :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: :param environment_variables: Environment variables of the namespace. @@ -291,14 +290,13 @@ async def create_namespace( :param description: Description of the namespace. :param secret_environment_variables: Secret environment variables of the namespace. :param tags: Tags of the Serverless Function 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( @@ -310,7 +308,6 @@ async def create_namespace( f"/functions/v1beta1/regions/{param_region}/namespaces", body=marshal_CreateNamespaceRequest( CreateNamespaceRequest( - activate_vpc_integration=activate_vpc_integration, region=region, name=name or random_name(prefix="ns"), environment_variables=environment_variables, @@ -318,6 +315,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/function/v1beta1/marshalling.py b/scaleway-async/scaleway_async/function/v1beta1/marshalling.py index 18f25111e..daab533ee 100644 --- a/scaleway-async/scaleway_async/function/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/function/v1beta1/marshalling.py @@ -437,12 +437,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 @@ -461,6 +455,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) @@ -1114,9 +1114,6 @@ 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 @@ -1140,6 +1137,9 @@ def marshal_CreateNamespaceRequest( if request.tags is not None: output["tags"] = request.tags + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + return output diff --git a/scaleway-async/scaleway_async/function/v1beta1/types.py b/scaleway-async/scaleway_async/function/v1beta1/types.py index 5d3c4332a..e891ccb94 100644 --- a/scaleway-async/scaleway_async/function/v1beta1/types.py +++ b/scaleway-async/scaleway_async/function/v1beta1/types.py @@ -628,11 +628,6 @@ class Namespace: List of tags applied to the Serverless Function 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 """ Error message if the namespace is in "error" state. @@ -653,6 +648,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: @@ -666,14 +666,14 @@ class Token: String 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 @@ -875,11 +875,6 @@ class CreateFunctionRequest: @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. @@ -911,6 +906,11 @@ class CreateNamespaceRequest: Tags of the Serverless Function 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/function/v1beta1/api.py b/scaleway/scaleway/function/v1beta1/api.py index 32fd9dac0..8e80bc8fd 100644 --- a/scaleway/scaleway/function/v1beta1/api.py +++ b/scaleway/scaleway/function/v1beta1/api.py @@ -269,7 +269,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, @@ -277,11 +276,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 Organization or Project. - :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: :param environment_variables: Environment variables of the namespace. @@ -289,14 +288,13 @@ def create_namespace( :param description: Description of the namespace. :param secret_environment_variables: Secret environment variables of the namespace. :param tags: Tags of the Serverless Function 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( @@ -308,7 +306,6 @@ def create_namespace( f"/functions/v1beta1/regions/{param_region}/namespaces", body=marshal_CreateNamespaceRequest( CreateNamespaceRequest( - activate_vpc_integration=activate_vpc_integration, region=region, name=name or random_name(prefix="ns"), environment_variables=environment_variables, @@ -316,6 +313,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/function/v1beta1/marshalling.py b/scaleway/scaleway/function/v1beta1/marshalling.py index fac78836f..daab533ee 100644 --- a/scaleway/scaleway/function/v1beta1/marshalling.py +++ b/scaleway/scaleway/function/v1beta1/marshalling.py @@ -437,12 +437,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 @@ -461,6 +455,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/function/v1beta1/types.py b/scaleway/scaleway/function/v1beta1/types.py index 5d3c4332a..e891ccb94 100644 --- a/scaleway/scaleway/function/v1beta1/types.py +++ b/scaleway/scaleway/function/v1beta1/types.py @@ -628,11 +628,6 @@ class Namespace: List of tags applied to the Serverless Function 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 """ Error message if the namespace is in "error" state. @@ -653,6 +648,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: @@ -666,14 +666,14 @@ class Token: String 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 @@ -875,11 +875,6 @@ class CreateFunctionRequest: @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. @@ -911,6 +906,11 @@ class CreateNamespaceRequest: Tags of the Serverless Function 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: