From 5bb5b0f4a2a1341be4547f187792ceed5aa2788a Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 8 Jul 2026 14:33:29 +0000 Subject: [PATCH] feat(product_catalog): add all serverless sub types in public and admin APIs --- .../scaleway_async/container/v1/__init__.py | 2 - .../scaleway_async/container/v1/api.py | 29 -- .../scaleway_async/container/v1/types.py | 8 - .../scaleway_async/container/v1beta1/api.py | 46 +++- .../product_catalog/v2alpha1/__init__.py | 18 ++ .../product_catalog/v2alpha1/marshalling.py | 251 ++++++++++++++++++ .../product_catalog/v2alpha1/types.py | 96 ++++++- scaleway/scaleway/container/v1/__init__.py | 2 - scaleway/scaleway/container/v1/api.py | 29 -- scaleway/scaleway/container/v1/types.py | 8 - scaleway/scaleway/container/v1beta1/api.py | 46 +++- .../product_catalog/v2alpha1/__init__.py | 18 ++ .../product_catalog/v2alpha1/marshalling.py | 251 ++++++++++++++++++ .../product_catalog/v2alpha1/types.py | 96 ++++++- 14 files changed, 814 insertions(+), 86 deletions(-) diff --git a/scaleway-async/scaleway_async/container/v1/__init__.py b/scaleway-async/scaleway_async/container/v1/__init__.py index 0aa584254..f346439b8 100644 --- a/scaleway-async/scaleway_async/container/v1/__init__.py +++ b/scaleway-async/scaleway_async/container/v1/__init__.py @@ -53,7 +53,6 @@ from .types import GetContainerRequest from .types import GetDomainRequest from .types import GetNamespaceRequest -from .types import GetServiceInfoRequest from .types import GetTriggerRequest from .types import ListContainersRequest from .types import ListContainersResponse @@ -124,7 +123,6 @@ "GetContainerRequest", "GetDomainRequest", "GetNamespaceRequest", - "GetServiceInfoRequest", "GetTriggerRequest", "ListContainersRequest", "ListContainersResponse", diff --git a/scaleway-async/scaleway_async/container/v1/api.py b/scaleway-async/scaleway_async/container/v1/api.py index d9280a90d..6eaceb4e7 100644 --- a/scaleway-async/scaleway_async/container/v1/api.py +++ b/scaleway-async/scaleway_async/container/v1/api.py @@ -6,8 +6,6 @@ from scaleway_core.api import API from scaleway_core.bridge import ( Region as ScwRegion, - ServiceInfo, - unmarshal_ServiceInfo, ) from scaleway_core.utils import ( WaitForOptions, @@ -83,33 +81,6 @@ class ContainerV1API(API): Easily run containers on the cloud with a single command. """ - async def get_service_info( - self, - *, - region: Optional[ScwRegion] = None, - ) -> ServiceInfo: - """ - :param region: Region to target. If none is passed will use default region from the config. - :return: :class:`ServiceInfo ` - - Usage: - :: - - result = await api.get_service_info() - """ - - param_region = validate_path_param( - "region", region or self.client.default_region - ) - - res = self._request( - "GET", - f"/containers/v1/regions/{param_region}", - ) - - self._throw_on_error(res) - return unmarshal_ServiceInfo(res.json()) - async def create_namespace( self, *, diff --git a/scaleway-async/scaleway_async/container/v1/types.py b/scaleway-async/scaleway_async/container/v1/types.py index cdccb7481..53bd38bd2 100644 --- a/scaleway-async/scaleway_async/container/v1/types.py +++ b/scaleway-async/scaleway_async/container/v1/types.py @@ -1162,14 +1162,6 @@ class GetNamespaceRequest: """ -@dataclass -class GetServiceInfoRequest: - region: Optional[ScwRegion] = None - """ - Region to target. If none is passed will use default region from the config. - """ - - @dataclass class GetTriggerRequest: trigger_id: str diff --git a/scaleway-async/scaleway_async/container/v1beta1/api.py b/scaleway-async/scaleway_async/container/v1beta1/api.py index 4aec43e70..188666553 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/api.py +++ b/scaleway-async/scaleway_async/container/v1beta1/api.py @@ -94,7 +94,11 @@ class ContainerV1Beta1API(API): """ - This API allows you to manage your Serverless Containers. + **[DEPRECATED]** This API is deprecated. Please use the [Serverless Containers API v1](https://www.scaleway.com/en/developers/api/serverless-containers/), + which provides the same capabilities and more, with improved performance and support for the latest features. + + Follow the [migration guide](https://www.scaleway.com/en/developers/api/serverless-containers/migration-guide/) to migrate your custom API integrations to the new v1 API. + Note that no redeployment or action is necessary to continue managing your existing containers; both APIs have access to the same resources. """ async def list_namespaces( @@ -119,6 +123,7 @@ async def list_namespaces( :param organization_id: UUID of the Organization the namespace belongs to. :param project_id: UUID of the Project the namespace belongs to. :return: :class:`ListNamespacesResponse ` + :deprecated Usage: :: @@ -169,6 +174,7 @@ async def list_namespaces_all( :param organization_id: UUID of the Organization the namespace belongs to. :param project_id: UUID of the Project the namespace belongs to. :return: :class:`list[Namespace] ` + :deprecated Usage: :: @@ -203,6 +209,7 @@ async def get_namespace( :param namespace_id: UUID of the namespace to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -240,6 +247,7 @@ async def wait_for_namespace( :param namespace_id: UUID of the namespace to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -288,6 +296,7 @@ async def create_namespace( :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 ` + :deprecated Usage: :: @@ -340,6 +349,7 @@ async def update_namespace( :param secret_environment_variables: Secret environment variables of the namespace to update. :param tags: Tags of the Serverless Container Namespace. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -385,6 +395,7 @@ async def delete_namespace( :param namespace_id: UUID of the namespace to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -431,6 +442,7 @@ async def list_containers( :param organization_id: UUID of the Organization the container belongs to. :param project_id: UUID of the Project the container belongs to. :return: :class:`ListContainersResponse ` + :deprecated Usage: :: @@ -486,6 +498,7 @@ async def list_containers_all( :param organization_id: UUID of the Organization the container belongs to. :param project_id: UUID of the Project the container belongs to. :return: :class:`list[Container] ` + :deprecated Usage: :: @@ -523,6 +536,7 @@ async def get_container( :param container_id: UUID of the container to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -560,6 +574,7 @@ async def wait_for_container( :param container_id: UUID of the container to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -650,6 +665,7 @@ async def create_container( :param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run. :param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters. :return: :class:`Container ` + :deprecated Usage: :: @@ -783,6 +799,7 @@ async def update_container( :param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run. :param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters. :return: :class:`Container ` + :deprecated Usage: :: @@ -847,6 +864,7 @@ async def delete_container( :param container_id: UUID of the container to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -885,6 +903,7 @@ async def deploy_container( :param container_id: UUID of the container to deploy. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -925,6 +944,7 @@ async def list_crons( :param page_size: Number of crons per page. :param order_by: Order of the crons. :return: :class:`ListCronsResponse ` + :deprecated Usage: :: @@ -969,6 +989,7 @@ async def list_crons_all( :param page_size: Number of crons per page. :param order_by: Order of the crons. :return: :class:`list[Cron] ` + :deprecated Usage: :: @@ -1003,6 +1024,7 @@ async def get_cron( :param cron_id: UUID of the cron to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1038,6 +1060,7 @@ async def wait_for_cron( :param cron_id: UUID of the cron to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1079,6 +1102,7 @@ async def create_cron( :param args: Arguments to pass with the cron. :param name: Name of the cron to create. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1131,6 +1155,7 @@ async def update_cron( :param args: Arguments to pass with the cron. :param name: Name of the cron. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1176,6 +1201,7 @@ async def delete_cron( :param cron_id: UUID of the cron to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1216,6 +1242,7 @@ async def list_domains( :param page_size: Number of domains per page. :param order_by: Order of the domains. :return: :class:`ListDomainsResponse ` + :deprecated Usage: :: @@ -1261,6 +1288,7 @@ async def list_domains_all( :param page_size: Number of domains per page. :param order_by: Order of the domains. :return: :class:`list[Domain] ` + :deprecated Usage: :: @@ -1295,6 +1323,7 @@ async def get_domain( :param domain_id: UUID of the domain to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1330,6 +1359,7 @@ async def wait_for_domain( :param domain_id: UUID of the domain to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1368,6 +1398,7 @@ async def create_domain( :param container_id: UUID of the container to assign the domain to. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1410,6 +1441,7 @@ async def delete_domain( :param domain_id: UUID of the domain to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1494,6 +1526,7 @@ async def get_token( :param token_id: UUID of the token to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1529,6 +1562,7 @@ async def wait_for_token( :param token_id: UUID of the token to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1573,6 +1607,7 @@ async def list_tokens( :param container_id: UUID of the container the token belongs to. :param namespace_id: UUID of the namespace the token belongs to. :return: :class:`ListTokensResponse ` + :deprecated Usage: :: @@ -1619,6 +1654,7 @@ async def list_tokens_all( :param container_id: UUID of the container the token belongs to. :param namespace_id: UUID of the namespace the token belongs to. :return: :class:`list[Token] ` + :deprecated Usage: :: @@ -1652,6 +1688,7 @@ async def delete_token( :param token_id: UUID of the token to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1699,6 +1736,7 @@ async def create_trigger( :param sqs_config: Configuration for an AWS SQS queue. One-Of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1745,6 +1783,7 @@ async def get_trigger( :param trigger_id: ID of the trigger to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1780,6 +1819,7 @@ async def wait_for_trigger( :param trigger_id: ID of the trigger to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1829,6 +1869,7 @@ async def list_triggers( :param project_id: ID of the project the triggers belongs to. One-Of ('scope'): at most one of 'container_id', 'namespace_id', 'project_id' could be set. :return: :class:`ListTriggersResponse ` + :deprecated Usage: :: @@ -1885,6 +1926,7 @@ async def list_triggers_all( :param project_id: ID of the project the triggers belongs to. One-Of ('scope'): at most one of 'container_id', 'namespace_id', 'project_id' could be set. :return: :class:`list[Trigger] ` + :deprecated Usage: :: @@ -1926,6 +1968,7 @@ async def update_trigger( :param sqs_config: Configuration for an AWS SQS queue. One-Of ('config'): at most one of 'sqs_config' could be set. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1970,6 +2013,7 @@ async def delete_trigger( :param trigger_id: ID of the trigger to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py index 5953461f6..d15e54f76 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py @@ -48,6 +48,15 @@ from .types import PublicCatalogProductPropertiesObjectStorageInternetTrafficType from .types import PublicCatalogProductPropertiesObjectStorageRegionTrafficType from .types import PublicCatalogProductPropertiesObjectStorageRestoreType +from .types import PublicCatalogProductPropertiesServerlessContainersCPUType +from .types import PublicCatalogProductPropertiesServerlessContainersMemoryType +from .types import PublicCatalogProductPropertiesServerlessFunctionsConsumptionType +from .types import PublicCatalogProductPropertiesServerlessFunctionsFreeTierType +from .types import PublicCatalogProductPropertiesServerlessFunctionsProvisionType +from .types import PublicCatalogProductPropertiesServerlessFunctionsRequestType +from .types import PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource +from .types import PublicCatalogProductPropertiesServerlessJobsCPUType +from .types import PublicCatalogProductPropertiesServerlessJobsMemoryType from .types import PublicCatalogProductPropertiesApacheKafka from .types import PublicCatalogProductPropertiesAppleSilicon from .types import PublicCatalogProductPropertiesBlockStorage @@ -120,6 +129,15 @@ "PublicCatalogProductPropertiesObjectStorageInternetTrafficType", "PublicCatalogProductPropertiesObjectStorageRegionTrafficType", "PublicCatalogProductPropertiesObjectStorageRestoreType", + "PublicCatalogProductPropertiesServerlessContainersCPUType", + "PublicCatalogProductPropertiesServerlessContainersMemoryType", + "PublicCatalogProductPropertiesServerlessFunctionsConsumptionType", + "PublicCatalogProductPropertiesServerlessFunctionsFreeTierType", + "PublicCatalogProductPropertiesServerlessFunctionsProvisionType", + "PublicCatalogProductPropertiesServerlessFunctionsRequestType", + "PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource", + "PublicCatalogProductPropertiesServerlessJobsCPUType", + "PublicCatalogProductPropertiesServerlessJobsMemoryType", "PublicCatalogProductPropertiesApacheKafka", "PublicCatalogProductPropertiesAppleSilicon", "PublicCatalogProductPropertiesBlockStorage", diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py index 28d495d0e..a7a87ad9f 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py @@ -43,6 +43,15 @@ PublicCatalogProductPropertiesObjectStorageInternetTrafficType, PublicCatalogProductPropertiesObjectStorageRegionTrafficType, PublicCatalogProductPropertiesObjectStorageRestoreType, + PublicCatalogProductPropertiesServerlessContainersCPUType, + PublicCatalogProductPropertiesServerlessContainersMemoryType, + PublicCatalogProductPropertiesServerlessFunctionsConsumptionType, + PublicCatalogProductPropertiesServerlessFunctionsFreeTierType, + PublicCatalogProductPropertiesServerlessFunctionsProvisionType, + PublicCatalogProductPropertiesServerlessFunctionsRequestType, + PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource, + PublicCatalogProductPropertiesServerlessJobsCPUType, + PublicCatalogProductPropertiesServerlessJobsMemoryType, PublicCatalogProductPropertiesApacheKafka, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesBlockStorage, @@ -635,6 +644,159 @@ def unmarshal_PublicCatalogProductPropertiesObjectStorageRestoreType( return PublicCatalogProductPropertiesObjectStorageRestoreType(**args) +def unmarshal_PublicCatalogProductPropertiesServerlessContainersCPUType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessContainersCPUType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessContainersCPUType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("mvcpu_counts", None) + if field is not None: + args["mvcpu_counts"] = field + else: + args["mvcpu_counts"] = [] + + return PublicCatalogProductPropertiesServerlessContainersCPUType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessContainersMemoryType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessContainersMemoryType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessContainersMemoryType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("sizes", None) + if field is not None: + args["sizes"] = field + else: + args["sizes"] = [] + + return PublicCatalogProductPropertiesServerlessContainersMemoryType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsConsumptionType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsConsumptionType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsConsumptionType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsConsumptionType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsFreeTierType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsFreeTierType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsFreeTierType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsFreeTierType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsProvisionType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsProvisionType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsProvisionType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsProvisionType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRequestType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsRequestType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsRequestType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsRequestType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("memory_size", None) + if field is not None: + args["memory_size"] = field + else: + args["memory_size"] = 0 + + field = data.get("mvcpu_count", None) + if field is not None: + args["mvcpu_count"] = field + else: + args["mvcpu_count"] = 0 + + return PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessJobsCPUType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessJobsCPUType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessJobsCPUType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("mvcpu_counts", None) + if field is not None: + args["mvcpu_counts"] = field + else: + args["mvcpu_counts"] = [] + + return PublicCatalogProductPropertiesServerlessJobsCPUType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessJobsMemoryType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessJobsMemoryType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessJobsMemoryType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("sizes", None) + if field is not None: + args["sizes"] = field + else: + args["sizes"] = [] + + return PublicCatalogProductPropertiesServerlessJobsMemoryType(**args) + + def unmarshal_PublicCatalogProductPropertiesApacheKafka( data: Any, ) -> PublicCatalogProductPropertiesApacheKafka: @@ -1191,6 +1353,24 @@ def unmarshal_PublicCatalogProductPropertiesServerlessContainers( args: dict[str, Any] = {} + field = data.get("memory", None) + if field is not None: + args["memory"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessContainersMemoryType( + field + ) + ) + else: + args["memory"] = None + + field = data.get("cpu", None) + if field is not None: + args["cpu"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessContainersCPUType(field) + ) + else: + args["cpu"] = None + return PublicCatalogProductPropertiesServerlessContainers(**args) @@ -1204,6 +1384,61 @@ def unmarshal_PublicCatalogProductPropertiesServerlessFunctions( args: dict[str, Any] = {} + field = data.get("resources", None) + if field is not None: + args["resources"] = ( + [ + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource( + v + ) + for v in field + ] + if field is not None + else None + ) + else: + args["resources"] = [] + + field = data.get("consumption", None) + if field is not None: + args["consumption"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsConsumptionType( + field + ) + ) + else: + args["consumption"] = None + + field = data.get("request", None) + if field is not None: + args["request"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRequestType( + field + ) + ) + else: + args["request"] = None + + field = data.get("provision", None) + if field is not None: + args["provision"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsProvisionType( + field + ) + ) + else: + args["provision"] = None + + field = data.get("free_tier", None) + if field is not None: + args["free_tier"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsFreeTierType( + field + ) + ) + else: + args["free_tier"] = None + return PublicCatalogProductPropertiesServerlessFunctions(**args) @@ -1217,6 +1452,22 @@ def unmarshal_PublicCatalogProductPropertiesServerlessJobs( args: dict[str, Any] = {} + field = data.get("memory", None) + if field is not None: + args["memory"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessJobsMemoryType(field) + ) + else: + args["memory"] = None + + field = data.get("cpu", None) + if field is not None: + args["cpu"] = unmarshal_PublicCatalogProductPropertiesServerlessJobsCPUType( + field + ) + else: + args["cpu"] = None + return PublicCatalogProductPropertiesServerlessJobs(**args) diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py index 1b7e700ae..715cbdc61 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py @@ -524,6 +524,71 @@ class PublicCatalogProductPropertiesObjectStorageRestoreType: """ +@dataclass +class PublicCatalogProductPropertiesServerlessContainersCPUType: + mvcpu_counts: list[int] + """ + The list of available number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessContainersMemoryType: + sizes: list[int] + """ + The list of available memory size in bytes. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsConsumptionType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsFreeTierType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsProvisionType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsRequestType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource: + memory_size: int + """ + The memory size in bytes. + """ + + mvcpu_count: int + """ + The number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessJobsCPUType: + mvcpu_counts: list[int] + """ + The list of available number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessJobsMemoryType: + sizes: list[int] + """ + The list of available memory size in bytes. + """ + + @dataclass class PublicCatalogProductPropertiesApacheKafka: pass @@ -741,17 +806,42 @@ class PublicCatalogProductPropertiesSecretManager: @dataclass class PublicCatalogProductPropertiesServerlessContainers: - pass + memory: Optional[PublicCatalogProductPropertiesServerlessContainersMemoryType] = ( + None + ) + + cpu: Optional[PublicCatalogProductPropertiesServerlessContainersCPUType] = None @dataclass class PublicCatalogProductPropertiesServerlessFunctions: - pass + resources: list[PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource] + """ + The serverless functions runtime resources sorted by memory size and then by milli-vCPU count. + """ + + consumption: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsConsumptionType + ] = None + + request: Optional[PublicCatalogProductPropertiesServerlessFunctionsRequestType] = ( + None + ) + + provision: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsProvisionType + ] = None + + free_tier: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsFreeTierType + ] = None @dataclass class PublicCatalogProductPropertiesServerlessJobs: - pass + memory: Optional[PublicCatalogProductPropertiesServerlessJobsMemoryType] = None + + cpu: Optional[PublicCatalogProductPropertiesServerlessJobsCPUType] = None @dataclass diff --git a/scaleway/scaleway/container/v1/__init__.py b/scaleway/scaleway/container/v1/__init__.py index 0aa584254..f346439b8 100644 --- a/scaleway/scaleway/container/v1/__init__.py +++ b/scaleway/scaleway/container/v1/__init__.py @@ -53,7 +53,6 @@ from .types import GetContainerRequest from .types import GetDomainRequest from .types import GetNamespaceRequest -from .types import GetServiceInfoRequest from .types import GetTriggerRequest from .types import ListContainersRequest from .types import ListContainersResponse @@ -124,7 +123,6 @@ "GetContainerRequest", "GetDomainRequest", "GetNamespaceRequest", - "GetServiceInfoRequest", "GetTriggerRequest", "ListContainersRequest", "ListContainersResponse", diff --git a/scaleway/scaleway/container/v1/api.py b/scaleway/scaleway/container/v1/api.py index 6d9399105..fc38c780f 100644 --- a/scaleway/scaleway/container/v1/api.py +++ b/scaleway/scaleway/container/v1/api.py @@ -6,8 +6,6 @@ from scaleway_core.api import API from scaleway_core.bridge import ( Region as ScwRegion, - ServiceInfo, - unmarshal_ServiceInfo, ) from scaleway_core.utils import ( WaitForOptions, @@ -83,33 +81,6 @@ class ContainerV1API(API): Easily run containers on the cloud with a single command. """ - def get_service_info( - self, - *, - region: Optional[ScwRegion] = None, - ) -> ServiceInfo: - """ - :param region: Region to target. If none is passed will use default region from the config. - :return: :class:`ServiceInfo ` - - Usage: - :: - - result = api.get_service_info() - """ - - param_region = validate_path_param( - "region", region or self.client.default_region - ) - - res = self._request( - "GET", - f"/containers/v1/regions/{param_region}", - ) - - self._throw_on_error(res) - return unmarshal_ServiceInfo(res.json()) - def create_namespace( self, *, diff --git a/scaleway/scaleway/container/v1/types.py b/scaleway/scaleway/container/v1/types.py index cdccb7481..53bd38bd2 100644 --- a/scaleway/scaleway/container/v1/types.py +++ b/scaleway/scaleway/container/v1/types.py @@ -1162,14 +1162,6 @@ class GetNamespaceRequest: """ -@dataclass -class GetServiceInfoRequest: - region: Optional[ScwRegion] = None - """ - Region to target. If none is passed will use default region from the config. - """ - - @dataclass class GetTriggerRequest: trigger_id: str diff --git a/scaleway/scaleway/container/v1beta1/api.py b/scaleway/scaleway/container/v1beta1/api.py index aaa321d43..d59e93fe9 100644 --- a/scaleway/scaleway/container/v1beta1/api.py +++ b/scaleway/scaleway/container/v1beta1/api.py @@ -94,7 +94,11 @@ class ContainerV1Beta1API(API): """ - This API allows you to manage your Serverless Containers. + **[DEPRECATED]** This API is deprecated. Please use the [Serverless Containers API v1](https://www.scaleway.com/en/developers/api/serverless-containers/), + which provides the same capabilities and more, with improved performance and support for the latest features. + + Follow the [migration guide](https://www.scaleway.com/en/developers/api/serverless-containers/migration-guide/) to migrate your custom API integrations to the new v1 API. + Note that no redeployment or action is necessary to continue managing your existing containers; both APIs have access to the same resources. """ def list_namespaces( @@ -119,6 +123,7 @@ def list_namespaces( :param organization_id: UUID of the Organization the namespace belongs to. :param project_id: UUID of the Project the namespace belongs to. :return: :class:`ListNamespacesResponse ` + :deprecated Usage: :: @@ -169,6 +174,7 @@ def list_namespaces_all( :param organization_id: UUID of the Organization the namespace belongs to. :param project_id: UUID of the Project the namespace belongs to. :return: :class:`list[Namespace] ` + :deprecated Usage: :: @@ -203,6 +209,7 @@ def get_namespace( :param namespace_id: UUID of the namespace to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -238,6 +245,7 @@ def wait_for_namespace( :param namespace_id: UUID of the namespace to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -286,6 +294,7 @@ def create_namespace( :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 ` + :deprecated Usage: :: @@ -338,6 +347,7 @@ def update_namespace( :param secret_environment_variables: Secret environment variables of the namespace to update. :param tags: Tags of the Serverless Container Namespace. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -383,6 +393,7 @@ def delete_namespace( :param namespace_id: UUID of the namespace to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Namespace ` + :deprecated Usage: :: @@ -429,6 +440,7 @@ def list_containers( :param organization_id: UUID of the Organization the container belongs to. :param project_id: UUID of the Project the container belongs to. :return: :class:`ListContainersResponse ` + :deprecated Usage: :: @@ -484,6 +496,7 @@ def list_containers_all( :param organization_id: UUID of the Organization the container belongs to. :param project_id: UUID of the Project the container belongs to. :return: :class:`list[Container] ` + :deprecated Usage: :: @@ -521,6 +534,7 @@ def get_container( :param container_id: UUID of the container to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -556,6 +570,7 @@ def wait_for_container( :param container_id: UUID of the container to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -646,6 +661,7 @@ def create_container( :param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run. :param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters. :return: :class:`Container ` + :deprecated Usage: :: @@ -779,6 +795,7 @@ def update_container( :param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run. :param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters. :return: :class:`Container ` + :deprecated Usage: :: @@ -843,6 +860,7 @@ def delete_container( :param container_id: UUID of the container to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -881,6 +899,7 @@ def deploy_container( :param container_id: UUID of the container to deploy. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Container ` + :deprecated Usage: :: @@ -921,6 +940,7 @@ def list_crons( :param page_size: Number of crons per page. :param order_by: Order of the crons. :return: :class:`ListCronsResponse ` + :deprecated Usage: :: @@ -965,6 +985,7 @@ def list_crons_all( :param page_size: Number of crons per page. :param order_by: Order of the crons. :return: :class:`list[Cron] ` + :deprecated Usage: :: @@ -999,6 +1020,7 @@ def get_cron( :param cron_id: UUID of the cron to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1034,6 +1056,7 @@ def wait_for_cron( :param cron_id: UUID of the cron to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1075,6 +1098,7 @@ def create_cron( :param args: Arguments to pass with the cron. :param name: Name of the cron to create. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1127,6 +1151,7 @@ def update_cron( :param args: Arguments to pass with the cron. :param name: Name of the cron. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1172,6 +1197,7 @@ def delete_cron( :param cron_id: UUID of the cron to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Cron ` + :deprecated Usage: :: @@ -1212,6 +1238,7 @@ def list_domains( :param page_size: Number of domains per page. :param order_by: Order of the domains. :return: :class:`ListDomainsResponse ` + :deprecated Usage: :: @@ -1257,6 +1284,7 @@ def list_domains_all( :param page_size: Number of domains per page. :param order_by: Order of the domains. :return: :class:`list[Domain] ` + :deprecated Usage: :: @@ -1291,6 +1319,7 @@ def get_domain( :param domain_id: UUID of the domain to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1326,6 +1355,7 @@ def wait_for_domain( :param domain_id: UUID of the domain to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1364,6 +1394,7 @@ def create_domain( :param container_id: UUID of the container to assign the domain to. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1406,6 +1437,7 @@ def delete_domain( :param domain_id: UUID of the domain to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Domain ` + :deprecated Usage: :: @@ -1490,6 +1522,7 @@ def get_token( :param token_id: UUID of the token to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1525,6 +1558,7 @@ def wait_for_token( :param token_id: UUID of the token to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1569,6 +1603,7 @@ def list_tokens( :param container_id: UUID of the container the token belongs to. :param namespace_id: UUID of the namespace the token belongs to. :return: :class:`ListTokensResponse ` + :deprecated Usage: :: @@ -1615,6 +1650,7 @@ def list_tokens_all( :param container_id: UUID of the container the token belongs to. :param namespace_id: UUID of the namespace the token belongs to. :return: :class:`list[Token] ` + :deprecated Usage: :: @@ -1648,6 +1684,7 @@ def delete_token( :param token_id: UUID of the token to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Token ` + :deprecated Usage: :: @@ -1695,6 +1732,7 @@ def create_trigger( :param sqs_config: Configuration for an AWS SQS queue. One-Of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1741,6 +1779,7 @@ def get_trigger( :param trigger_id: ID of the trigger to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1776,6 +1815,7 @@ def wait_for_trigger( :param trigger_id: ID of the trigger to get. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1825,6 +1865,7 @@ def list_triggers( :param project_id: ID of the project the triggers belongs to. One-Of ('scope'): at most one of 'container_id', 'namespace_id', 'project_id' could be set. :return: :class:`ListTriggersResponse ` + :deprecated Usage: :: @@ -1881,6 +1922,7 @@ def list_triggers_all( :param project_id: ID of the project the triggers belongs to. One-Of ('scope'): at most one of 'container_id', 'namespace_id', 'project_id' could be set. :return: :class:`list[Trigger] ` + :deprecated Usage: :: @@ -1922,6 +1964,7 @@ def update_trigger( :param sqs_config: Configuration for an AWS SQS queue. One-Of ('config'): at most one of 'sqs_config' could be set. :return: :class:`Trigger ` + :deprecated Usage: :: @@ -1966,6 +2009,7 @@ def delete_trigger( :param trigger_id: ID of the trigger to delete. :param region: Region to target. If none is passed will use default region from the config. :return: :class:`Trigger ` + :deprecated Usage: :: diff --git a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py index 5953461f6..d15e54f76 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py @@ -48,6 +48,15 @@ from .types import PublicCatalogProductPropertiesObjectStorageInternetTrafficType from .types import PublicCatalogProductPropertiesObjectStorageRegionTrafficType from .types import PublicCatalogProductPropertiesObjectStorageRestoreType +from .types import PublicCatalogProductPropertiesServerlessContainersCPUType +from .types import PublicCatalogProductPropertiesServerlessContainersMemoryType +from .types import PublicCatalogProductPropertiesServerlessFunctionsConsumptionType +from .types import PublicCatalogProductPropertiesServerlessFunctionsFreeTierType +from .types import PublicCatalogProductPropertiesServerlessFunctionsProvisionType +from .types import PublicCatalogProductPropertiesServerlessFunctionsRequestType +from .types import PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource +from .types import PublicCatalogProductPropertiesServerlessJobsCPUType +from .types import PublicCatalogProductPropertiesServerlessJobsMemoryType from .types import PublicCatalogProductPropertiesApacheKafka from .types import PublicCatalogProductPropertiesAppleSilicon from .types import PublicCatalogProductPropertiesBlockStorage @@ -120,6 +129,15 @@ "PublicCatalogProductPropertiesObjectStorageInternetTrafficType", "PublicCatalogProductPropertiesObjectStorageRegionTrafficType", "PublicCatalogProductPropertiesObjectStorageRestoreType", + "PublicCatalogProductPropertiesServerlessContainersCPUType", + "PublicCatalogProductPropertiesServerlessContainersMemoryType", + "PublicCatalogProductPropertiesServerlessFunctionsConsumptionType", + "PublicCatalogProductPropertiesServerlessFunctionsFreeTierType", + "PublicCatalogProductPropertiesServerlessFunctionsProvisionType", + "PublicCatalogProductPropertiesServerlessFunctionsRequestType", + "PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource", + "PublicCatalogProductPropertiesServerlessJobsCPUType", + "PublicCatalogProductPropertiesServerlessJobsMemoryType", "PublicCatalogProductPropertiesApacheKafka", "PublicCatalogProductPropertiesAppleSilicon", "PublicCatalogProductPropertiesBlockStorage", diff --git a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py index 28d495d0e..a7a87ad9f 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py @@ -43,6 +43,15 @@ PublicCatalogProductPropertiesObjectStorageInternetTrafficType, PublicCatalogProductPropertiesObjectStorageRegionTrafficType, PublicCatalogProductPropertiesObjectStorageRestoreType, + PublicCatalogProductPropertiesServerlessContainersCPUType, + PublicCatalogProductPropertiesServerlessContainersMemoryType, + PublicCatalogProductPropertiesServerlessFunctionsConsumptionType, + PublicCatalogProductPropertiesServerlessFunctionsFreeTierType, + PublicCatalogProductPropertiesServerlessFunctionsProvisionType, + PublicCatalogProductPropertiesServerlessFunctionsRequestType, + PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource, + PublicCatalogProductPropertiesServerlessJobsCPUType, + PublicCatalogProductPropertiesServerlessJobsMemoryType, PublicCatalogProductPropertiesApacheKafka, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesBlockStorage, @@ -635,6 +644,159 @@ def unmarshal_PublicCatalogProductPropertiesObjectStorageRestoreType( return PublicCatalogProductPropertiesObjectStorageRestoreType(**args) +def unmarshal_PublicCatalogProductPropertiesServerlessContainersCPUType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessContainersCPUType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessContainersCPUType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("mvcpu_counts", None) + if field is not None: + args["mvcpu_counts"] = field + else: + args["mvcpu_counts"] = [] + + return PublicCatalogProductPropertiesServerlessContainersCPUType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessContainersMemoryType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessContainersMemoryType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessContainersMemoryType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("sizes", None) + if field is not None: + args["sizes"] = field + else: + args["sizes"] = [] + + return PublicCatalogProductPropertiesServerlessContainersMemoryType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsConsumptionType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsConsumptionType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsConsumptionType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsConsumptionType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsFreeTierType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsFreeTierType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsFreeTierType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsFreeTierType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsProvisionType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsProvisionType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsProvisionType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsProvisionType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRequestType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsRequestType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsRequestType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessFunctionsRequestType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource( + data: Any, +) -> PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("memory_size", None) + if field is not None: + args["memory_size"] = field + else: + args["memory_size"] = 0 + + field = data.get("mvcpu_count", None) + if field is not None: + args["mvcpu_count"] = field + else: + args["mvcpu_count"] = 0 + + return PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessJobsCPUType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessJobsCPUType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessJobsCPUType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("mvcpu_counts", None) + if field is not None: + args["mvcpu_counts"] = field + else: + args["mvcpu_counts"] = [] + + return PublicCatalogProductPropertiesServerlessJobsCPUType(**args) + + +def unmarshal_PublicCatalogProductPropertiesServerlessJobsMemoryType( + data: Any, +) -> PublicCatalogProductPropertiesServerlessJobsMemoryType: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessJobsMemoryType' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("sizes", None) + if field is not None: + args["sizes"] = field + else: + args["sizes"] = [] + + return PublicCatalogProductPropertiesServerlessJobsMemoryType(**args) + + def unmarshal_PublicCatalogProductPropertiesApacheKafka( data: Any, ) -> PublicCatalogProductPropertiesApacheKafka: @@ -1191,6 +1353,24 @@ def unmarshal_PublicCatalogProductPropertiesServerlessContainers( args: dict[str, Any] = {} + field = data.get("memory", None) + if field is not None: + args["memory"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessContainersMemoryType( + field + ) + ) + else: + args["memory"] = None + + field = data.get("cpu", None) + if field is not None: + args["cpu"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessContainersCPUType(field) + ) + else: + args["cpu"] = None + return PublicCatalogProductPropertiesServerlessContainers(**args) @@ -1204,6 +1384,61 @@ def unmarshal_PublicCatalogProductPropertiesServerlessFunctions( args: dict[str, Any] = {} + field = data.get("resources", None) + if field is not None: + args["resources"] = ( + [ + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource( + v + ) + for v in field + ] + if field is not None + else None + ) + else: + args["resources"] = [] + + field = data.get("consumption", None) + if field is not None: + args["consumption"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsConsumptionType( + field + ) + ) + else: + args["consumption"] = None + + field = data.get("request", None) + if field is not None: + args["request"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsRequestType( + field + ) + ) + else: + args["request"] = None + + field = data.get("provision", None) + if field is not None: + args["provision"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsProvisionType( + field + ) + ) + else: + args["provision"] = None + + field = data.get("free_tier", None) + if field is not None: + args["free_tier"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessFunctionsFreeTierType( + field + ) + ) + else: + args["free_tier"] = None + return PublicCatalogProductPropertiesServerlessFunctions(**args) @@ -1217,6 +1452,22 @@ def unmarshal_PublicCatalogProductPropertiesServerlessJobs( args: dict[str, Any] = {} + field = data.get("memory", None) + if field is not None: + args["memory"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessJobsMemoryType(field) + ) + else: + args["memory"] = None + + field = data.get("cpu", None) + if field is not None: + args["cpu"] = unmarshal_PublicCatalogProductPropertiesServerlessJobsCPUType( + field + ) + else: + args["cpu"] = None + return PublicCatalogProductPropertiesServerlessJobs(**args) diff --git a/scaleway/scaleway/product_catalog/v2alpha1/types.py b/scaleway/scaleway/product_catalog/v2alpha1/types.py index 1b7e700ae..715cbdc61 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/types.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/types.py @@ -524,6 +524,71 @@ class PublicCatalogProductPropertiesObjectStorageRestoreType: """ +@dataclass +class PublicCatalogProductPropertiesServerlessContainersCPUType: + mvcpu_counts: list[int] + """ + The list of available number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessContainersMemoryType: + sizes: list[int] + """ + The list of available memory size in bytes. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsConsumptionType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsFreeTierType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsProvisionType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsRequestType: + pass + + +@dataclass +class PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource: + memory_size: int + """ + The memory size in bytes. + """ + + mvcpu_count: int + """ + The number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessJobsCPUType: + mvcpu_counts: list[int] + """ + The list of available number of milli-vCPUs. + """ + + +@dataclass +class PublicCatalogProductPropertiesServerlessJobsMemoryType: + sizes: list[int] + """ + The list of available memory size in bytes. + """ + + @dataclass class PublicCatalogProductPropertiesApacheKafka: pass @@ -741,17 +806,42 @@ class PublicCatalogProductPropertiesSecretManager: @dataclass class PublicCatalogProductPropertiesServerlessContainers: - pass + memory: Optional[PublicCatalogProductPropertiesServerlessContainersMemoryType] = ( + None + ) + + cpu: Optional[PublicCatalogProductPropertiesServerlessContainersCPUType] = None @dataclass class PublicCatalogProductPropertiesServerlessFunctions: - pass + resources: list[PublicCatalogProductPropertiesServerlessFunctionsRuntimeResource] + """ + The serverless functions runtime resources sorted by memory size and then by milli-vCPU count. + """ + + consumption: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsConsumptionType + ] = None + + request: Optional[PublicCatalogProductPropertiesServerlessFunctionsRequestType] = ( + None + ) + + provision: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsProvisionType + ] = None + + free_tier: Optional[ + PublicCatalogProductPropertiesServerlessFunctionsFreeTierType + ] = None @dataclass class PublicCatalogProductPropertiesServerlessJobs: - pass + memory: Optional[PublicCatalogProductPropertiesServerlessJobsMemoryType] = None + + cpu: Optional[PublicCatalogProductPropertiesServerlessJobsCPUType] = None @dataclass