Skip to content

Commit aa5db59

Browse files
committed
feat: update generated APIs
1 parent f2afda2 commit aa5db59

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

packages/clients/src/api/container/v1beta1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type {
88
ContainerPrivacy,
99
ContainerProtocol,
1010
ContainerSandbox,
11+
ContainerScalingOption,
1112
ContainerStatus,
1213
CreateContainerRequest,
1314
CreateCronRequest,

packages/clients/src/api/container/v1beta1/marshalling.gen.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import type { DefaultValues } from '../../../bridge'
1111
import type {
1212
Container,
13+
ContainerScalingOption,
1314
CreateContainerRequest,
1415
CreateCronRequest,
1516
CreateDomainRequest,
@@ -42,6 +43,20 @@ import type {
4243
UpdateTriggerRequestSqsClientConfig,
4344
} from './types.gen'
4445

46+
const unmarshalContainerScalingOption = (
47+
data: unknown,
48+
): ContainerScalingOption => {
49+
if (!isJSONObject(data)) {
50+
throw new TypeError(
51+
`Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`,
52+
)
53+
}
54+
55+
return {
56+
concurrentRequestsThreshold: data.concurrent_requests_threshold,
57+
} as ContainerScalingOption
58+
}
59+
4560
const unmarshalSecretHashedValue = (data: unknown): SecretHashedValue => {
4661
if (!isJSONObject(data)) {
4762
throw new TypeError(
@@ -83,6 +98,9 @@ export const unmarshalContainer = (data: unknown): Container => {
8398
region: data.region,
8499
registryImage: data.registry_image,
85100
sandbox: data.sandbox,
101+
scalingOption: data.scaling_option
102+
? unmarshalContainerScalingOption(data.scaling_option)
103+
: undefined,
86104
secretEnvironmentVariables: unmarshalArrayOfObject(
87105
data.secret_environment_variables,
88106
unmarshalSecretHashedValue,
@@ -340,6 +358,18 @@ export const unmarshalListTriggersResponse = (
340358
} as ListTriggersResponse
341359
}
342360

361+
const marshalContainerScalingOption = (
362+
request: ContainerScalingOption,
363+
defaults: DefaultValues,
364+
): Record<string, unknown> => ({
365+
...resolveOneOf([
366+
{
367+
param: 'concurrent_requests_threshold',
368+
value: request.concurrentRequestsThreshold,
369+
},
370+
]),
371+
})
372+
343373
const marshalSecret = (
344374
request: Secret,
345375
defaults: DefaultValues,
@@ -368,6 +398,10 @@ export const marshalCreateContainerRequest = (
368398
protocol: request.protocol,
369399
registry_image: request.registryImage,
370400
sandbox: request.sandbox,
401+
scaling_option:
402+
request.scalingOption !== undefined
403+
? marshalContainerScalingOption(request.scalingOption, defaults)
404+
: undefined,
371405
secret_environment_variables:
372406
request.secretEnvironmentVariables !== undefined
373407
? request.secretEnvironmentVariables.map(elt =>
@@ -512,6 +546,10 @@ export const marshalUpdateContainerRequest = (
512546
redeploy: request.redeploy,
513547
registry_image: request.registryImage,
514548
sandbox: request.sandbox,
549+
scaling_option:
550+
request.scalingOption !== undefined
551+
? marshalContainerScalingOption(request.scalingOption, defaults)
552+
: undefined,
515553
secret_environment_variables:
516554
request.secretEnvironmentVariables !== undefined
517555
? request.secretEnvironmentVariables.map(elt =>

packages/clients/src/api/container/v1beta1/types.gen.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ export type TriggerStatus =
9595
| 'creating'
9696
| 'pending'
9797

98+
export interface ContainerScalingOption {
99+
/**
100+
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold' could
101+
* be set.
102+
*/
103+
concurrentRequestsThreshold?: number
104+
}
105+
98106
export interface SecretHashedValue {
99107
key: string
100108
hashedValue: string
@@ -223,6 +231,13 @@ export interface Container {
223231
sandbox: ContainerSandbox
224232
/** Local storage limit of the container (in MB). */
225233
localStorageLimit: number
234+
/**
235+
* Possible values:
236+
*
237+
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
238+
* requests being processed per container instance.
239+
*/
240+
scalingOption?: ContainerScalingOption
226241
/** Region in which the container will be deployed. */
227242
region: Region
228243
}
@@ -385,7 +400,7 @@ export type CreateContainerRequest = {
385400
* "rg.fr-par.scw.cloud/something/image:tag").
386401
*/
387402
registryImage?: string
388-
/** Number of maximum concurrent executions of the container. */
403+
/** @deprecated Number of maximum concurrent executions of the container. */
389404
maxConcurrency?: number
390405
/** Protocol the container uses. */
391406
protocol?: ContainerProtocol
@@ -405,6 +420,13 @@ export type CreateContainerRequest = {
405420
sandbox?: ContainerSandbox
406421
/** Local storage limit of the container (in MB). */
407422
localStorageLimit?: number
423+
/**
424+
* Possible values:
425+
*
426+
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
427+
* requests being processed per container instance.
428+
*/
429+
scalingOption?: ContainerScalingOption
408430
}
409431

410432
export type CreateCronRequest = {
@@ -840,7 +862,7 @@ export type UpdateContainerRequest = {
840862
* "rg.fr-par.scw.cloud/something/image:tag").
841863
*/
842864
registryImage?: string
843-
/** Number of maximum concurrent executions of the container. */
865+
/** @deprecated Number of maximum concurrent executions of the container. */
844866
maxConcurrency?: number
845867
protocol?: ContainerProtocol
846868
port?: number
@@ -857,6 +879,13 @@ export type UpdateContainerRequest = {
857879
sandbox?: ContainerSandbox
858880
/** Local storage limit of the container (in MB). */
859881
localStorageLimit?: number
882+
/**
883+
* Possible values:
884+
*
885+
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
886+
* requests being processed per container instance.
887+
*/
888+
scalingOption?: ContainerScalingOption
860889
}
861890

862891
export type UpdateCronRequest = {

packages/clients/src/api/container/v1beta1/validation-rules.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33

4+
export const ContainerScalingOption = {}
5+
46
export const CreateTriggerRequest = {
57
description: {
68
maxLength: 255,

0 commit comments

Comments
 (0)