From 8b10e434975916cd6d350a29c4b766f36d14bda0 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 14 Nov 2025 12:11:01 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/cockpit/v1/__init__.py | 8 ++ .../scaleway_async/cockpit/v1/api.py | 77 +++++++++++++++++++ .../scaleway_async/cockpit/v1/marshalling.py | 62 +++++++++++++++ .../scaleway_async/cockpit/v1/types.py | 55 +++++++++++++ .../product_catalog/v2alpha1/__init__.py | 2 + .../product_catalog/v2alpha1/marshalling.py | 28 +++++++ .../product_catalog/v2alpha1/types.py | 11 +++ .../scaleway_async/tem/v1alpha1/api.py | 2 +- scaleway/scaleway/cockpit/v1/__init__.py | 8 ++ scaleway/scaleway/cockpit/v1/api.py | 77 +++++++++++++++++++ scaleway/scaleway/cockpit/v1/marshalling.py | 62 +++++++++++++++ scaleway/scaleway/cockpit/v1/types.py | 55 +++++++++++++ .../product_catalog/v2alpha1/__init__.py | 2 + .../product_catalog/v2alpha1/marshalling.py | 28 +++++++ .../product_catalog/v2alpha1/types.py | 11 +++ scaleway/scaleway/tem/v1alpha1/api.py | 2 +- 16 files changed, 488 insertions(+), 2 deletions(-) diff --git a/scaleway-async/scaleway_async/cockpit/v1/__init__.py b/scaleway-async/scaleway_async/cockpit/v1/__init__.py index 42495d8e3..17d22f1c9 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/__init__.py +++ b/scaleway-async/scaleway_async/cockpit/v1/__init__.py @@ -8,6 +8,7 @@ from .types import ListDataSourcesRequestOrderBy from .types import ListGrafanaUsersRequestOrderBy from .types import ListPlansRequestOrderBy +from .types import ListProductsRequestOrderBy from .types import ListTokensRequestOrderBy from .types import PlanName from .types import TokenScope @@ -22,6 +23,7 @@ from .types import GrafanaProductDashboard from .types import GrafanaUser from .types import Plan +from .types import Product from .types import Token from .types import Usage from .types import AlertManager @@ -47,6 +49,7 @@ from .types import ListGrafanaProductDashboardsResponse from .types import ListGrafanaUsersResponse from .types import ListPlansResponse +from .types import ListProductsResponse from .types import ListTokensResponse from .types import RegionalApiCreateContactPointRequest from .types import RegionalApiCreateDataSourceRequest @@ -67,6 +70,7 @@ from .types import RegionalApiListAlertsRequest from .types import RegionalApiListContactPointsRequest from .types import RegionalApiListDataSourcesRequest +from .types import RegionalApiListProductsRequest from .types import RegionalApiListTokensRequest from .types import RegionalApiTriggerTestAlertRequest from .types import RegionalApiUpdateContactPointRequest @@ -84,6 +88,7 @@ "ListDataSourcesRequestOrderBy", "ListGrafanaUsersRequestOrderBy", "ListPlansRequestOrderBy", + "ListProductsRequestOrderBy", "ListTokensRequestOrderBy", "PlanName", "TokenScope", @@ -98,6 +103,7 @@ "GrafanaProductDashboard", "GrafanaUser", "Plan", + "Product", "Token", "Usage", "AlertManager", @@ -123,6 +129,7 @@ "ListGrafanaProductDashboardsResponse", "ListGrafanaUsersResponse", "ListPlansResponse", + "ListProductsResponse", "ListTokensResponse", "RegionalApiCreateContactPointRequest", "RegionalApiCreateDataSourceRequest", @@ -143,6 +150,7 @@ "RegionalApiListAlertsRequest", "RegionalApiListContactPointsRequest", "RegionalApiListDataSourcesRequest", + "RegionalApiListProductsRequest", "RegionalApiListTokensRequest", "RegionalApiTriggerTestAlertRequest", "RegionalApiUpdateContactPointRequest", diff --git a/scaleway-async/scaleway_async/cockpit/v1/api.py b/scaleway-async/scaleway_async/cockpit/v1/api.py index 9e9be7753..eb98c80c9 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/api.py +++ b/scaleway-async/scaleway_async/cockpit/v1/api.py @@ -20,6 +20,7 @@ ListDataSourcesRequestOrderBy, ListGrafanaUsersRequestOrderBy, ListPlansRequestOrderBy, + ListProductsRequestOrderBy, ListTokensRequestOrderBy, PlanName, TokenScope, @@ -44,8 +45,10 @@ ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + ListProductsResponse, ListTokensResponse, Plan, + Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, @@ -79,6 +82,7 @@ unmarshal_ListGrafanaProductDashboardsResponse, unmarshal_ListGrafanaUsersResponse, unmarshal_ListPlansResponse, + unmarshal_ListProductsResponse, unmarshal_ListTokensResponse, unmarshal_UsageOverview, marshal_GlobalApiCreateGrafanaUserRequest, @@ -1126,6 +1130,79 @@ async def delete_token( self._throw_on_error(res) + async def list_products( + self, + *, + region: Optional[ScwRegion] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + order_by: Optional[ListProductsRequestOrderBy] = None, + ) -> ListProductsResponse: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + :param region: Region to target. If none is passed will use default region from the config. + :param page: Page number to return from the paginated results. + :param page_size: Number of products to return per page. + :param order_by: Sort order for products in the response. + :return: :class:`ListProductsResponse ` + + Usage: + :: + + result = await api.list_products() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/cockpit/v1/regions/{param_region}/products", + params={ + "order_by": order_by, + "page": page, + "page_size": page_size or self.client.default_page_size, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListProductsResponse(res.json()) + + async def list_products_all( + self, + *, + region: Optional[ScwRegion] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + order_by: Optional[ListProductsRequestOrderBy] = None, + ) -> list[Product]: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + :param region: Region to target. If none is passed will use default region from the config. + :param page: Page number to return from the paginated results. + :param page_size: Number of products to return per page. + :param order_by: Sort order for products in the response. + :return: :class:`list[Product] ` + + Usage: + :: + + result = await api.list_products_all() + """ + + return await fetch_all_pages_async( + type=ListProductsResponse, + key="products_list", + fetcher=self.list_products, + args={ + "region": region, + "page": page, + "page_size": page_size, + "order_by": order_by, + }, + ) + async def get_alert_manager( self, *, diff --git a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py index f9e65477f..ba829fbbf 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py +++ b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py @@ -41,6 +41,8 @@ ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + Product, + ListProductsResponse, ListTokensResponse, Usage, UsageOverview, @@ -873,6 +875,66 @@ def unmarshal_ListPlansResponse(data: Any) -> ListPlansResponse: return ListPlansResponse(**args) +def unmarshal_Product(data: Any) -> Product: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Product' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + else: + args["name"] = None + + field = data.get("display_name", None) + if field is not None: + args["display_name"] = field + else: + args["display_name"] = None + + field = data.get("family_name", None) + if field is not None: + args["family_name"] = field + else: + args["family_name"] = None + + field = data.get("resource_types", None) + if field is not None: + args["resource_types"] = field + else: + args["resource_types"] = None + + return Product(**args) + + +def unmarshal_ListProductsResponse(data: Any) -> ListProductsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("products_list", None) + if field is not None: + args["products_list"] = ( + [unmarshal_Product(v) for v in field] if field is not None else None + ) + else: + args["products_list"] = None + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + else: + args["total_count"] = None + + return ListProductsResponse(**args) + + def unmarshal_ListTokensResponse(data: Any) -> ListTokensResponse: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway-async/scaleway_async/cockpit/v1/types.py b/scaleway-async/scaleway_async/cockpit/v1/types.py index c145d75d5..32d5aa9b0 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/types.py +++ b/scaleway-async/scaleway_async/cockpit/v1/types.py @@ -93,6 +93,18 @@ def __str__(self) -> str: return str(self.value) +class ListProductsRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + DISPLAY_NAME_ASC = "display_name_asc" + DISPLAY_NAME_DESC = "display_name_desc" + FAMILY_NAME_ASC = "family_name_asc" + FAMILY_NAME_DESC = "family_name_desc" + + def __str__(self) -> str: + return str(self.value) + + class ListTokensRequestOrderBy(str, Enum, metaclass=StrEnumMeta): CREATED_AT_ASC = "created_at_asc" CREATED_AT_DESC = "created_at_desc" @@ -444,6 +456,14 @@ class Plan: """ +@dataclass +class Product: + name: str + display_name: str + family_name: str + resource_types: list[str] + + @dataclass class Token: """ @@ -964,6 +984,12 @@ class ListPlansResponse: """ +@dataclass +class ListProductsResponse: + products_list: list[Product] + total_count: int + + @dataclass class ListTokensResponse: """ @@ -1382,6 +1408,35 @@ class RegionalApiListDataSourcesRequest: """ +@dataclass +class RegionalApiListProductsRequest: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + page: Optional[int] = 0 + """ + Page number to return from the paginated results. + """ + + page_size: Optional[int] = 0 + """ + Number of products to return per page. + """ + + order_by: Optional[ListProductsRequestOrderBy] = ( + ListProductsRequestOrderBy.CREATED_AT_ASC + ) + """ + Sort order for products in the response. + """ + + @dataclass class RegionalApiListTokensRequest: """ diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py index 18c07338f..46226ce1f 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py @@ -18,6 +18,7 @@ from .types import PublicCatalogProductPropertiesElasticMetal from .types import PublicCatalogProductPropertiesHardware from .types import PublicCatalogProductPropertiesInstance +from .types import PublicCatalogProductPropertiesManagedInference from .types import PublicCatalogProductPropertiesObjectStorage from .types import PublicCatalogProductEnvironmentalImpactEstimation from .types import PublicCatalogProductLocality @@ -48,6 +49,7 @@ "PublicCatalogProductPropertiesElasticMetal", "PublicCatalogProductPropertiesHardware", "PublicCatalogProductPropertiesInstance", + "PublicCatalogProductPropertiesManagedInference", "PublicCatalogProductPropertiesObjectStorage", "PublicCatalogProductEnvironmentalImpactEstimation", "PublicCatalogProductLocality", diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py index f4a9093eb..a77c9aed8 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py @@ -23,6 +23,7 @@ PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesInstance, + PublicCatalogProductPropertiesManagedInference, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, @@ -447,6 +448,25 @@ def unmarshal_PublicCatalogProductPropertiesInstance( return PublicCatalogProductPropertiesInstance(**args) +def unmarshal_PublicCatalogProductPropertiesManagedInference( + data: Any, +) -> PublicCatalogProductPropertiesManagedInference: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("instance_gpu_name", None) + if field is not None: + args["instance_gpu_name"] = field + else: + args["instance_gpu_name"] = None + + return PublicCatalogProductPropertiesManagedInference(**args) + + def unmarshal_PublicCatalogProductPropertiesObjectStorage( data: Any, ) -> PublicCatalogProductPropertiesObjectStorage: @@ -597,6 +617,14 @@ def unmarshal_PublicCatalogProductProperties( else: args["object_storage"] = None + field = data.get("managed_inference", None) + if field is not None: + args["managed_inference"] = ( + unmarshal_PublicCatalogProductPropertiesManagedInference(field) + ) + else: + args["managed_inference"] = None + return PublicCatalogProductProperties(**args) diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py index 3318b2d5a..a222d26f4 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py @@ -25,6 +25,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe DEDIBOX = "dedibox" BLOCK_STORAGE = "block_storage" OBJECT_STORAGE = "object_storage" + MANAGED_INFERENCE = "managed_inference" def __str__(self) -> str: return str(self.value) @@ -340,6 +341,14 @@ class PublicCatalogProductPropertiesInstance: """ +@dataclass +class PublicCatalogProductPropertiesManagedInference: + instance_gpu_name: str + """ + The name of the associated instance GPU to this node type. + """ + + @dataclass class PublicCatalogProductPropertiesObjectStorage: pass @@ -389,6 +398,8 @@ class PublicCatalogProductProperties: object_storage: Optional[PublicCatalogProductPropertiesObjectStorage] = None + managed_inference: Optional[PublicCatalogProductPropertiesManagedInference] = None + @dataclass class PublicCatalogProductUnitOfMeasure: diff --git a/scaleway-async/scaleway_async/tem/v1alpha1/api.py b/scaleway-async/scaleway_async/tem/v1alpha1/api.py index 8ac484f52..f576782d0 100644 --- a/scaleway-async/scaleway_async/tem/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/tem/v1alpha1/api.py @@ -117,7 +117,7 @@ async def create_email( ) -> CreateEmailResponse: """ Send an email. - You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters. + You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. :param from_: Sender information. Must be from a checked domain declared in the Project. :param subject: Subject of the email. :param text: Text content. diff --git a/scaleway/scaleway/cockpit/v1/__init__.py b/scaleway/scaleway/cockpit/v1/__init__.py index 42495d8e3..17d22f1c9 100644 --- a/scaleway/scaleway/cockpit/v1/__init__.py +++ b/scaleway/scaleway/cockpit/v1/__init__.py @@ -8,6 +8,7 @@ from .types import ListDataSourcesRequestOrderBy from .types import ListGrafanaUsersRequestOrderBy from .types import ListPlansRequestOrderBy +from .types import ListProductsRequestOrderBy from .types import ListTokensRequestOrderBy from .types import PlanName from .types import TokenScope @@ -22,6 +23,7 @@ from .types import GrafanaProductDashboard from .types import GrafanaUser from .types import Plan +from .types import Product from .types import Token from .types import Usage from .types import AlertManager @@ -47,6 +49,7 @@ from .types import ListGrafanaProductDashboardsResponse from .types import ListGrafanaUsersResponse from .types import ListPlansResponse +from .types import ListProductsResponse from .types import ListTokensResponse from .types import RegionalApiCreateContactPointRequest from .types import RegionalApiCreateDataSourceRequest @@ -67,6 +70,7 @@ from .types import RegionalApiListAlertsRequest from .types import RegionalApiListContactPointsRequest from .types import RegionalApiListDataSourcesRequest +from .types import RegionalApiListProductsRequest from .types import RegionalApiListTokensRequest from .types import RegionalApiTriggerTestAlertRequest from .types import RegionalApiUpdateContactPointRequest @@ -84,6 +88,7 @@ "ListDataSourcesRequestOrderBy", "ListGrafanaUsersRequestOrderBy", "ListPlansRequestOrderBy", + "ListProductsRequestOrderBy", "ListTokensRequestOrderBy", "PlanName", "TokenScope", @@ -98,6 +103,7 @@ "GrafanaProductDashboard", "GrafanaUser", "Plan", + "Product", "Token", "Usage", "AlertManager", @@ -123,6 +129,7 @@ "ListGrafanaProductDashboardsResponse", "ListGrafanaUsersResponse", "ListPlansResponse", + "ListProductsResponse", "ListTokensResponse", "RegionalApiCreateContactPointRequest", "RegionalApiCreateDataSourceRequest", @@ -143,6 +150,7 @@ "RegionalApiListAlertsRequest", "RegionalApiListContactPointsRequest", "RegionalApiListDataSourcesRequest", + "RegionalApiListProductsRequest", "RegionalApiListTokensRequest", "RegionalApiTriggerTestAlertRequest", "RegionalApiUpdateContactPointRequest", diff --git a/scaleway/scaleway/cockpit/v1/api.py b/scaleway/scaleway/cockpit/v1/api.py index 9094ea30b..a7de142e3 100644 --- a/scaleway/scaleway/cockpit/v1/api.py +++ b/scaleway/scaleway/cockpit/v1/api.py @@ -20,6 +20,7 @@ ListDataSourcesRequestOrderBy, ListGrafanaUsersRequestOrderBy, ListPlansRequestOrderBy, + ListProductsRequestOrderBy, ListTokensRequestOrderBy, PlanName, TokenScope, @@ -44,8 +45,10 @@ ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + ListProductsResponse, ListTokensResponse, Plan, + Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, @@ -79,6 +82,7 @@ unmarshal_ListGrafanaProductDashboardsResponse, unmarshal_ListGrafanaUsersResponse, unmarshal_ListPlansResponse, + unmarshal_ListProductsResponse, unmarshal_ListTokensResponse, unmarshal_UsageOverview, marshal_GlobalApiCreateGrafanaUserRequest, @@ -1126,6 +1130,79 @@ def delete_token( self._throw_on_error(res) + def list_products( + self, + *, + region: Optional[ScwRegion] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + order_by: Optional[ListProductsRequestOrderBy] = None, + ) -> ListProductsResponse: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + :param region: Region to target. If none is passed will use default region from the config. + :param page: Page number to return from the paginated results. + :param page_size: Number of products to return per page. + :param order_by: Sort order for products in the response. + :return: :class:`ListProductsResponse ` + + Usage: + :: + + result = api.list_products() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/cockpit/v1/regions/{param_region}/products", + params={ + "order_by": order_by, + "page": page, + "page_size": page_size or self.client.default_page_size, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListProductsResponse(res.json()) + + def list_products_all( + self, + *, + region: Optional[ScwRegion] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + order_by: Optional[ListProductsRequestOrderBy] = None, + ) -> list[Product]: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + :param region: Region to target. If none is passed will use default region from the config. + :param page: Page number to return from the paginated results. + :param page_size: Number of products to return per page. + :param order_by: Sort order for products in the response. + :return: :class:`list[Product] ` + + Usage: + :: + + result = api.list_products_all() + """ + + return fetch_all_pages( + type=ListProductsResponse, + key="products_list", + fetcher=self.list_products, + args={ + "region": region, + "page": page, + "page_size": page_size, + "order_by": order_by, + }, + ) + def get_alert_manager( self, *, diff --git a/scaleway/scaleway/cockpit/v1/marshalling.py b/scaleway/scaleway/cockpit/v1/marshalling.py index f9e65477f..ba829fbbf 100644 --- a/scaleway/scaleway/cockpit/v1/marshalling.py +++ b/scaleway/scaleway/cockpit/v1/marshalling.py @@ -41,6 +41,8 @@ ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + Product, + ListProductsResponse, ListTokensResponse, Usage, UsageOverview, @@ -873,6 +875,66 @@ def unmarshal_ListPlansResponse(data: Any) -> ListPlansResponse: return ListPlansResponse(**args) +def unmarshal_Product(data: Any) -> Product: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Product' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + else: + args["name"] = None + + field = data.get("display_name", None) + if field is not None: + args["display_name"] = field + else: + args["display_name"] = None + + field = data.get("family_name", None) + if field is not None: + args["family_name"] = field + else: + args["family_name"] = None + + field = data.get("resource_types", None) + if field is not None: + args["resource_types"] = field + else: + args["resource_types"] = None + + return Product(**args) + + +def unmarshal_ListProductsResponse(data: Any) -> ListProductsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("products_list", None) + if field is not None: + args["products_list"] = ( + [unmarshal_Product(v) for v in field] if field is not None else None + ) + else: + args["products_list"] = None + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + else: + args["total_count"] = None + + return ListProductsResponse(**args) + + def unmarshal_ListTokensResponse(data: Any) -> ListTokensResponse: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway/scaleway/cockpit/v1/types.py b/scaleway/scaleway/cockpit/v1/types.py index c145d75d5..32d5aa9b0 100644 --- a/scaleway/scaleway/cockpit/v1/types.py +++ b/scaleway/scaleway/cockpit/v1/types.py @@ -93,6 +93,18 @@ def __str__(self) -> str: return str(self.value) +class ListProductsRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + DISPLAY_NAME_ASC = "display_name_asc" + DISPLAY_NAME_DESC = "display_name_desc" + FAMILY_NAME_ASC = "family_name_asc" + FAMILY_NAME_DESC = "family_name_desc" + + def __str__(self) -> str: + return str(self.value) + + class ListTokensRequestOrderBy(str, Enum, metaclass=StrEnumMeta): CREATED_AT_ASC = "created_at_asc" CREATED_AT_DESC = "created_at_desc" @@ -444,6 +456,14 @@ class Plan: """ +@dataclass +class Product: + name: str + display_name: str + family_name: str + resource_types: list[str] + + @dataclass class Token: """ @@ -964,6 +984,12 @@ class ListPlansResponse: """ +@dataclass +class ListProductsResponse: + products_list: list[Product] + total_count: int + + @dataclass class ListTokensResponse: """ @@ -1382,6 +1408,35 @@ class RegionalApiListDataSourcesRequest: """ +@dataclass +class RegionalApiListProductsRequest: + """ + List all Scaleway products that send metrics and/or logs to Cockpit. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + page: Optional[int] = 0 + """ + Page number to return from the paginated results. + """ + + page_size: Optional[int] = 0 + """ + Number of products to return per page. + """ + + order_by: Optional[ListProductsRequestOrderBy] = ( + ListProductsRequestOrderBy.CREATED_AT_ASC + ) + """ + Sort order for products in the response. + """ + + @dataclass class RegionalApiListTokensRequest: """ diff --git a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py index 18c07338f..46226ce1f 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py @@ -18,6 +18,7 @@ from .types import PublicCatalogProductPropertiesElasticMetal from .types import PublicCatalogProductPropertiesHardware from .types import PublicCatalogProductPropertiesInstance +from .types import PublicCatalogProductPropertiesManagedInference from .types import PublicCatalogProductPropertiesObjectStorage from .types import PublicCatalogProductEnvironmentalImpactEstimation from .types import PublicCatalogProductLocality @@ -48,6 +49,7 @@ "PublicCatalogProductPropertiesElasticMetal", "PublicCatalogProductPropertiesHardware", "PublicCatalogProductPropertiesInstance", + "PublicCatalogProductPropertiesManagedInference", "PublicCatalogProductPropertiesObjectStorage", "PublicCatalogProductEnvironmentalImpactEstimation", "PublicCatalogProductLocality", diff --git a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py index f4a9093eb..a77c9aed8 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py @@ -23,6 +23,7 @@ PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesInstance, + PublicCatalogProductPropertiesManagedInference, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, @@ -447,6 +448,25 @@ def unmarshal_PublicCatalogProductPropertiesInstance( return PublicCatalogProductPropertiesInstance(**args) +def unmarshal_PublicCatalogProductPropertiesManagedInference( + data: Any, +) -> PublicCatalogProductPropertiesManagedInference: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("instance_gpu_name", None) + if field is not None: + args["instance_gpu_name"] = field + else: + args["instance_gpu_name"] = None + + return PublicCatalogProductPropertiesManagedInference(**args) + + def unmarshal_PublicCatalogProductPropertiesObjectStorage( data: Any, ) -> PublicCatalogProductPropertiesObjectStorage: @@ -597,6 +617,14 @@ def unmarshal_PublicCatalogProductProperties( else: args["object_storage"] = None + field = data.get("managed_inference", None) + if field is not None: + args["managed_inference"] = ( + unmarshal_PublicCatalogProductPropertiesManagedInference(field) + ) + else: + args["managed_inference"] = None + return PublicCatalogProductProperties(**args) diff --git a/scaleway/scaleway/product_catalog/v2alpha1/types.py b/scaleway/scaleway/product_catalog/v2alpha1/types.py index 3318b2d5a..a222d26f4 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/types.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/types.py @@ -25,6 +25,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe DEDIBOX = "dedibox" BLOCK_STORAGE = "block_storage" OBJECT_STORAGE = "object_storage" + MANAGED_INFERENCE = "managed_inference" def __str__(self) -> str: return str(self.value) @@ -340,6 +341,14 @@ class PublicCatalogProductPropertiesInstance: """ +@dataclass +class PublicCatalogProductPropertiesManagedInference: + instance_gpu_name: str + """ + The name of the associated instance GPU to this node type. + """ + + @dataclass class PublicCatalogProductPropertiesObjectStorage: pass @@ -389,6 +398,8 @@ class PublicCatalogProductProperties: object_storage: Optional[PublicCatalogProductPropertiesObjectStorage] = None + managed_inference: Optional[PublicCatalogProductPropertiesManagedInference] = None + @dataclass class PublicCatalogProductUnitOfMeasure: diff --git a/scaleway/scaleway/tem/v1alpha1/api.py b/scaleway/scaleway/tem/v1alpha1/api.py index 02d050d90..9785787c2 100644 --- a/scaleway/scaleway/tem/v1alpha1/api.py +++ b/scaleway/scaleway/tem/v1alpha1/api.py @@ -117,7 +117,7 @@ def create_email( ) -> CreateEmailResponse: """ Send an email. - You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters. + You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. :param from_: Sender information. Must be from a checked domain declared in the Project. :param subject: Subject of the email. :param text: Text content.