From 58b5ed7dbda22603a3bb6fb11d582b8e986e2eac Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 8 Apr 2025 07:59:43 +0000 Subject: [PATCH] feat: update generated APIs --- .../clients/src/api/baremetal/v1/types.gen.ts | 2 +- .../clients/src/api/dedibox/v1/types.gen.ts | 6 +- .../src/api/function/v1beta1/types.gen.ts | 12 +- .../clients/src/api/iam/v1alpha1/api.gen.ts | 4 +- packages/clients/src/api/index.gen.ts | 2 + .../src/api/inference/v1beta1/api.gen.ts | 2 +- .../src/api/interlink/v1beta1/api.gen.ts | 2 +- packages/clients/src/api/iot/v1/types.gen.ts | 2 +- .../src/api/mongodb/v1alpha1/types.gen.ts | 2 +- .../src/api/product_catalog/index.gen.ts | 6 + .../api/product_catalog/v2alpha1/api.gen.ts | 50 +++ .../api/product_catalog/v2alpha1/index.gen.ts | 27 ++ .../v2alpha1/marshalling.gen.ts | 354 ++++++++++++++++++ .../api/product_catalog/v2alpha1/types.gen.ts | 351 +++++++++++++++++ .../v2alpha1/validation-rules.gen.ts | 11 + .../src/api/qaas/v1alpha1/types.gen.ts | 4 +- packages/clients/src/api/rdb/v1/api.gen.ts | 2 +- packages/clients/src/api/rdb/v1/types.gen.ts | 4 +- packages/clients/src/api/redis/v1/api.gen.ts | 2 +- .../clients/src/api/registry/v1/types.gen.ts | 2 +- 20 files changed, 824 insertions(+), 23 deletions(-) create mode 100644 packages/clients/src/api/product_catalog/index.gen.ts create mode 100644 packages/clients/src/api/product_catalog/v2alpha1/api.gen.ts create mode 100644 packages/clients/src/api/product_catalog/v2alpha1/index.gen.ts create mode 100644 packages/clients/src/api/product_catalog/v2alpha1/marshalling.gen.ts create mode 100644 packages/clients/src/api/product_catalog/v2alpha1/types.gen.ts create mode 100644 packages/clients/src/api/product_catalog/v2alpha1/validation-rules.gen.ts diff --git a/packages/clients/src/api/baremetal/v1/types.gen.ts b/packages/clients/src/api/baremetal/v1/types.gen.ts index f3f55027c..ffd84be44 100644 --- a/packages/clients/src/api/baremetal/v1/types.gen.ts +++ b/packages/clients/src/api/baremetal/v1/types.gen.ts @@ -561,7 +561,7 @@ export interface Offer { */ commercialRange: string /** - * Price of the offer for the next 60 minutes (a server order at 11h32 will be payed until 12h32). + * Price of the offer for the next 60 minutes (a server order at 11h32 will be paid until 12h32). */ pricePerHour?: Money /** diff --git a/packages/clients/src/api/dedibox/v1/types.gen.ts b/packages/clients/src/api/dedibox/v1/types.gen.ts index b25d4d9f0..bf7019978 100644 --- a/packages/clients/src/api/dedibox/v1/types.gen.ts +++ b/packages/clients/src/api/dedibox/v1/types.gen.ts @@ -321,7 +321,7 @@ export interface OfferSANInfo { */ size: number /** - * High availabilty offer. + * High availability offer. */ ha: boolean /** @@ -562,11 +562,11 @@ export interface OS { */ panelPasswordRegex?: string /** - * If both requires_valid_hostname & hostname_regex are set, it means that at least one of the criterias must be valid. + * If both requires_valid_hostname & hostname_regex are set, it means that at least one of the criteria must be valid. */ requiresValidHostname?: boolean /** - * If both requires_valid_hostname & hostname_regex are set, it means that at least one of the criterias must be valid. + * If both requires_valid_hostname & hostname_regex are set, it means that at least one of the criteria must be valid. */ hostnameRegex?: string /** diff --git a/packages/clients/src/api/function/v1beta1/types.gen.ts b/packages/clients/src/api/function/v1beta1/types.gen.ts index 3c29b5f1e..caed29232 100644 --- a/packages/clients/src/api/function/v1beta1/types.gen.ts +++ b/packages/clients/src/api/function/v1beta1/types.gen.ts @@ -486,7 +486,7 @@ export interface Token { */ functionId?: string /** - * UUID of the namespace the token is assoicated with. + * UUID of the namespace the token is associated with. * * One-of ('scope'): at most one of 'functionId', 'namespaceId' could be set. */ @@ -619,7 +619,7 @@ export type CreateFunctionRequest = { */ environmentVariables?: Record /** - * Minumum number of instances to scale the function to. + * Minimum number of instances to scale the function to. */ minScale?: number /** @@ -981,7 +981,7 @@ export type ListDomainsRequest = { */ orderBy?: ListDomainsRequestOrderBy /** - * UUID of the function the domain is assoicated with. + * UUID of the function the domain is associated with. */ functionId: string } @@ -1041,7 +1041,7 @@ export type ListFunctionsRequest = { */ name?: string /** - * UUID of the Organziation the function belongs to. + * UUID of the Organization the function belongs to. */ organizationId?: string /** @@ -1118,7 +1118,7 @@ export type ListTokensRequest = { */ orderBy?: ListTokensRequestOrderBy /** - * UUID of the function the token is assoicated with. + * UUID of the function the token is associated with. */ functionId?: string /** @@ -1221,7 +1221,7 @@ export type UpdateFunctionRequest = { */ environmentVariables?: Record /** - * Minumum number of instances to scale the function to. + * Minimum number of instances to scale the function to. */ minScale?: number /** diff --git a/packages/clients/src/api/iam/v1alpha1/api.gen.ts b/packages/clients/src/api/iam/v1alpha1/api.gen.ts index 17a2795c6..44638d913 100644 --- a/packages/clients/src/api/iam/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/api.gen.ts @@ -651,7 +651,7 @@ export class API extends ParentAPI { ) /** - * Get a group. Retrive information about a given group, specified by the `group_id` parameter. The group's full details, including `user_ids` and `application_ids` are returned in the response. + * Get a group. Retrieve information about a given group, specified by the `group_id` parameter. The group's full details, including `user_ids` and `application_ids` are returned in the response. * * @param request - The request {@link GetGroupRequest} * @returns A Promise of Group @@ -1039,7 +1039,7 @@ export class API extends ParentAPI { ) /** - * Get an API key. Retrive information about an API key, specified by the `access_key` parameter. The API key's details, including either the `user_id` or `application_id` of its bearer are returned in the response. Note that the string value for the `secret_key` is nullable, and therefore is not displayed in the response. The `secret_key` value is only displayed upon API key creation. + * Get an API key. Retrieve information about an API key, specified by the `access_key` parameter. The API key's details, including either the `user_id` or `application_id` of its bearer are returned in the response. Note that the string value for the `secret_key` is nullable, and therefore is not displayed in the response. The `secret_key` value is only displayed upon API key creation. * * @param request - The request {@link GetAPIKeyRequest} * @returns A Promise of APIKey diff --git a/packages/clients/src/api/index.gen.ts b/packages/clients/src/api/index.gen.ts index 9ad0f77af..5e47484ee 100644 --- a/packages/clients/src/api/index.gen.ts +++ b/packages/clients/src/api/index.gen.ts @@ -32,6 +32,7 @@ import * as LlmInference from './llm_inference/index.gen' import * as Marketplace from './marketplace/index.gen' import * as Mnq from './mnq/index.gen' import * as Mongodb from './mongodb/index.gen' +import * as ProductCatalog from './product_catalog/index.gen' import * as Qaas from './qaas/index.gen' import * as Rdb from './rdb/index.gen' import * as Redis from './redis/index.gen' @@ -75,6 +76,7 @@ export { Marketplace, Mnq, Mongodb, + ProductCatalog, Qaas, Rdb, Redis, diff --git a/packages/clients/src/api/inference/v1beta1/api.gen.ts b/packages/clients/src/api/inference/v1beta1/api.gen.ts index fb0337979..810321f83 100644 --- a/packages/clients/src/api/inference/v1beta1/api.gen.ts +++ b/packages/clients/src/api/inference/v1beta1/api.gen.ts @@ -324,7 +324,7 @@ The CA certificate will be returned as a PEM file. ) /** - * Delete an exising ACL. + * Delete an existing ACL. * * @param request - The request {@link DeleteDeploymentACLRuleRequest} */ diff --git a/packages/clients/src/api/interlink/v1beta1/api.gen.ts b/packages/clients/src/api/interlink/v1beta1/api.gen.ts index 2b15f7bc3..a8deadb3e 100644 --- a/packages/clients/src/api/interlink/v1beta1/api.gen.ts +++ b/packages/clients/src/api/interlink/v1beta1/api.gen.ts @@ -331,7 +331,7 @@ export class API extends ParentAPI { ) /** - * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (faciliated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection). + * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection). * * @param request - The request {@link CreateLinkRequest} * @returns A Promise of Link diff --git a/packages/clients/src/api/iot/v1/types.gen.ts b/packages/clients/src/api/iot/v1/types.gen.ts index 49edda646..141d1af23 100644 --- a/packages/clients/src/api/iot/v1/types.gen.ts +++ b/packages/clients/src/api/iot/v1/types.gen.ts @@ -851,7 +851,7 @@ export type ListDevicesRequest = { */ hubId?: string /** - * Defines wheter to filter the allow_insecure flag. + * Defines whether to filter the allow_insecure flag. */ allowInsecure?: boolean /** diff --git a/packages/clients/src/api/mongodb/v1alpha1/types.gen.ts b/packages/clients/src/api/mongodb/v1alpha1/types.gen.ts index 93c68dd4a..cbe2ded3d 100644 --- a/packages/clients/src/api/mongodb/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/mongodb/v1alpha1/types.gen.ts @@ -141,7 +141,7 @@ export interface NodeTypeVolumeType { */ description: string /** - * Mimimum size required for the volume. + * Minimum size required for the volume. */ minSize: number /** diff --git a/packages/clients/src/api/product_catalog/index.gen.ts b/packages/clients/src/api/product_catalog/index.gen.ts new file mode 100644 index 000000000..36dc2b2b7 --- /dev/null +++ b/packages/clients/src/api/product_catalog/index.gen.ts @@ -0,0 +1,6 @@ +/** + * This file is automatically generated from /scripts/generate.js + * PLEASE DO NOT EDIT HERE + */ + +export * as v2alpha1 from './v2alpha1/index.gen' diff --git a/packages/clients/src/api/product_catalog/v2alpha1/api.gen.ts b/packages/clients/src/api/product_catalog/v2alpha1/api.gen.ts new file mode 100644 index 000000000..351a06b69 --- /dev/null +++ b/packages/clients/src/api/product_catalog/v2alpha1/api.gen.ts @@ -0,0 +1,50 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +import { + API as ParentAPI, + enrichForPagination, + urlParams, +} from '@scaleway/sdk-client' +import { unmarshalListPublicCatalogProductsResponse } from './marshalling.gen' +import type { + ListPublicCatalogProductsResponse, + PublicCatalogApiListPublicCatalogProductsRequest, +} from './types.gen' + +/** + * Product Catalog API. + */ +export class PublicCatalogAPI extends ParentAPI { + protected pageOfListPublicCatalogProducts = ( + request: Readonly = {}, + ) => + this.client.fetch( + { + method: 'GET', + path: `/product-catalog/v2alpha1/public-catalog/products`, + urlParams: urlParams( + ['page', request.page], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ), + }, + unmarshalListPublicCatalogProductsResponse, + ) + + /** + * List all available products. List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request. + * + * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest} + * @returns A Promise of ListPublicCatalogProductsResponse + */ + listPublicCatalogProducts = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'products', + this.pageOfListPublicCatalogProducts, + request, + ) +} diff --git a/packages/clients/src/api/product_catalog/v2alpha1/index.gen.ts b/packages/clients/src/api/product_catalog/v2alpha1/index.gen.ts new file mode 100644 index 000000000..b94d747c0 --- /dev/null +++ b/packages/clients/src/api/product_catalog/v2alpha1/index.gen.ts @@ -0,0 +1,27 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +export { PublicCatalogAPI } from './api.gen' +export type { + ListPublicCatalogProductsResponse, + PublicCatalogApiListPublicCatalogProductsRequest, + PublicCatalogProduct, + PublicCatalogProductLocality, + PublicCatalogProductPrice, + PublicCatalogProductPriceUnitOfMeasure, + PublicCatalogProductPriceUnitOfMeasureCountableUnit, + PublicCatalogProductProperties, + PublicCatalogProductPropertiesAppleSilicon, + PublicCatalogProductPropertiesDedibox, + PublicCatalogProductPropertiesElasticMetal, + PublicCatalogProductPropertiesHardware, + PublicCatalogProductPropertiesHardwareCPU, + PublicCatalogProductPropertiesHardwareCPUArch, + PublicCatalogProductPropertiesHardwareCPUPhysical, + PublicCatalogProductPropertiesHardwareCPUVirtual, + PublicCatalogProductPropertiesHardwareGPU, + PublicCatalogProductPropertiesHardwareNetwork, + PublicCatalogProductPropertiesHardwareRAM, + PublicCatalogProductPropertiesHardwareStorage, + PublicCatalogProductPropertiesInstance, +} from './types.gen' +export * as ValidationRules from './validation-rules.gen' diff --git a/packages/clients/src/api/product_catalog/v2alpha1/marshalling.gen.ts b/packages/clients/src/api/product_catalog/v2alpha1/marshalling.gen.ts new file mode 100644 index 000000000..5ebc6ee81 --- /dev/null +++ b/packages/clients/src/api/product_catalog/v2alpha1/marshalling.gen.ts @@ -0,0 +1,354 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalMoney, +} from '@scaleway/sdk-client' +import type { + ListPublicCatalogProductsResponse, + PublicCatalogProduct, + PublicCatalogProductLocality, + PublicCatalogProductPrice, + PublicCatalogProductPriceUnitOfMeasure, + PublicCatalogProductProperties, + PublicCatalogProductPropertiesAppleSilicon, + PublicCatalogProductPropertiesDedibox, + PublicCatalogProductPropertiesElasticMetal, + PublicCatalogProductPropertiesHardware, + PublicCatalogProductPropertiesHardwareCPU, + PublicCatalogProductPropertiesHardwareCPUPhysical, + PublicCatalogProductPropertiesHardwareCPUVirtual, + PublicCatalogProductPropertiesHardwareGPU, + PublicCatalogProductPropertiesHardwareNetwork, + PublicCatalogProductPropertiesHardwareRAM, + PublicCatalogProductPropertiesHardwareStorage, + PublicCatalogProductPropertiesInstance, +} from './types.gen' + +const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPUPhysical => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`, + ) + } + + return { + benchmark: data.benchmark, + coresPerSocket: data.cores_per_socket, + frequency: data.frequency, + sockets: data.sockets, + threadsPerCore: data.threads_per_core, + } as PublicCatalogProductPropertiesHardwareCPUPhysical +} + +const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPUVirtual => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`, + ) + } + + return { + count: data.count, + } as PublicCatalogProductPropertiesHardwareCPUVirtual +} + +const unmarshalPublicCatalogProductPropertiesHardwareCPU = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPU => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`, + ) + } + + return { + arch: data.arch, + description: data.description, + physical: data.physical + ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical( + data.physical, + ) + : undefined, + threads: data.threads, + type: data.type, + virtual: data.virtual + ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) + : undefined, + } as PublicCatalogProductPropertiesHardwareCPU +} + +const unmarshalPublicCatalogProductPropertiesHardwareGPU = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareGPU => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`, + ) + } + + return { + count: data.count, + description: data.description, + type: data.type, + } as PublicCatalogProductPropertiesHardwareGPU +} + +const unmarshalPublicCatalogProductPropertiesHardwareNetwork = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareNetwork => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`, + ) + } + + return { + description: data.description, + internalBandwidth: data.internal_bandwidth, + maxPublicBandwidth: data.max_public_bandwidth, + publicBandwidth: data.public_bandwidth, + } as PublicCatalogProductPropertiesHardwareNetwork +} + +const unmarshalPublicCatalogProductPropertiesHardwareRAM = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareRAM => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`, + ) + } + + return { + description: data.description, + size: data.size, + type: data.type, + } as PublicCatalogProductPropertiesHardwareRAM +} + +const unmarshalPublicCatalogProductPropertiesHardwareStorage = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareStorage => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`, + ) + } + + return { + description: data.description, + total: data.total, + } as PublicCatalogProductPropertiesHardwareStorage +} + +const unmarshalPublicCatalogProductPriceUnitOfMeasure = ( + data: unknown, +): PublicCatalogProductPriceUnitOfMeasure => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPriceUnitOfMeasure' failed as data isn't a dictionary.`, + ) + } + + return { + size: data.size, + unit: data.unit, + } as PublicCatalogProductPriceUnitOfMeasure +} + +const unmarshalPublicCatalogProductPropertiesAppleSilicon = ( + data: unknown, +): PublicCatalogProductPropertiesAppleSilicon => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`, + ) + } + + return { + range: data.range, + } as PublicCatalogProductPropertiesAppleSilicon +} + +const unmarshalPublicCatalogProductPropertiesDedibox = ( + data: unknown, +): PublicCatalogProductPropertiesDedibox => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`, + ) + } + + return { + range: data.range, + } as PublicCatalogProductPropertiesDedibox +} + +const unmarshalPublicCatalogProductPropertiesElasticMetal = ( + data: unknown, +): PublicCatalogProductPropertiesElasticMetal => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`, + ) + } + + return { + range: data.range, + } as PublicCatalogProductPropertiesElasticMetal +} + +const unmarshalPublicCatalogProductPropertiesHardware = ( + data: unknown, +): PublicCatalogProductPropertiesHardware => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`, + ) + } + + return { + cpu: data.cpu + ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) + : undefined, + gpu: data.gpu + ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) + : undefined, + network: data.network + ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) + : undefined, + ram: data.ram + ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) + : undefined, + storage: data.storage + ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) + : undefined, + } as PublicCatalogProductPropertiesHardware +} + +const unmarshalPublicCatalogProductPropertiesInstance = ( + data: unknown, +): PublicCatalogProductPropertiesInstance => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`, + ) + } + + return { + range: data.range, + } as PublicCatalogProductPropertiesInstance +} + +const unmarshalPublicCatalogProductLocality = ( + data: unknown, +): PublicCatalogProductLocality => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`, + ) + } + + return { + datacenter: data.datacenter, + global: data.global, + region: data.region, + zone: data.zone, + } as PublicCatalogProductLocality +} + +const unmarshalPublicCatalogProductPrice = ( + data: unknown, +): PublicCatalogProductPrice => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`, + ) + } + + return { + retailPrice: data.retail_price + ? unmarshalMoney(data.retail_price) + : undefined, + unitOfMeasure: data.unit_of_measure + ? unmarshalPublicCatalogProductPriceUnitOfMeasure(data.unit_of_measure) + : undefined, + } as PublicCatalogProductPrice +} + +const unmarshalPublicCatalogProductProperties = ( + data: unknown, +): PublicCatalogProductProperties => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`, + ) + } + + return { + appleSilicon: data.apple_silicon + ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) + : undefined, + dedibox: data.dedibox + ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) + : undefined, + elasticMetal: data.elastic_metal + ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) + : undefined, + hardware: data.hardware + ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) + : undefined, + instance: data.instance + ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) + : undefined, + } as PublicCatalogProductProperties +} + +const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`, + ) + } + + return { + description: data.description, + locality: data.locality + ? unmarshalPublicCatalogProductLocality(data.locality) + : undefined, + price: data.price + ? unmarshalPublicCatalogProductPrice(data.price) + : undefined, + product: data.product, + properties: data.properties + ? unmarshalPublicCatalogProductProperties(data.properties) + : undefined, + serviceCategory: data.service_category, + sku: data.sku, + variant: data.variant, + } as PublicCatalogProduct +} + +export const unmarshalListPublicCatalogProductsResponse = ( + data: unknown, +): ListPublicCatalogProductsResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`, + ) + } + + return { + products: unmarshalArrayOfObject( + data.products, + unmarshalPublicCatalogProduct, + ), + totalCount: data.total_count, + } as ListPublicCatalogProductsResponse +} diff --git a/packages/clients/src/api/product_catalog/v2alpha1/types.gen.ts b/packages/clients/src/api/product_catalog/v2alpha1/types.gen.ts new file mode 100644 index 000000000..01e58298f --- /dev/null +++ b/packages/clients/src/api/product_catalog/v2alpha1/types.gen.ts @@ -0,0 +1,351 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +import type { + Money, + Region as ScwRegion, + Zone as ScwZone, +} from '@scaleway/sdk-client' + +export type PublicCatalogProductPriceUnitOfMeasureCountableUnit = + | 'unknown_countable_unit' + | 'chunk' + | 'core' + | 'currency' + | 'device' + | 'domain' + | 'email' + | 'gb_s' + | 'gigabyte' + | 'hour' + | 'iops_gigabyte' + | 'ip' + | 'month' + | 'node' + | 'plan' + | 'query' + | 'request' + | 'session' + | 'vcpu_s' + | 'version' + | 'year' + | 'key' + | 'token' + | 'minute' + | 'setup' + | 'day' + +export type PublicCatalogProductPropertiesHardwareCPUArch = + | 'unknown_arch' + | 'x64' + | 'arm64' + | 'riscv' + | 'apple_silicon' + +export interface PublicCatalogProductPropertiesHardwareCPUPhysical { + /** + * The number of sockets of the CPU. + */ + sockets: number + /** + * The number of cores per socket. + */ + coresPerSocket: number + /** + * The number of threads per core. + */ + threadsPerCore: number + /** + * The frequency of the CPU in Hertz. + */ + frequency: number + /** + * The benchmark score of the CPU. + */ + benchmark: number +} + +export interface PublicCatalogProductPropertiesHardwareCPUVirtual { + /** + * The number of vCPUs. + */ + count: number +} + +export interface PublicCatalogProductPropertiesHardwareCPU { + /** + * A human readable description of the CPU. + */ + description: string + /** + * The architecture of the CPU. + */ + arch: PublicCatalogProductPropertiesHardwareCPUArch + /** + * The type of the CPU. + */ + type: string + /** + * Properties if the CPU is virtual. + * + * One-of ('computeUnit'): at most one of 'virtual', 'physical' could be set. + */ + virtual?: PublicCatalogProductPropertiesHardwareCPUVirtual + /** + * Properties if the CPU is physical. + * + * One-of ('computeUnit'): at most one of 'virtual', 'physical' could be set. + */ + physical?: PublicCatalogProductPropertiesHardwareCPUPhysical + /** + * The total number of threads. + */ + threads: number +} + +export interface PublicCatalogProductPropertiesHardwareGPU { + /** + * A human-readable description of the GPU. + */ + description: string + /** + * The number of GPUs. + */ + count: number + /** + * The type of the GPU. + */ + type: string +} + +export interface PublicCatalogProductPropertiesHardwareNetwork { + /** + * A human-readable description of the network. + */ + description: string + /** + * The internal bandwidth in bits per second. + */ + internalBandwidth: number + /** + * The default public bandwidth in bits per second. + */ + publicBandwidth: number + /** + * The maximum public bandwidth in bits per second (may require subscription to options). + */ + maxPublicBandwidth: number +} + +export interface PublicCatalogProductPropertiesHardwareRAM { + /** + * A human-readable description of the RAM. + */ + description: string + /** + * The size of the RAM in bytes. + */ + size: number + /** + * The type of the RAM. + */ + type: string +} + +export interface PublicCatalogProductPropertiesHardwareStorage { + /** + * A human-readable description of the storage. + */ + description: string + /** + * The total size of the storage in bytes. + */ + total: number +} + +export interface PublicCatalogProductPriceUnitOfMeasure { + /** + * The unit of measure. + */ + unit: PublicCatalogProductPriceUnitOfMeasureCountableUnit + /** + * The size of the unit. + */ + size: number +} + +export interface PublicCatalogProductPropertiesAppleSilicon { + /** + * The range of the Apple Silicon server. + */ + range: string +} + +export interface PublicCatalogProductPropertiesDedibox { + /** + * The range of the Dedibox server. + */ + range: string +} + +export interface PublicCatalogProductPropertiesElasticMetal { + /** + * The range of the Elastic Metal server. + */ + range: string +} + +export interface PublicCatalogProductPropertiesHardware { + /** + * The CPU hardware properties. + */ + cpu?: PublicCatalogProductPropertiesHardwareCPU + /** + * The RAM hardware properties. + */ + ram?: PublicCatalogProductPropertiesHardwareRAM + /** + * The storage hardware properties. + */ + storage?: PublicCatalogProductPropertiesHardwareStorage + /** + * The network hardware properties. + */ + network?: PublicCatalogProductPropertiesHardwareNetwork + /** + * The GPU hardware properties. + */ + gpu?: PublicCatalogProductPropertiesHardwareGPU +} + +export interface PublicCatalogProductPropertiesInstance { + /** + * The range of the Instance server. + */ + range: string +} + +export interface PublicCatalogProductLocality { + /** + * Whether or not the product is global. + * + * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set. + */ + global?: boolean + /** + * The region of the product. + * + * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set. + */ + region?: ScwRegion + /** + * The zone of the product. + * + * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set. + */ + zone?: ScwZone + /** + * The datacenter of the product. + * + * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set. + */ + datacenter?: string +} + +export interface PublicCatalogProductPrice { + /** + * The retail price of the product. + */ + retailPrice?: Money + /** + * The unit of measure of the price. + */ + unitOfMeasure?: PublicCatalogProductPriceUnitOfMeasure +} + +export interface PublicCatalogProductProperties { + /** + * The hardware properties of the product (if supported). + */ + hardware?: PublicCatalogProductPropertiesHardware + /** + * The properties of Dedibox products. + * + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set. + */ + dedibox?: PublicCatalogProductPropertiesDedibox + /** + * The properties of Elastic Metal products. + * + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set. + */ + elasticMetal?: PublicCatalogProductPropertiesElasticMetal + /** + * The properties of Apple Silicon products. + * + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set. + */ + appleSilicon?: PublicCatalogProductPropertiesAppleSilicon + /** + * The properties of Instance products. + * + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set. + */ + instance?: PublicCatalogProductPropertiesInstance +} + +export interface PublicCatalogProduct { + /** + * The unique identifier of the product. + */ + sku: string + /** + * The category of the product. + */ + serviceCategory: string + /** + * The product name. + */ + product: string + /** + * The product variant. + */ + variant: string + /** + * The product description. + */ + description: string + /** + * The locality of the product. + */ + locality?: PublicCatalogProductLocality + /** + * The price of the product. + */ + price?: PublicCatalogProductPrice + /** + * The properties of the product. + */ + properties?: PublicCatalogProductProperties +} + +export interface ListPublicCatalogProductsResponse { + /** + * The list of products. + */ + products: PublicCatalogProduct[] + /** + * The total number of products in the catalog. + */ + totalCount: number +} + +export type PublicCatalogApiListPublicCatalogProductsRequest = { + /** + * Number of the page. Value must be greater or equal to 1. + */ + page?: number + /** + * The number of products per page. Value must be greater or equal to 1. + */ + pageSize?: number +} diff --git a/packages/clients/src/api/product_catalog/v2alpha1/validation-rules.gen.ts b/packages/clients/src/api/product_catalog/v2alpha1/validation-rules.gen.ts new file mode 100644 index 000000000..d537011c8 --- /dev/null +++ b/packages/clients/src/api/product_catalog/v2alpha1/validation-rules.gen.ts @@ -0,0 +1,11 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. + +export const PublicCatalogApiListPublicCatalogProductsRequest = { + page: { + greaterThanOrEqual: 1, + }, + pageSize: { + greaterThanOrEqual: 1, + }, +} diff --git a/packages/clients/src/api/qaas/v1alpha1/types.gen.ts b/packages/clients/src/api/qaas/v1alpha1/types.gen.ts index f0f1c7629..c59bb63eb 100644 --- a/packages/clients/src/api/qaas/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/qaas/v1alpha1/types.gen.ts @@ -249,7 +249,7 @@ export interface Platform { */ id: string /** - * Verison of the platform. + * Version of the platform. */ version: string /** @@ -285,7 +285,7 @@ export interface Platform { */ metadata: string /** - * Price to be payed per hour (excluding free tiers). + * Price to be paid per hour (excluding free tiers). */ pricePerHour?: Money /** diff --git a/packages/clients/src/api/rdb/v1/api.gen.ts b/packages/clients/src/api/rdb/v1/api.gen.ts index faad2ffeb..650725375 100644 --- a/packages/clients/src/api/rdb/v1/api.gen.ts +++ b/packages/clients/src/api/rdb/v1/api.gen.ts @@ -895,7 +895,7 @@ The configured endpoints do not change. ) /** - * Set Database Instance advanced settings. Update an advanced setting for a Database Instance. Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated. + * Set Database Instance advanced settings. Update an advanced setting for a Database Instance. Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated. * * @param request - The request {@link SetInstanceSettingsRequest} * @returns A Promise of SetInstanceSettingsResponse diff --git a/packages/clients/src/api/rdb/v1/types.gen.ts b/packages/clients/src/api/rdb/v1/types.gen.ts index 4cdf98bc6..36950f61c 100644 --- a/packages/clients/src/api/rdb/v1/types.gen.ts +++ b/packages/clients/src/api/rdb/v1/types.gen.ts @@ -434,7 +434,7 @@ export interface Volume { export interface NodeTypeVolumeConstraintSizes { /** - * [deprecated] Mimimum size required for the Volume. + * [deprecated] Minimum size required for the Volume. */ minSize: number /** @@ -453,7 +453,7 @@ export interface NodeTypeVolumeType { */ description: string /** - * Mimimum size required for the Volume. + * Minimum size required for the Volume. */ minSize: number /** diff --git a/packages/clients/src/api/redis/v1/api.gen.ts b/packages/clients/src/api/redis/v1/api.gen.ts index 2d9c26f03..1db67290a 100644 --- a/packages/clients/src/api/redis/v1/api.gen.ts +++ b/packages/clients/src/api/redis/v1/api.gen.ts @@ -378,7 +378,7 @@ export class API extends ParentAPI { ) /** - * Set advanced settings. Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated. + * Set advanced settings. Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated. * * @param request - The request {@link SetClusterSettingsRequest} * @returns A Promise of ClusterSettingsResponse diff --git a/packages/clients/src/api/registry/v1/types.gen.ts b/packages/clients/src/api/registry/v1/types.gen.ts index 40cc3956b..a9441669f 100644 --- a/packages/clients/src/api/registry/v1/types.gen.ts +++ b/packages/clients/src/api/registry/v1/types.gen.ts @@ -88,7 +88,7 @@ export interface Namespace { */ id: string /** - * Name of the namespace, unique in a region accross all organizations. + * Name of the namespace, unique in a region across all organizations. */ name: string /**