@scaleway/sdk-edge-services 1.4.0 → 2.1.1

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