Skip to content

Commit 62c683f

Browse files
authored
feat(edge_services): add serverless container backend (scaleway#2608)
1 parent 73105e4 commit 62c683f

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

packages_generated/edge_services/src/v1beta1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export type {
105105
ScalewayLb,
106106
ScalewayLbBackendConfig,
107107
ScalewayS3BackendConfig,
108+
ScalewayServerlessContainerBackendConfig,
108109
SearchBackendStagesRequest,
109110
SearchBackendStagesRequestOrderBy,
110111
SearchRouteRulesRequest,

packages_generated/edge_services/src/v1beta1/marshalling.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
ScalewayLb,
66
ScalewayLbBackendConfig,
77
ScalewayS3BackendConfig,
8+
ScalewayServerlessContainerBackendConfig,
89
BackendStage,
910
CacheStage,
1011
DNSStage,
@@ -116,6 +117,19 @@ const unmarshalScalewayS3BackendConfig = (data: unknown): ScalewayS3BackendConfi
116117
} as ScalewayS3BackendConfig
117118
}
118119

120+
const unmarshalScalewayServerlessContainerBackendConfig = (data: unknown): ScalewayServerlessContainerBackendConfig => {
121+
if (!isJSONObject(data)) {
122+
throw new TypeError(
123+
`Unmarshalling the type 'ScalewayServerlessContainerBackendConfig' failed as data isn't a dictionary.`,
124+
)
125+
}
126+
127+
return {
128+
containerId: data.container_id,
129+
region: data.region,
130+
} as ScalewayServerlessContainerBackendConfig
131+
}
132+
119133
export const unmarshalBackendStage = (data: unknown): BackendStage => {
120134
if (!isJSONObject(data)) {
121135
throw new TypeError(
@@ -129,6 +143,7 @@ export const unmarshalBackendStage = (data: unknown): BackendStage => {
129143
pipelineId: data.pipeline_id,
130144
scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : undefined,
131145
scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : undefined,
146+
scalewayServerlessContainer: data.scaleway_serverless_container ? unmarshalScalewayServerlessContainerBackendConfig(data.scaleway_serverless_container) : undefined,
132147
updatedAt: unmarshalDate(data.updated_at),
133148
} as BackendStage
134149
}

packages_generated/edge_services/src/v1beta1/types.gen.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,15 @@ export interface ScalewayS3BackendConfig {
220220
}
221221

222222

223+
export interface ScalewayServerlessContainerBackendConfig {
224+
/**
225+
* Region to target. If none is passed will use default region from the config.
226+
*/
227+
region: ScwRegion
228+
containerId: string
229+
}
230+
231+
223232
export interface PipelineError {
224233
stage: PipelineErrorStage
225234
code: PipelineErrorCode
@@ -273,15 +282,20 @@ export interface BackendStage {
273282
/**
274283
* Scaleway Object Storage origin bucket (S3) linked to the backend stage.
275284
*
276-
* One-of ('backendConfig'): at most one of 'scalewayS3', 'scalewayLb' could be set.
285+
* One-of ('backendConfig'): at most one of 'scalewayS3', 'scalewayLb', 'scalewayServerlessContainer' could be set.
277286
*/
278287
scalewayS3?: ScalewayS3BackendConfig
279288
/**
280289
* Scaleway Load Balancer origin linked to the backend stage.
281290
*
282-
* One-of ('backendConfig'): at most one of 'scalewayS3', 'scalewayLb' could be set.
291+
* One-of ('backendConfig'): at most one of 'scalewayS3', 'scalewayLb', 'scalewayServerlessContainer' could be set.
283292
*/
284293
scalewayLb?: ScalewayLbBackendConfig
294+
/**
295+
*
296+
* One-of ('backendConfig'): at most one of 'scalewayS3', 'scalewayLb', 'scalewayServerlessContainer' could be set.
297+
*/
298+
scalewayServerlessContainer?: ScalewayServerlessContainerBackendConfig
285299
}
286300

287301

0 commit comments

Comments
 (0)