@scaleway/sdk-edge-services 2.16.3 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,724 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney } from "@scaleway/sdk-client";
2
- //#region src/v1beta1/marshalling.gen.ts
3
- const unmarshalScalewayLb = (data) => {
4
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScalewayLb' failed as data isn't a dictionary.`);
5
- return {
6
- domainName: data.domain_name,
7
- frontendId: data.frontend_id,
8
- hasWebsocket: data.has_websocket,
9
- id: data.id,
10
- isSsl: data.is_ssl,
11
- privateNetworkId: data.private_network_id,
12
- zone: data.zone
13
- };
14
- };
15
- const unmarshalScalewayLbBackendConfig = (data) => {
16
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScalewayLbBackendConfig' failed as data isn't a dictionary.`);
17
- return { lbs: unmarshalArrayOfObject(data.lbs, unmarshalScalewayLb) };
18
- };
19
- const unmarshalScalewayS3BackendConfig = (data) => {
20
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScalewayS3BackendConfig' failed as data isn't a dictionary.`);
21
- return {
22
- bucketName: data.bucket_name,
23
- bucketRegion: data.bucket_region,
24
- isWebsite: data.is_website
25
- };
26
- };
27
- const unmarshalScalewayServerlessContainerBackendConfig = (data) => {
28
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScalewayServerlessContainerBackendConfig' failed as data isn't a dictionary.`);
29
- return {
30
- containerId: data.container_id,
31
- region: data.region
32
- };
33
- };
34
- const unmarshalScalewayServerlessFunctionBackendConfig = (data) => {
35
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ScalewayServerlessFunctionBackendConfig' failed as data isn't a dictionary.`);
36
- return {
37
- functionId: data.function_id,
38
- region: data.region
39
- };
40
- };
41
- const unmarshalBackendStage = (data) => {
42
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BackendStage' failed as data isn't a dictionary.`);
43
- return {
44
- createdAt: unmarshalDate(data.created_at),
45
- id: data.id,
46
- pipelineId: data.pipeline_id,
47
- scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : void 0,
48
- scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : void 0,
49
- scalewayServerlessContainer: data.scaleway_serverless_container ? unmarshalScalewayServerlessContainerBackendConfig(data.scaleway_serverless_container) : void 0,
50
- scalewayServerlessFunction: data.scaleway_serverless_function ? unmarshalScalewayServerlessFunctionBackendConfig(data.scaleway_serverless_function) : void 0,
51
- status: data.status,
52
- updatedAt: unmarshalDate(data.updated_at)
53
- };
54
- };
55
- const unmarshalCacheStage = (data) => {
56
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CacheStage' failed as data isn't a dictionary.`);
57
- return {
58
- backendStageId: data.backend_stage_id,
59
- createdAt: unmarshalDate(data.created_at),
60
- fallbackTtl: data.fallback_ttl,
61
- id: data.id,
62
- includeCookies: data.include_cookies,
63
- pipelineId: data.pipeline_id,
64
- routeStageId: data.route_stage_id,
65
- status: data.status,
66
- updatedAt: unmarshalDate(data.updated_at),
67
- wafStageId: data.waf_stage_id
68
- };
69
- };
70
- const unmarshalDNSStage = (data) => {
71
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DNSStage' failed as data isn't a dictionary.`);
72
- return {
73
- backendStageId: data.backend_stage_id,
74
- cacheStageId: data.cache_stage_id,
75
- createdAt: unmarshalDate(data.created_at),
76
- defaultFqdn: data.default_fqdn,
77
- defaultPrivateFqdn: data.default_private_fqdn,
78
- fqdns: data.fqdns,
79
- fullPrivate: data.full_private,
80
- id: data.id,
81
- pipelineId: data.pipeline_id,
82
- status: data.status,
83
- tlsStageId: data.tls_stage_id,
84
- type: data.type,
85
- updatedAt: unmarshalDate(data.updated_at),
86
- wildcardDomain: data.wildcard_domain
87
- };
88
- };
89
- const unmarshalPipelineError = (data) => {
90
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PipelineError' failed as data isn't a dictionary.`);
91
- return {
92
- code: data.code,
93
- message: data.message,
94
- severity: data.severity,
95
- stage: data.stage,
96
- type: data.type
97
- };
98
- };
99
- const unmarshalPipeline = (data) => {
100
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Pipeline' failed as data isn't a dictionary.`);
101
- return {
102
- createdAt: unmarshalDate(data.created_at),
103
- description: data.description,
104
- errors: unmarshalArrayOfObject(data.errors, unmarshalPipelineError),
105
- id: data.id,
106
- name: data.name,
107
- organizationId: data.organization_id,
108
- projectId: data.project_id,
109
- status: data.status,
110
- updatedAt: unmarshalDate(data.updated_at),
111
- vpcEndpointIds: data.vpc_endpoint_ids
112
- };
113
- };
114
- const unmarshalRouteStage = (data) => {
115
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RouteStage' failed as data isn't a dictionary.`);
116
- return {
117
- backendStageId: data.backend_stage_id,
118
- createdAt: unmarshalDate(data.created_at),
119
- id: data.id,
120
- pipelineId: data.pipeline_id,
121
- status: data.status,
122
- updatedAt: unmarshalDate(data.updated_at),
123
- wafStageId: data.waf_stage_id
124
- };
125
- };
126
- const unmarshalTLSSecret = (data) => {
127
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TLSSecret' failed as data isn't a dictionary.`);
128
- return {
129
- region: data.region,
130
- secretId: data.secret_id
131
- };
132
- };
133
- const unmarshalTLSStage = (data) => {
134
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TLSStage' failed as data isn't a dictionary.`);
135
- return {
136
- backendStageId: data.backend_stage_id,
137
- cacheStageId: data.cache_stage_id,
138
- certificateExpiresAt: unmarshalDate(data.certificate_expires_at),
139
- createdAt: unmarshalDate(data.created_at),
140
- id: data.id,
141
- managedCertificate: data.managed_certificate,
142
- pipelineId: data.pipeline_id,
143
- routeStageId: data.route_stage_id,
144
- secrets: unmarshalArrayOfObject(data.secrets, unmarshalTLSSecret),
145
- status: data.status,
146
- updatedAt: unmarshalDate(data.updated_at),
147
- wafStageId: data.waf_stage_id
148
- };
149
- };
150
- const unmarshalWafStage = (data) => {
151
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'WafStage' failed as data isn't a dictionary.`);
152
- return {
153
- backendStageId: data.backend_stage_id,
154
- createdAt: unmarshalDate(data.created_at),
155
- id: data.id,
156
- mode: data.mode,
157
- paranoiaLevel: data.paranoia_level,
158
- pipelineId: data.pipeline_id,
159
- status: data.status,
160
- updatedAt: unmarshalDate(data.updated_at)
161
- };
162
- };
163
- const unmarshalPipelineStages = (data) => {
164
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PipelineStages' failed as data isn't a dictionary.`);
165
- return {
166
- backendStages: unmarshalArrayOfObject(data.backend_stages, unmarshalBackendStage),
167
- cacheStages: unmarshalArrayOfObject(data.cache_stages, unmarshalCacheStage),
168
- dnsStages: unmarshalArrayOfObject(data.dns_stages, unmarshalDNSStage),
169
- pipeline: data.pipeline ? unmarshalPipeline(data.pipeline) : void 0,
170
- routeStages: unmarshalArrayOfObject(data.route_stages, unmarshalRouteStage),
171
- tlsStages: unmarshalArrayOfObject(data.tls_stages, unmarshalTLSStage),
172
- wafStages: unmarshalArrayOfObject(data.waf_stages, unmarshalWafStage)
173
- };
174
- };
175
- const unmarshalPurgeRequest = (data) => {
176
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PurgeRequest' failed as data isn't a dictionary.`);
177
- return {
178
- all: data.all,
179
- assets: data.assets,
180
- createdAt: unmarshalDate(data.created_at),
181
- id: data.id,
182
- pipelineId: data.pipeline_id,
183
- status: data.status,
184
- updatedAt: unmarshalDate(data.updated_at)
185
- };
186
- };
187
- const unmarshalVPCEndpoint = (data) => {
188
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPCEndpoint' failed as data isn't a dictionary.`);
189
- return {
190
- createdAt: unmarshalDate(data.created_at),
191
- id: data.id,
192
- privateNetworkId: data.private_network_id,
193
- projectId: data.project_id,
194
- region: data.region,
195
- updatedAt: unmarshalDate(data.updated_at)
196
- };
197
- };
198
- const unmarshalRuleHttpMatchHostFilter = (data) => {
199
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RuleHttpMatchHostFilter' failed as data isn't a dictionary.`);
200
- return {
201
- hostFilterType: data.host_filter_type,
202
- value: data.value
203
- };
204
- };
205
- const unmarshalRuleHttpMatchPathFilter = (data) => {
206
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RuleHttpMatchPathFilter' failed as data isn't a dictionary.`);
207
- return {
208
- pathFilterType: data.path_filter_type,
209
- value: data.value
210
- };
211
- };
212
- const unmarshalRuleHttpMatch = (data) => {
213
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RuleHttpMatch' failed as data isn't a dictionary.`);
214
- return {
215
- hostFilter: data.host_filter ? unmarshalRuleHttpMatchHostFilter(data.host_filter) : void 0,
216
- methodFilters: data.method_filters,
217
- pathFilter: data.path_filter ? unmarshalRuleHttpMatchPathFilter(data.path_filter) : void 0
218
- };
219
- };
220
- const unmarshalRouteRule = (data) => {
221
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RouteRule' failed as data isn't a dictionary.`);
222
- return {
223
- backendStageId: data.backend_stage_id,
224
- position: data.position,
225
- routeStageId: data.route_stage_id,
226
- ruleHttpMatch: data.rule_http_match ? unmarshalRuleHttpMatch(data.rule_http_match) : void 0,
227
- wafStageId: data.waf_stage_id
228
- };
229
- };
230
- const unmarshalAddRouteRulesResponse = (data) => {
231
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddRouteRulesResponse' failed as data isn't a dictionary.`);
232
- return { routeRules: unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule) };
233
- };
234
- const unmarshalCheckDomainResponse = (data) => {
235
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckDomainResponse' failed as data isn't a dictionary.`);
236
- return { isValid: data.is_valid };
237
- };
238
- const unmarshalCheckLbOriginResponse = (data) => {
239
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckLbOriginResponse' failed as data isn't a dictionary.`);
240
- return {
241
- errorType: data.error_type,
242
- isValid: data.is_valid
243
- };
244
- };
245
- const unmarshalCheckPEMChainResponse = (data) => {
246
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckPEMChainResponse' failed as data isn't a dictionary.`);
247
- return { isValid: data.is_valid };
248
- };
249
- const unmarshalPlanDetails = (data) => {
250
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`);
251
- return {
252
- backendLimit: data.backend_limit,
253
- packageGb: data.package_gb,
254
- pipelineLimit: data.pipeline_limit,
255
- planName: data.plan_name,
256
- wafRequests: data.waf_requests,
257
- wildcardDomain: data.wildcard_domain
258
- };
259
- };
260
- const unmarshalPlanUsageDetails = (data) => {
261
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlanUsageDetails' failed as data isn't a dictionary.`);
262
- return { planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : void 0 };
263
- };
264
- const unmarshalGetBillingResponse = (data) => {
265
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetBillingResponse' failed as data isn't a dictionary.`);
266
- return {
267
- currentPlan: data.current_plan ? unmarshalPlanDetails(data.current_plan) : void 0,
268
- currentPlanCacheUsage: data.current_plan_cache_usage,
269
- currentPlanWafUsage: data.current_plan_waf_usage,
270
- extraCacheCost: data.extra_cache_cost ? unmarshalMoney(data.extra_cache_cost) : void 0,
271
- extraCacheUsage: data.extra_cache_usage,
272
- extraPipelinesCost: data.extra_pipelines_cost ? unmarshalMoney(data.extra_pipelines_cost) : void 0,
273
- extraWafCost: data.extra_waf_cost ? unmarshalMoney(data.extra_waf_cost) : void 0,
274
- extraWafUsage: data.extra_waf_usage,
275
- pipelineNumber: data.pipeline_number,
276
- planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : void 0,
277
- plansUsageDetails: unmarshalMapOfObject(data.plans_usage_details, unmarshalPlanUsageDetails),
278
- totalCost: data.total_cost ? unmarshalMoney(data.total_cost) : void 0,
279
- wafAddOn: data.waf_add_on ? unmarshalMoney(data.waf_add_on) : void 0
280
- };
281
- };
282
- const unmarshalHeadStageResponseHeadStage = (data) => {
283
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HeadStageResponseHeadStage' failed as data isn't a dictionary.`);
284
- return { dnsStageId: data.dns_stage_id };
285
- };
286
- const unmarshalHeadStageResponse = (data) => {
287
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HeadStageResponse' failed as data isn't a dictionary.`);
288
- return { headStage: data.head_stage ? unmarshalHeadStageResponseHeadStage(data.head_stage) : void 0 };
289
- };
290
- const unmarshalListBackendStagesResponse = (data) => {
291
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListBackendStagesResponse' failed as data isn't a dictionary.`);
292
- return {
293
- stages: unmarshalArrayOfObject(data.stages, unmarshalBackendStage),
294
- totalCount: data.total_count
295
- };
296
- };
297
- const unmarshalListCacheStagesResponse = (data) => {
298
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCacheStagesResponse' failed as data isn't a dictionary.`);
299
- return {
300
- stages: unmarshalArrayOfObject(data.stages, unmarshalCacheStage),
301
- totalCount: data.total_count
302
- };
303
- };
304
- const unmarshalListDNSStagesResponse = (data) => {
305
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDNSStagesResponse' failed as data isn't a dictionary.`);
306
- return {
307
- stages: unmarshalArrayOfObject(data.stages, unmarshalDNSStage),
308
- totalCount: data.total_count
309
- };
310
- };
311
- const unmarshalListHeadStagesResponseHeadStage = (data) => {
312
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListHeadStagesResponseHeadStage' failed as data isn't a dictionary.`);
313
- return { dnsStageId: data.dns_stage_id };
314
- };
315
- const unmarshalListHeadStagesResponse = (data) => {
316
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListHeadStagesResponse' failed as data isn't a dictionary.`);
317
- return {
318
- headStages: unmarshalArrayOfObject(data.head_stages, unmarshalListHeadStagesResponseHeadStage),
319
- totalCount: data.total_count
320
- };
321
- };
322
- const unmarshalListPipelinesResponse = (data) => {
323
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPipelinesResponse' failed as data isn't a dictionary.`);
324
- return {
325
- pipelines: unmarshalArrayOfObject(data.pipelines, unmarshalPipeline),
326
- totalCount: data.total_count
327
- };
328
- };
329
- const unmarshalListPipelinesWithStagesResponse = (data) => {
330
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPipelinesWithStagesResponse' failed as data isn't a dictionary.`);
331
- return {
332
- pipelines: unmarshalArrayOfObject(data.pipelines, unmarshalPipelineStages),
333
- totalCount: data.total_count
334
- };
335
- };
336
- const unmarshalListPlansResponse = (data) => {
337
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
338
- return {
339
- plans: unmarshalArrayOfObject(data.plans, unmarshalPlanDetails),
340
- totalCount: data.total_count
341
- };
342
- };
343
- const unmarshalListPurgeRequestsResponse = (data) => {
344
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPurgeRequestsResponse' failed as data isn't a dictionary.`);
345
- return {
346
- purgeRequests: unmarshalArrayOfObject(data.purge_requests, unmarshalPurgeRequest),
347
- totalCount: data.total_count
348
- };
349
- };
350
- const unmarshalListRouteRulesResponse = (data) => {
351
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRouteRulesResponse' failed as data isn't a dictionary.`);
352
- return {
353
- routeRules: unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule),
354
- totalCount: data.total_count
355
- };
356
- };
357
- const unmarshalListRouteStagesResponse = (data) => {
358
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRouteStagesResponse' failed as data isn't a dictionary.`);
359
- return {
360
- stages: unmarshalArrayOfObject(data.stages, unmarshalRouteStage),
361
- totalCount: data.total_count
362
- };
363
- };
364
- const unmarshalListTLSStagesResponse = (data) => {
365
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTLSStagesResponse' failed as data isn't a dictionary.`);
366
- return {
367
- stages: unmarshalArrayOfObject(data.stages, unmarshalTLSStage),
368
- totalCount: data.total_count
369
- };
370
- };
371
- const unmarshalListVPCEndpointsResponse = (data) => {
372
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCEndpointsResponse' failed as data isn't a dictionary.`);
373
- return {
374
- totalCount: data.total_count,
375
- vpcEndpoints: unmarshalArrayOfObject(data.vpc_endpoints, unmarshalVPCEndpoint)
376
- };
377
- };
378
- const unmarshalListWafStagesResponse = (data) => {
379
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListWafStagesResponse' failed as data isn't a dictionary.`);
380
- return {
381
- stages: unmarshalArrayOfObject(data.stages, unmarshalWafStage),
382
- totalCount: data.total_count
383
- };
384
- };
385
- const unmarshalPlan = (data) => {
386
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
387
- return { planName: data.plan_name };
388
- };
389
- const unmarshalSetPipelineVPCEndpointsResponse = (data) => {
390
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetPipelineVPCEndpointsResponse' failed as data isn't a dictionary.`);
391
- return {
392
- pipelineId: data.pipeline_id,
393
- totalCount: data.total_count,
394
- vpcEndpoints: unmarshalArrayOfObject(data.vpc_endpoints, unmarshalVPCEndpoint)
395
- };
396
- };
397
- const unmarshalSetRouteRulesResponse = (data) => {
398
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetRouteRulesResponse' failed as data isn't a dictionary.`);
399
- return { routeRules: unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule) };
400
- };
401
- const marshalRuleHttpMatchHostFilter = (request, defaults) => ({
402
- host_filter_type: request.hostFilterType,
403
- value: request.value
404
- });
405
- const marshalRuleHttpMatchPathFilter = (request, defaults) => ({
406
- path_filter_type: request.pathFilterType,
407
- value: request.value
408
- });
409
- const marshalRuleHttpMatch = (request, defaults) => ({
410
- host_filter: request.hostFilter !== void 0 ? marshalRuleHttpMatchHostFilter(request.hostFilter, defaults) : void 0,
411
- method_filters: request.methodFilters,
412
- path_filter: request.pathFilter !== void 0 ? marshalRuleHttpMatchPathFilter(request.pathFilter, defaults) : void 0
413
- });
414
- const marshalSetRouteRulesRequestRouteRule = (request, defaults) => ({
415
- ...resolveOneOf([{
416
- param: "rule_http_match",
417
- value: request.ruleHttpMatch !== void 0 ? marshalRuleHttpMatch(request.ruleHttpMatch, defaults) : void 0
418
- }]),
419
- ...resolveOneOf([{
420
- param: "backend_stage_id",
421
- value: request.backendStageId
422
- }, {
423
- param: "waf_stage_id",
424
- value: request.wafStageId
425
- }])
426
- });
427
- const marshalAddRouteRulesRequest = (request, defaults) => ({
428
- route_rules: request.routeRules !== void 0 ? request.routeRules.map((elt) => marshalSetRouteRulesRequestRouteRule(elt, defaults)) : void 0,
429
- ...resolveOneOf([{
430
- param: "after_position",
431
- value: request.afterPosition
432
- }, {
433
- param: "before_position",
434
- value: request.beforePosition
435
- }])
436
- });
437
- const marshalCheckDomainRequest = (request, defaults) => ({
438
- cname: request.cname,
439
- fqdn: request.fqdn,
440
- project_id: request.projectId ?? defaults.defaultProjectId
441
- });
442
- const marshalScalewayLb = (request, defaults) => ({
443
- domain_name: request.domainName,
444
- frontend_id: request.frontendId,
445
- has_websocket: request.hasWebsocket,
446
- id: request.id,
447
- is_ssl: request.isSsl,
448
- private_network_id: request.privateNetworkId,
449
- zone: request.zone
450
- });
451
- const marshalCheckLbOriginRequest = (request, defaults) => ({ lb: request.lb !== void 0 ? marshalScalewayLb(request.lb, defaults) : void 0 });
452
- const marshalCheckPEMChainRequestSecretChain = (request, defaults) => ({
453
- secret_id: request.secretId,
454
- secret_region: request.secretRegion
455
- });
456
- const marshalCheckPEMChainRequest = (request, defaults) => ({
457
- fqdn: request.fqdn,
458
- project_id: request.projectId ?? defaults.defaultProjectId,
459
- ...resolveOneOf([{
460
- param: "secret",
461
- value: request.secret !== void 0 ? marshalCheckPEMChainRequestSecretChain(request.secret, defaults) : void 0
462
- }, {
463
- param: "raw",
464
- value: request.raw
465
- }])
466
- });
467
- const marshalScalewayLbBackendConfig = (request, defaults) => ({ lbs: request.lbs.map((elt) => marshalScalewayLb(elt, defaults)) });
468
- const marshalScalewayS3BackendConfig = (request, defaults) => ({
469
- bucket_name: request.bucketName,
470
- bucket_region: request.bucketRegion,
471
- is_website: request.isWebsite
472
- });
473
- const marshalScalewayServerlessContainerBackendConfig = (request, defaults) => ({
474
- container_id: request.containerId,
475
- region: request.region
476
- });
477
- const marshalScalewayServerlessFunctionBackendConfig = (request, defaults) => ({
478
- function_id: request.functionId,
479
- region: request.region
480
- });
481
- const marshalCreateBackendStageRequest = (request, defaults) => ({ ...resolveOneOf([
482
- {
483
- param: "scaleway_s3",
484
- value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) : void 0
485
- },
486
- {
487
- param: "scaleway_lb",
488
- value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) : void 0
489
- },
490
- {
491
- param: "scaleway_serverless_container",
492
- value: request.scalewayServerlessContainer !== void 0 ? marshalScalewayServerlessContainerBackendConfig(request.scalewayServerlessContainer, defaults) : void 0
493
- },
494
- {
495
- param: "scaleway_serverless_function",
496
- value: request.scalewayServerlessFunction !== void 0 ? marshalScalewayServerlessFunctionBackendConfig(request.scalewayServerlessFunction, defaults) : void 0
497
- }
498
- ]) });
499
- const marshalCreateCacheStageRequest = (request, defaults) => ({
500
- fallback_ttl: request.fallbackTtl,
501
- include_cookies: request.includeCookies,
502
- ...resolveOneOf([
503
- {
504
- param: "backend_stage_id",
505
- value: request.backendStageId
506
- },
507
- {
508
- param: "waf_stage_id",
509
- value: request.wafStageId
510
- },
511
- {
512
- param: "route_stage_id",
513
- value: request.routeStageId
514
- }
515
- ])
516
- });
517
- const marshalCreateDNSStageRequest = (request, defaults) => ({
518
- fqdns: request.fqdns,
519
- full_private: request.fullPrivate,
520
- wildcard_domain: request.wildcardDomain,
521
- ...resolveOneOf([
522
- {
523
- param: "tls_stage_id",
524
- value: request.tlsStageId
525
- },
526
- {
527
- param: "cache_stage_id",
528
- value: request.cacheStageId
529
- },
530
- {
531
- param: "backend_stage_id",
532
- value: request.backendStageId
533
- }
534
- ])
535
- });
536
- const marshalCreatePipelineRequest = (request, defaults) => ({
537
- description: request.description,
538
- name: request.name,
539
- project_id: request.projectId ?? defaults.defaultProjectId
540
- });
541
- const marshalCreatePurgeRequestRequest = (request, defaults) => ({
542
- pipeline_id: request.pipelineId,
543
- ...resolveOneOf([{
544
- param: "assets",
545
- value: request.assets
546
- }, {
547
- param: "all",
548
- value: request.all
549
- }])
550
- });
551
- const marshalCreateRouteStageRequest = (request, defaults) => ({ ...resolveOneOf([{
552
- param: "waf_stage_id",
553
- value: request.wafStageId
554
- }, {
555
- param: "backend_stage_id",
556
- value: request.backendStageId
557
- }]) });
558
- const marshalTLSSecret = (request, defaults) => ({
559
- region: request.region,
560
- secret_id: request.secretId
561
- });
562
- const marshalCreateTLSStageRequest = (request, defaults) => ({
563
- managed_certificate: request.managedCertificate,
564
- secrets: request.secrets !== void 0 ? request.secrets.map((elt) => marshalTLSSecret(elt, defaults)) : void 0,
565
- ...resolveOneOf([
566
- {
567
- param: "cache_stage_id",
568
- value: request.cacheStageId
569
- },
570
- {
571
- param: "backend_stage_id",
572
- value: request.backendStageId
573
- },
574
- {
575
- param: "route_stage_id",
576
- value: request.routeStageId
577
- },
578
- {
579
- param: "waf_stage_id",
580
- value: request.wafStageId
581
- }
582
- ])
583
- });
584
- const marshalCreateVPCEndpointRequest = (request, defaults) => ({
585
- private_network_id: request.privateNetworkId,
586
- project_id: request.projectId ?? defaults.defaultProjectId,
587
- region: request.region ?? defaults.defaultRegion
588
- });
589
- const marshalCreateWafStageRequest = (request, defaults) => ({
590
- mode: request.mode,
591
- paranoia_level: request.paranoiaLevel,
592
- ...resolveOneOf([{
593
- param: "backend_stage_id",
594
- value: request.backendStageId
595
- }])
596
- });
597
- const marshalSelectPlanRequest = (request, defaults) => ({
598
- plan_name: request.planName,
599
- project_id: request.projectId ?? defaults.defaultProjectId
600
- });
601
- const marshalSetHeadStageRequestAddNewHeadStage = (request, defaults) => ({ new_stage_id: request.newStageId });
602
- const marshalSetHeadStageRequestRemoveHeadStage = (request, defaults) => ({ remove_stage_id: request.removeStageId });
603
- const marshalSetHeadStageRequestSwapHeadStage = (request, defaults) => ({
604
- current_stage_id: request.currentStageId,
605
- new_stage_id: request.newStageId
606
- });
607
- const marshalSetHeadStageRequest = (request, defaults) => ({ ...resolveOneOf([
608
- {
609
- param: "add_new_head_stage",
610
- value: request.addNewHeadStage !== void 0 ? marshalSetHeadStageRequestAddNewHeadStage(request.addNewHeadStage, defaults) : void 0
611
- },
612
- {
613
- param: "remove_head_stage",
614
- value: request.removeHeadStage !== void 0 ? marshalSetHeadStageRequestRemoveHeadStage(request.removeHeadStage, defaults) : void 0
615
- },
616
- {
617
- param: "swap_head_stage",
618
- value: request.swapHeadStage !== void 0 ? marshalSetHeadStageRequestSwapHeadStage(request.swapHeadStage, defaults) : void 0
619
- }
620
- ]) });
621
- const marshalSetPipelineVPCEndpointsRequest = (request, defaults) => ({ vpc_endpoint_ids: request.vpcEndpointIds });
622
- const marshalSetRouteRulesRequest = (request, defaults) => ({ route_rules: request.routeRules !== void 0 ? request.routeRules.map((elt) => marshalSetRouteRulesRequestRouteRule(elt, defaults)) : void 0 });
623
- const marshalUpdateBackendStageRequest = (request, defaults) => ({
624
- pipeline_id: request.pipelineId,
625
- ...resolveOneOf([
626
- {
627
- param: "scaleway_s3",
628
- value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) : void 0
629
- },
630
- {
631
- param: "scaleway_lb",
632
- value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) : void 0
633
- },
634
- {
635
- param: "scaleway_serverless_container",
636
- value: request.scalewayServerlessContainer !== void 0 ? marshalScalewayServerlessContainerBackendConfig(request.scalewayServerlessContainer, defaults) : void 0
637
- },
638
- {
639
- param: "scaleway_serverless_function",
640
- value: request.scalewayServerlessFunction !== void 0 ? marshalScalewayServerlessFunctionBackendConfig(request.scalewayServerlessFunction, defaults) : void 0
641
- }
642
- ])
643
- });
644
- const marshalUpdateCacheStageRequest = (request, defaults) => ({
645
- fallback_ttl: request.fallbackTtl,
646
- include_cookies: request.includeCookies,
647
- ...resolveOneOf([
648
- {
649
- param: "backend_stage_id",
650
- value: request.backendStageId
651
- },
652
- {
653
- param: "waf_stage_id",
654
- value: request.wafStageId
655
- },
656
- {
657
- param: "route_stage_id",
658
- value: request.routeStageId
659
- }
660
- ])
661
- });
662
- const marshalUpdateDNSStageRequest = (request, defaults) => ({
663
- fqdns: request.fqdns,
664
- full_private: request.fullPrivate,
665
- wildcard_domain: request.wildcardDomain,
666
- ...resolveOneOf([
667
- {
668
- param: "tls_stage_id",
669
- value: request.tlsStageId
670
- },
671
- {
672
- param: "cache_stage_id",
673
- value: request.cacheStageId
674
- },
675
- {
676
- param: "backend_stage_id",
677
- value: request.backendStageId
678
- }
679
- ])
680
- });
681
- const marshalUpdatePipelineRequest = (request, defaults) => ({
682
- description: request.description,
683
- name: request.name
684
- });
685
- const marshalUpdateRouteStageRequest = (request, defaults) => ({ ...resolveOneOf([{
686
- param: "waf_stage_id",
687
- value: request.wafStageId
688
- }, {
689
- param: "backend_stage_id",
690
- value: request.backendStageId
691
- }]) });
692
- const marshalTLSSecretsConfig = (request, defaults) => ({ tls_secrets: request.tlsSecrets.map((elt) => marshalTLSSecret(elt, defaults)) });
693
- const marshalUpdateTLSStageRequest = (request, defaults) => ({
694
- managed_certificate: request.managedCertificate,
695
- tls_secrets_config: request.tlsSecretsConfig !== void 0 ? marshalTLSSecretsConfig(request.tlsSecretsConfig, defaults) : void 0,
696
- ...resolveOneOf([
697
- {
698
- param: "cache_stage_id",
699
- value: request.cacheStageId
700
- },
701
- {
702
- param: "backend_stage_id",
703
- value: request.backendStageId
704
- },
705
- {
706
- param: "route_stage_id",
707
- value: request.routeStageId
708
- },
709
- {
710
- param: "waf_stage_id",
711
- value: request.wafStageId
712
- }
713
- ])
714
- });
715
- const marshalUpdateWafStageRequest = (request, defaults) => ({
716
- mode: request.mode,
717
- paranoia_level: request.paranoiaLevel,
718
- ...resolveOneOf([{
719
- param: "backend_stage_id",
720
- value: request.backendStageId
721
- }])
722
- });
723
- //#endregion
724
- export { marshalAddRouteRulesRequest, marshalCheckDomainRequest, marshalCheckLbOriginRequest, marshalCheckPEMChainRequest, marshalCreateBackendStageRequest, marshalCreateCacheStageRequest, marshalCreateDNSStageRequest, marshalCreatePipelineRequest, marshalCreatePurgeRequestRequest, marshalCreateRouteStageRequest, marshalCreateTLSStageRequest, marshalCreateVPCEndpointRequest, marshalCreateWafStageRequest, marshalSelectPlanRequest, marshalSetHeadStageRequest, marshalSetPipelineVPCEndpointsRequest, marshalSetRouteRulesRequest, marshalSetRouteRulesRequestRouteRule, marshalUpdateBackendStageRequest, marshalUpdateCacheStageRequest, marshalUpdateDNSStageRequest, marshalUpdatePipelineRequest, marshalUpdateRouteStageRequest, marshalUpdateTLSStageRequest, marshalUpdateWafStageRequest, unmarshalAddRouteRulesResponse, unmarshalBackendStage, unmarshalCacheStage, unmarshalCheckDomainResponse, unmarshalCheckLbOriginResponse, unmarshalCheckPEMChainResponse, unmarshalDNSStage, unmarshalGetBillingResponse, unmarshalHeadStageResponse, unmarshalListBackendStagesResponse, unmarshalListCacheStagesResponse, unmarshalListDNSStagesResponse, unmarshalListHeadStagesResponse, unmarshalListPipelinesResponse, unmarshalListPipelinesWithStagesResponse, unmarshalListPlansResponse, unmarshalListPurgeRequestsResponse, unmarshalListRouteRulesResponse, unmarshalListRouteStagesResponse, unmarshalListTLSStagesResponse, unmarshalListVPCEndpointsResponse, unmarshalListWafStagesResponse, unmarshalPipeline, unmarshalPipelineStages, unmarshalPlan, unmarshalPurgeRequest, unmarshalRouteStage, unmarshalSetPipelineVPCEndpointsResponse, unmarshalSetRouteRulesResponse, unmarshalTLSStage, unmarshalVPCEndpoint, unmarshalWafStage };