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