diff --git a/packages/clients/src/api/container/v1beta1/index.gen.ts b/packages/clients/src/api/container/v1beta1/index.gen.ts index d8576497a..9f501f6e8 100644 --- a/packages/clients/src/api/container/v1beta1/index.gen.ts +++ b/packages/clients/src/api/container/v1beta1/index.gen.ts @@ -8,6 +8,7 @@ export type { ContainerPrivacy, ContainerProtocol, ContainerSandbox, + ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateCronRequest, diff --git a/packages/clients/src/api/container/v1beta1/marshalling.gen.ts b/packages/clients/src/api/container/v1beta1/marshalling.gen.ts index ac7fa9b22..2f7cfdbac 100644 --- a/packages/clients/src/api/container/v1beta1/marshalling.gen.ts +++ b/packages/clients/src/api/container/v1beta1/marshalling.gen.ts @@ -10,6 +10,7 @@ import { import type { DefaultValues } from '../../../bridge' import type { Container, + ContainerScalingOption, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, @@ -42,6 +43,20 @@ import type { UpdateTriggerRequestSqsClientConfig, } from './types.gen' +const unmarshalContainerScalingOption = ( + data: unknown, +): ContainerScalingOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`, + ) + } + + return { + concurrentRequestsThreshold: data.concurrent_requests_threshold, + } as ContainerScalingOption +} + const unmarshalSecretHashedValue = (data: unknown): SecretHashedValue => { if (!isJSONObject(data)) { throw new TypeError( @@ -83,6 +98,9 @@ export const unmarshalContainer = (data: unknown): Container => { region: data.region, registryImage: data.registry_image, sandbox: data.sandbox, + scalingOption: data.scaling_option + ? unmarshalContainerScalingOption(data.scaling_option) + : undefined, secretEnvironmentVariables: unmarshalArrayOfObject( data.secret_environment_variables, unmarshalSecretHashedValue, @@ -340,6 +358,18 @@ export const unmarshalListTriggersResponse = ( } as ListTriggersResponse } +const marshalContainerScalingOption = ( + request: ContainerScalingOption, + defaults: DefaultValues, +): Record => ({ + ...resolveOneOf([ + { + param: 'concurrent_requests_threshold', + value: request.concurrentRequestsThreshold, + }, + ]), +}) + const marshalSecret = ( request: Secret, defaults: DefaultValues, @@ -368,6 +398,10 @@ export const marshalCreateContainerRequest = ( protocol: request.protocol, registry_image: request.registryImage, sandbox: request.sandbox, + scaling_option: + request.scalingOption !== undefined + ? marshalContainerScalingOption(request.scalingOption, defaults) + : undefined, secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => @@ -512,6 +546,10 @@ export const marshalUpdateContainerRequest = ( redeploy: request.redeploy, registry_image: request.registryImage, sandbox: request.sandbox, + scaling_option: + request.scalingOption !== undefined + ? marshalContainerScalingOption(request.scalingOption, defaults) + : undefined, secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => diff --git a/packages/clients/src/api/container/v1beta1/types.gen.ts b/packages/clients/src/api/container/v1beta1/types.gen.ts index 01006c58e..482087ce3 100644 --- a/packages/clients/src/api/container/v1beta1/types.gen.ts +++ b/packages/clients/src/api/container/v1beta1/types.gen.ts @@ -95,6 +95,14 @@ export type TriggerStatus = | 'creating' | 'pending' +export interface ContainerScalingOption { + /** + * One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold' could + * be set. + */ + concurrentRequestsThreshold?: number +} + export interface SecretHashedValue { key: string hashedValue: string @@ -223,6 +231,13 @@ export interface Container { sandbox: ContainerSandbox /** Local storage limit of the container (in MB). */ localStorageLimit: number + /** + * Possible values: + * + * - Concurrent_requests_threshold: Scale depending on the number of concurrent + * requests being processed per container instance. + */ + scalingOption?: ContainerScalingOption /** Region in which the container will be deployed. */ region: Region } @@ -385,7 +400,7 @@ export type CreateContainerRequest = { * "rg.fr-par.scw.cloud/something/image:tag"). */ registryImage?: string - /** Number of maximum concurrent executions of the container. */ + /** @deprecated Number of maximum concurrent executions of the container. */ maxConcurrency?: number /** Protocol the container uses. */ protocol?: ContainerProtocol @@ -405,6 +420,13 @@ export type CreateContainerRequest = { sandbox?: ContainerSandbox /** Local storage limit of the container (in MB). */ localStorageLimit?: number + /** + * Possible values: + * + * - Concurrent_requests_threshold: Scale depending on the number of concurrent + * requests being processed per container instance. + */ + scalingOption?: ContainerScalingOption } export type CreateCronRequest = { @@ -840,7 +862,7 @@ export type UpdateContainerRequest = { * "rg.fr-par.scw.cloud/something/image:tag"). */ registryImage?: string - /** Number of maximum concurrent executions of the container. */ + /** @deprecated Number of maximum concurrent executions of the container. */ maxConcurrency?: number protocol?: ContainerProtocol port?: number @@ -857,6 +879,13 @@ export type UpdateContainerRequest = { sandbox?: ContainerSandbox /** Local storage limit of the container (in MB). */ localStorageLimit?: number + /** + * Possible values: + * + * - Concurrent_requests_threshold: Scale depending on the number of concurrent + * requests being processed per container instance. + */ + scalingOption?: ContainerScalingOption } export type UpdateCronRequest = { diff --git a/packages/clients/src/api/container/v1beta1/validation-rules.gen.ts b/packages/clients/src/api/container/v1beta1/validation-rules.gen.ts index 7b45e4e11..03c156a61 100644 --- a/packages/clients/src/api/container/v1beta1/validation-rules.gen.ts +++ b/packages/clients/src/api/container/v1beta1/validation-rules.gen.ts @@ -1,6 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. +export const ContainerScalingOption = {} + export const CreateTriggerRequest = { description: { maxLength: 255,