From 0eff2174b31d278cc17e5ea032c3fdb827aa9103 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Mon, 17 Nov 2025 08:11:07 +0000 Subject: [PATCH] feat: update generated APIs --- .../src/v1alpha1/validation-rules.gen.ts | 2 +- packages_generated/cockpit/src/v1/api.gen.ts | 31 ++++++++++++++ .../cockpit/src/v1/index.gen.ts | 4 ++ .../cockpit/src/v1/marshalling.gen.ts | 32 ++++++++++++++ .../cockpit/src/v1/types.gen.ts | 42 +++++++++++++++++++ .../cockpit/src/v1/validation-rules.gen.ts | 11 +++++ .../product_catalog/src/v2alpha1/index.gen.ts | 1 + .../src/v2alpha1/marshalling.gen.ts | 20 +++++++++ .../product_catalog/src/v2alpha1/types.gen.ts | 26 +++++++++--- .../tem/src/v1alpha1/api.gen.ts | 2 +- .../tem/src/v1alpha1/validation-rules.gen.ts | 2 - 11 files changed, 163 insertions(+), 10 deletions(-) diff --git a/packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts b/packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts index 9b8993204..f06730de3 100644 --- a/packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts @@ -47,7 +47,7 @@ export const ListEventsRequest = { lessThanOrEqual: 1000, }, productName: { - pattern: /^[a-z]+(-[a-z]+)*$/, + pattern: /^[a-z0-9]+(-[a-z0-9]+)*$/, }, resourceId: { maxLength: 100, diff --git a/packages_generated/cockpit/src/v1/api.gen.ts b/packages_generated/cockpit/src/v1/api.gen.ts index d5c8f88ed..83c138e62 100644 --- a/packages_generated/cockpit/src/v1/api.gen.ts +++ b/packages_generated/cockpit/src/v1/api.gen.ts @@ -40,6 +40,7 @@ import { unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, + unmarshalListProductsResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, @@ -73,6 +74,7 @@ import type { ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + ListProductsResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, @@ -94,6 +96,7 @@ import type { RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, + RegionalApiListProductsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, @@ -627,6 +630,34 @@ You can filter tokens by Project ID and token scopes. path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`, }) + protected pageOfListProducts = ( + request: Readonly = {}, + ) => + this.client.fetch( + { + method: 'GET', + path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`, + urlParams: urlParams( + ['order_by', request.orderBy], + ['page', request.page], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ), + }, + unmarshalListProductsResponse, + ) + + /** + * List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit. + * + * @param request - The request {@link RegionalApiListProductsRequest} + * @returns A Promise of ListProductsResponse + */ + listProducts = (request: Readonly = {}) => + enrichForPagination('productsList', this.pageOfListProducts, request) + /** * Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled. The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled. diff --git a/packages_generated/cockpit/src/v1/index.gen.ts b/packages_generated/cockpit/src/v1/index.gen.ts index c6324d011..5c4c354af 100644 --- a/packages_generated/cockpit/src/v1/index.gen.ts +++ b/packages_generated/cockpit/src/v1/index.gen.ts @@ -44,11 +44,14 @@ export type { ListGrafanaUsersResponse, ListPlansRequestOrderBy, ListPlansResponse, + ListProductsRequestOrderBy, + ListProductsResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, PreconfiguredAlertData, + Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, @@ -68,6 +71,7 @@ export type { RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, + RegionalApiListProductsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, diff --git a/packages_generated/cockpit/src/v1/marshalling.gen.ts b/packages_generated/cockpit/src/v1/marshalling.gen.ts index db16524df..20403226c 100644 --- a/packages_generated/cockpit/src/v1/marshalling.gen.ts +++ b/packages_generated/cockpit/src/v1/marshalling.gen.ts @@ -31,9 +31,11 @@ import type { ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, + ListProductsResponse, ListTokensResponse, Plan, PreconfiguredAlertData, + Product, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, @@ -444,6 +446,36 @@ export const unmarshalListPlansResponse = ( } as ListPlansResponse } +const unmarshalProduct = (data: unknown): Product => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Product' failed as data isn't a dictionary.`, + ) + } + + return { + displayName: data.display_name, + familyName: data.family_name, + name: data.name, + resourceTypes: data.resource_types, + } as Product +} + +export const unmarshalListProductsResponse = ( + data: unknown, +): ListProductsResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`, + ) + } + + return { + productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct), + totalCount: data.total_count, + } as ListProductsResponse +} + export const unmarshalListTokensResponse = ( data: unknown, ): ListTokensResponse => { diff --git a/packages_generated/cockpit/src/v1/types.gen.ts b/packages_generated/cockpit/src/v1/types.gen.ts index 4e1f5e4e1..d6ba5bf46 100644 --- a/packages_generated/cockpit/src/v1/types.gen.ts +++ b/packages_generated/cockpit/src/v1/types.gen.ts @@ -33,6 +33,14 @@ export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc' export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc' +export type ListProductsRequestOrderBy = + | 'created_at_asc' + | 'created_at_desc' + | 'display_name_asc' + | 'display_name_desc' + | 'family_name_asc' + | 'family_name_desc' + export type ListTokensRequestOrderBy = | 'created_at_asc' | 'created_at_desc' @@ -308,6 +316,13 @@ export interface Plan { monthlyPrice: number } +export interface Product { + name: string + displayName: string + familyName: string + resourceTypes: string[] +} + /** * Token. */ @@ -732,6 +747,11 @@ export interface ListPlansResponse { plans: Plan[] } +export interface ListProductsResponse { + productsList: Product[] + totalCount: number +} + /** * Response returned when listing tokens. */ @@ -1082,6 +1102,28 @@ export type RegionalApiListDataSourcesRequest = { types?: DataSourceType[] } +/** + * List all Scaleway products that send metrics and/or logs to Cockpit. + */ +export type RegionalApiListProductsRequest = { + /** + * Region to target. If none is passed will use default region from the config. + */ + region?: ScwRegion + /** + * Page number to return from the paginated results. + */ + page?: number + /** + * Number of products to return per page. + */ + pageSize?: number + /** + * Sort order for products in the response. + */ + orderBy?: ListProductsRequestOrderBy +} + /** * List tokens. */ diff --git a/packages_generated/cockpit/src/v1/validation-rules.gen.ts b/packages_generated/cockpit/src/v1/validation-rules.gen.ts index 1a6562a47..20379e3b3 100644 --- a/packages_generated/cockpit/src/v1/validation-rules.gen.ts +++ b/packages_generated/cockpit/src/v1/validation-rules.gen.ts @@ -42,6 +42,17 @@ export const RegionalApiListDataSourcesRequest = { }, } +export const RegionalApiListProductsRequest = { + page: { + greaterThanOrEqual: 1, + lessThanOrEqual: 10000, + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100, + }, +} + export const RegionalApiListTokensRequest = { page: { greaterThanOrEqual: 1, diff --git a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts index bc976facd..b9e34ec01 100644 --- a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts @@ -26,6 +26,7 @@ export type { PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, + PublicCatalogProductPropertiesManagedInference, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductStatus, PublicCatalogProductUnitOfMeasure, diff --git a/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts b/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts index 9634d7be0..b685df534 100644 --- a/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts @@ -26,6 +26,7 @@ import type { PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, + PublicCatalogProductPropertiesManagedInference, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductUnitOfMeasure, } from './types.gen.js' @@ -255,6 +256,20 @@ const unmarshalPublicCatalogProductPropertiesInstance = ( } as PublicCatalogProductPropertiesInstance } +const unmarshalPublicCatalogProductPropertiesManagedInference = ( + data: unknown, +): PublicCatalogProductPropertiesManagedInference => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary.`, + ) + } + + return { + instanceGpuName: data.instance_gpu_name, + } as PublicCatalogProductPropertiesManagedInference +} + const unmarshalPublicCatalogProductPropertiesObjectStorage = ( data: unknown, ): PublicCatalogProductPropertiesObjectStorage => { @@ -343,6 +358,11 @@ const unmarshalPublicCatalogProductProperties = ( instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : undefined, + managedInference: data.managed_inference + ? unmarshalPublicCatalogProductPropertiesManagedInference( + data.managed_inference, + ) + : undefined, objectStorage: data.object_storage ? unmarshalPublicCatalogProductPropertiesObjectStorage( data.object_storage, diff --git a/packages_generated/product_catalog/src/v2alpha1/types.gen.ts b/packages_generated/product_catalog/src/v2alpha1/types.gen.ts index 9ac4ac29c..ab2f9bea3 100644 --- a/packages_generated/product_catalog/src/v2alpha1/types.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/types.gen.ts @@ -14,6 +14,7 @@ export type ListPublicCatalogProductsRequestProductType = | 'dedibox' | 'block_storage' | 'object_storage' + | 'managed_inference' export type ListPublicCatalogProductsRequestStatus = | 'unknown_status' @@ -279,6 +280,13 @@ export interface PublicCatalogProductPropertiesInstance { recommendedReplacementOfferIds: string[] } +export interface PublicCatalogProductPropertiesManagedInference { + /** + * The name of the associated instance GPU to this node type. + */ + instanceGpuName: string +} + export interface PublicCatalogProductPropertiesObjectStorage {} export interface PublicCatalogProductEnvironmentalImpactEstimation { @@ -328,39 +336,45 @@ export interface PublicCatalogProductProperties { /** * The properties of Dedibox products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ dedibox?: PublicCatalogProductPropertiesDedibox /** * The properties of Elastic Metal products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ elasticMetal?: PublicCatalogProductPropertiesElasticMetal /** * The properties of Apple Silicon products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ appleSilicon?: PublicCatalogProductPropertiesAppleSilicon /** * The properties of Instance products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ instance?: PublicCatalogProductPropertiesInstance /** * The properties of Block Storage products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ blockStorage?: PublicCatalogProductPropertiesBlockStorage /** * The properties of Object Storage products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. */ objectStorage?: PublicCatalogProductPropertiesObjectStorage + /** + * The properties of Managed Inference products. + * + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set. + */ + managedInference?: PublicCatalogProductPropertiesManagedInference } export interface PublicCatalogProductUnitOfMeasure { diff --git a/packages_generated/tem/src/v1alpha1/api.gen.ts b/packages_generated/tem/src/v1alpha1/api.gen.ts index 45d1cde3e..4ea7c7cb7 100644 --- a/packages_generated/tem/src/v1alpha1/api.gen.ts +++ b/packages_generated/tem/src/v1alpha1/api.gen.ts @@ -109,7 +109,7 @@ export class API extends ParentAPI { }) /** - * 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. + * 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. * * @param request - The request {@link CreateEmailRequest} * @returns A Promise of CreateEmailResponse diff --git a/packages_generated/tem/src/v1alpha1/validation-rules.gen.ts b/packages_generated/tem/src/v1alpha1/validation-rules.gen.ts index 56b0e6b09..716bbb2a1 100644 --- a/packages_generated/tem/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/tem/src/v1alpha1/validation-rules.gen.ts @@ -17,7 +17,6 @@ export const CreateDomainRequest = { export const CreateEmailRequest = { subject: { maxLength: 998, - minLength: 6, }, } @@ -90,7 +89,6 @@ export const ListEmailsRequest = { }, subject: { maxLength: 998, - minLength: 6, }, }