@scaleway/sdk 2.66.0 → 2.68.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.
Files changed (131) hide show
  1. package/dist/api/audit_trail/v1alpha1/api.gen.cjs +5 -1
  2. package/dist/api/audit_trail/v1alpha1/api.gen.js +5 -1
  3. package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +1 -0
  4. package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +1 -0
  5. package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +6 -2
  6. package/dist/api/baremetal/v1/api.gen.cjs +13 -0
  7. package/dist/api/baremetal/v1/api.gen.d.ts +8 -1
  8. package/dist/api/baremetal/v1/api.gen.js +13 -0
  9. package/dist/api/baremetal/v1/content.gen.cjs +2 -1
  10. package/dist/api/baremetal/v1/content.gen.js +2 -1
  11. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  12. package/dist/api/baremetal/v1/marshalling.gen.cjs +1 -0
  13. package/dist/api/baremetal/v1/marshalling.gen.js +1 -0
  14. package/dist/api/baremetal/v1/types.gen.d.ts +9 -1
  15. package/dist/api/block/index.gen.cjs +4 -2
  16. package/dist/api/block/index.gen.d.ts +1 -0
  17. package/dist/api/block/index.gen.js +4 -2
  18. package/dist/api/block/v1/api.gen.cjs +303 -0
  19. package/dist/api/block/v1/api.gen.d.ts +152 -0
  20. package/dist/api/block/v1/api.gen.js +303 -0
  21. package/dist/api/block/v1/content.gen.cjs +22 -0
  22. package/dist/api/block/v1/content.gen.d.ts +7 -0
  23. package/dist/api/block/v1/content.gen.js +22 -0
  24. package/dist/api/block/v1/index.gen.cjs +10 -0
  25. package/dist/api/block/v1/index.gen.d.ts +4 -0
  26. package/dist/api/block/v1/index.gen.js +10 -0
  27. package/dist/api/block/v1/marshalling.gen.cjs +200 -0
  28. package/dist/api/block/v1/marshalling.gen.d.ts +14 -0
  29. package/dist/api/block/v1/marshalling.gen.js +200 -0
  30. package/dist/api/block/v1/types.gen.d.ts +335 -0
  31. package/dist/api/block/v1/validation-rules.gen.cjs +56 -0
  32. package/dist/api/block/v1/validation-rules.gen.d.ts +47 -0
  33. package/dist/api/block/v1/validation-rules.gen.js +56 -0
  34. package/dist/api/block/v1alpha1/api.gen.cjs +1 -0
  35. package/dist/api/block/v1alpha1/api.gen.js +1 -0
  36. package/dist/api/block/v1alpha1/types.gen.d.ts +5 -0
  37. package/dist/api/cockpit/v1/api.gen.cjs +14 -17
  38. package/dist/api/cockpit/v1/api.gen.d.ts +6 -9
  39. package/dist/api/cockpit/v1/api.gen.js +15 -18
  40. package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
  41. package/dist/api/cockpit/v1/marshalling.gen.cjs +29 -26
  42. package/dist/api/cockpit/v1/marshalling.gen.d.ts +2 -2
  43. package/dist/api/cockpit/v1/marshalling.gen.js +29 -26
  44. package/dist/api/cockpit/v1/types.gen.d.ts +49 -34
  45. package/dist/api/cockpit/v1/validation-rules.gen.cjs +0 -10
  46. package/dist/api/cockpit/v1/validation-rules.gen.d.ts +0 -9
  47. package/dist/api/cockpit/v1/validation-rules.gen.js +0 -10
  48. package/dist/api/edge_services/index.gen.cjs +2 -0
  49. package/dist/api/edge_services/index.gen.d.ts +1 -0
  50. package/dist/api/edge_services/index.gen.js +3 -1
  51. package/dist/api/edge_services/v1beta1/api.gen.cjs +941 -0
  52. package/dist/api/edge_services/v1beta1/api.gen.d.ts +454 -0
  53. package/dist/api/edge_services/v1beta1/api.gen.js +941 -0
  54. package/dist/api/edge_services/v1beta1/content.gen.cjs +8 -0
  55. package/dist/api/edge_services/v1beta1/content.gen.d.ts +5 -0
  56. package/dist/api/edge_services/v1beta1/content.gen.js +8 -0
  57. package/dist/api/{webhosting/v1alpha1 → edge_services/v1beta1}/index.gen.cjs +2 -2
  58. package/dist/api/edge_services/v1beta1/index.gen.d.ts +4 -0
  59. package/dist/api/edge_services/v1beta1/index.gen.js +9 -0
  60. package/dist/api/edge_services/v1beta1/marshalling.gen.cjs +808 -0
  61. package/dist/api/edge_services/v1beta1/marshalling.gen.d.ts +53 -0
  62. package/dist/api/edge_services/v1beta1/marshalling.gen.js +808 -0
  63. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1218 -0
  64. package/dist/api/edge_services/v1beta1/validation-rules.gen.cjs +23 -0
  65. package/dist/api/edge_services/v1beta1/validation-rules.gen.d.ts +18 -0
  66. package/dist/api/edge_services/v1beta1/validation-rules.gen.js +23 -0
  67. package/dist/api/instance/v1/api.gen.cjs +18 -0
  68. package/dist/api/instance/v1/api.gen.d.ts +13 -1
  69. package/dist/api/instance/v1/api.gen.js +19 -1
  70. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  71. package/dist/api/instance/v1/marshalling.gen.cjs +12 -0
  72. package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
  73. package/dist/api/instance/v1/marshalling.gen.js +12 -0
  74. package/dist/api/instance/v1/types.gen.d.ts +12 -0
  75. package/dist/api/lb/v1/marshalling.gen.cjs +7 -0
  76. package/dist/api/lb/v1/marshalling.gen.js +7 -0
  77. package/dist/api/lb/v1/types.gen.d.ts +27 -0
  78. package/dist/api/mongodb/v1alpha1/api.gen.cjs +11 -0
  79. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +2 -1
  80. package/dist/api/mongodb/v1alpha1/api.gen.js +12 -1
  81. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  82. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +26 -1
  83. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +2 -1
  84. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +26 -1
  85. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +29 -0
  86. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +8 -0
  87. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +7 -0
  88. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +8 -0
  89. package/dist/api/secret/v1beta1/api.gen.cjs +33 -0
  90. package/dist/api/secret/v1beta1/api.gen.d.ts +17 -1
  91. package/dist/api/secret/v1beta1/api.gen.js +33 -0
  92. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  93. package/dist/api/secret/v1beta1/marshalling.gen.cjs +2 -0
  94. package/dist/api/secret/v1beta1/marshalling.gen.js +2 -0
  95. package/dist/api/secret/v1beta1/types.gen.d.ts +30 -3
  96. package/dist/api/vpcgw/v1/api.gen.cjs +6 -0
  97. package/dist/api/vpcgw/v1/api.gen.d.ts +2 -1
  98. package/dist/api/vpcgw/v1/api.gen.js +6 -0
  99. package/dist/api/vpcgw/v1/index.gen.d.ts +1 -1
  100. package/dist/api/vpcgw/v1/types.gen.d.ts +5 -0
  101. package/dist/api/webhosting/index.gen.cjs +0 -2
  102. package/dist/api/webhosting/index.gen.d.ts +0 -1
  103. package/dist/api/webhosting/index.gen.js +1 -3
  104. package/dist/api/webhosting/v1/content.gen.cjs +0 -6
  105. package/dist/api/webhosting/v1/content.gen.d.ts +1 -3
  106. package/dist/api/webhosting/v1/content.gen.js +0 -6
  107. package/dist/api/webhosting/v1/index.gen.cjs +0 -1
  108. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  109. package/dist/api/webhosting/v1/index.gen.js +1 -2
  110. package/dist/api/webhosting/v1/marshalling.gen.cjs +5 -2
  111. package/dist/api/webhosting/v1/marshalling.gen.js +5 -2
  112. package/dist/api/webhosting/v1/types.gen.d.ts +12 -7
  113. package/dist/scw/constants.cjs +1 -1
  114. package/dist/scw/constants.d.ts +2 -2
  115. package/dist/scw/constants.js +1 -1
  116. package/package.json +2 -2
  117. package/dist/api/webhosting/v1alpha1/api.gen.cjs +0 -339
  118. package/dist/api/webhosting/v1alpha1/api.gen.d.ts +0 -168
  119. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -339
  120. package/dist/api/webhosting/v1alpha1/content.gen.cjs +0 -8
  121. package/dist/api/webhosting/v1alpha1/content.gen.d.ts +0 -3
  122. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -8
  123. package/dist/api/webhosting/v1alpha1/index.gen.d.ts +0 -4
  124. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -9
  125. package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +0 -300
  126. package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +0 -17
  127. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -300
  128. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +0 -480
  129. package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +0 -32
  130. package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +0 -27
  131. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -32
@@ -0,0 +1,808 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const json = require("../../../helpers/json.cjs");
4
+ const customMarshalling = require("../../../scw/custom-marshalling.cjs");
5
+ const marshalling = require("../../../helpers/marshalling.cjs");
6
+ const unmarshalScalewayLb = (data) => {
7
+ if (!json.isJSONObject(data)) {
8
+ throw new TypeError(
9
+ `Unmarshalling the type 'ScalewayLb' failed as data isn't a dictionary.`
10
+ );
11
+ }
12
+ return {
13
+ domainName: data.domain_name,
14
+ frontendId: data.frontend_id,
15
+ id: data.id,
16
+ isSsl: data.is_ssl,
17
+ zone: data.zone
18
+ };
19
+ };
20
+ const unmarshalScalewayLbBackendConfig = (data) => {
21
+ if (!json.isJSONObject(data)) {
22
+ throw new TypeError(
23
+ `Unmarshalling the type 'ScalewayLbBackendConfig' failed as data isn't a dictionary.`
24
+ );
25
+ }
26
+ return {
27
+ lbs: marshalling.unmarshalArrayOfObject(data.lbs, unmarshalScalewayLb)
28
+ };
29
+ };
30
+ const unmarshalScalewayS3BackendConfig = (data) => {
31
+ if (!json.isJSONObject(data)) {
32
+ throw new TypeError(
33
+ `Unmarshalling the type 'ScalewayS3BackendConfig' failed as data isn't a dictionary.`
34
+ );
35
+ }
36
+ return {
37
+ bucketName: data.bucket_name,
38
+ bucketRegion: data.bucket_region,
39
+ isWebsite: data.is_website
40
+ };
41
+ };
42
+ const unmarshalBackendStage = (data) => {
43
+ if (!json.isJSONObject(data)) {
44
+ throw new TypeError(
45
+ `Unmarshalling the type 'BackendStage' failed as data isn't a dictionary.`
46
+ );
47
+ }
48
+ return {
49
+ createdAt: marshalling.unmarshalDate(data.created_at),
50
+ id: data.id,
51
+ pipelineId: data.pipeline_id,
52
+ scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : void 0,
53
+ scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : void 0,
54
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
55
+ };
56
+ };
57
+ const unmarshalCacheStage = (data) => {
58
+ if (!json.isJSONObject(data)) {
59
+ throw new TypeError(
60
+ `Unmarshalling the type 'CacheStage' failed as data isn't a dictionary.`
61
+ );
62
+ }
63
+ return {
64
+ backendStageId: data.backend_stage_id,
65
+ createdAt: marshalling.unmarshalDate(data.created_at),
66
+ fallbackTtl: data.fallback_ttl,
67
+ id: data.id,
68
+ pipelineId: data.pipeline_id,
69
+ routeStageId: data.route_stage_id,
70
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
71
+ wafStageId: data.waf_stage_id
72
+ };
73
+ };
74
+ const unmarshalDNSStage = (data) => {
75
+ if (!json.isJSONObject(data)) {
76
+ throw new TypeError(
77
+ `Unmarshalling the type 'DNSStage' failed as data isn't a dictionary.`
78
+ );
79
+ }
80
+ return {
81
+ backendStageId: data.backend_stage_id,
82
+ cacheStageId: data.cache_stage_id,
83
+ createdAt: marshalling.unmarshalDate(data.created_at),
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: marshalling.unmarshalDate(data.updated_at)
90
+ };
91
+ };
92
+ const unmarshalPipelineError = (data) => {
93
+ if (!json.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 (!json.isJSONObject(data)) {
108
+ throw new TypeError(
109
+ `Unmarshalling the type 'Pipeline' failed as data isn't a dictionary.`
110
+ );
111
+ }
112
+ return {
113
+ createdAt: marshalling.unmarshalDate(data.created_at),
114
+ description: data.description,
115
+ errors: marshalling.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: marshalling.unmarshalDate(data.updated_at)
122
+ };
123
+ };
124
+ const unmarshalRouteStage = (data) => {
125
+ if (!json.isJSONObject(data)) {
126
+ throw new TypeError(
127
+ `Unmarshalling the type 'RouteStage' failed as data isn't a dictionary.`
128
+ );
129
+ }
130
+ return {
131
+ createdAt: marshalling.unmarshalDate(data.created_at),
132
+ id: data.id,
133
+ pipelineId: data.pipeline_id,
134
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
135
+ wafStageId: data.waf_stage_id
136
+ };
137
+ };
138
+ const unmarshalTLSSecret = (data) => {
139
+ if (!json.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 (!json.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: marshalling.unmarshalDate(data.certificate_expires_at),
159
+ createdAt: marshalling.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: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalTLSSecret),
165
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
166
+ wafStageId: data.waf_stage_id
167
+ };
168
+ };
169
+ const unmarshalWafStage = (data) => {
170
+ if (!json.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: marshalling.unmarshalDate(data.created_at),
178
+ id: data.id,
179
+ mode: data.mode,
180
+ paranoiaLevel: data.paranoia_level,
181
+ pipelineId: data.pipeline_id,
182
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
183
+ };
184
+ };
185
+ const unmarshalPipelineStages = (data) => {
186
+ if (!json.isJSONObject(data)) {
187
+ throw new TypeError(
188
+ `Unmarshalling the type 'PipelineStages' failed as data isn't a dictionary.`
189
+ );
190
+ }
191
+ return {
192
+ backendStages: marshalling.unmarshalArrayOfObject(
193
+ data.backend_stages,
194
+ unmarshalBackendStage
195
+ ),
196
+ cacheStages: marshalling.unmarshalArrayOfObject(data.cache_stages, unmarshalCacheStage),
197
+ dnsStages: marshalling.unmarshalArrayOfObject(data.dns_stages, unmarshalDNSStage),
198
+ pipeline: data.pipeline ? unmarshalPipeline(data.pipeline) : void 0,
199
+ routeStages: marshalling.unmarshalArrayOfObject(data.route_stages, unmarshalRouteStage),
200
+ tlsStages: marshalling.unmarshalArrayOfObject(data.tls_stages, unmarshalTLSStage),
201
+ wafStages: marshalling.unmarshalArrayOfObject(data.waf_stages, unmarshalWafStage)
202
+ };
203
+ };
204
+ const unmarshalPurgeRequest = (data) => {
205
+ if (!json.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: marshalling.unmarshalDate(data.created_at),
214
+ id: data.id,
215
+ pipelineId: data.pipeline_id,
216
+ status: data.status,
217
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
218
+ };
219
+ };
220
+ const unmarshalRuleHttpMatchPathFilter = (data) => {
221
+ if (!json.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 (!json.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 (!json.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 (!json.isJSONObject(data)) {
257
+ throw new TypeError(
258
+ `Unmarshalling the type 'AddRouteRulesResponse' failed as data isn't a dictionary.`
259
+ );
260
+ }
261
+ return {
262
+ routeRules: marshalling.unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule)
263
+ };
264
+ };
265
+ const unmarshalCheckDomainResponse = (data) => {
266
+ if (!json.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 (!json.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 (!json.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 (!json.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 (!json.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 ? customMarshalling.unmarshalMoney(data.plan_cost) : void 0
317
+ };
318
+ };
319
+ const unmarshalGetBillingResponse = (data) => {
320
+ if (!json.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 ? customMarshalling.unmarshalMoney(data.extra_cache_cost) : void 0,
330
+ extraCacheUsage: data.extra_cache_usage,
331
+ extraPipelinesCost: data.extra_pipelines_cost ? customMarshalling.unmarshalMoney(data.extra_pipelines_cost) : void 0,
332
+ extraWafCost: data.extra_waf_cost ? customMarshalling.unmarshalMoney(data.extra_waf_cost) : void 0,
333
+ extraWafUsage: data.extra_waf_usage,
334
+ pipelineNumber: data.pipeline_number,
335
+ planCost: data.plan_cost ? customMarshalling.unmarshalMoney(data.plan_cost) : void 0,
336
+ plansUsageDetails: marshalling.unmarshalMapOfObject(
337
+ data.plans_usage_details,
338
+ unmarshalPlanUsageDetails
339
+ ),
340
+ totalCost: data.total_cost ? customMarshalling.unmarshalMoney(data.total_cost) : void 0,
341
+ wafAddOn: data.waf_add_on ? customMarshalling.unmarshalMoney(data.waf_add_on) : void 0
342
+ };
343
+ };
344
+ const unmarshalHeadStageResponseHeadStage = (data) => {
345
+ if (!json.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 (!json.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 (!json.isJSONObject(data)) {
366
+ throw new TypeError(
367
+ `Unmarshalling the type 'ListBackendStagesResponse' failed as data isn't a dictionary.`
368
+ );
369
+ }
370
+ return {
371
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalBackendStage),
372
+ totalCount: data.total_count
373
+ };
374
+ };
375
+ const unmarshalListCacheStagesResponse = (data) => {
376
+ if (!json.isJSONObject(data)) {
377
+ throw new TypeError(
378
+ `Unmarshalling the type 'ListCacheStagesResponse' failed as data isn't a dictionary.`
379
+ );
380
+ }
381
+ return {
382
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalCacheStage),
383
+ totalCount: data.total_count
384
+ };
385
+ };
386
+ const unmarshalListDNSStagesResponse = (data) => {
387
+ if (!json.isJSONObject(data)) {
388
+ throw new TypeError(
389
+ `Unmarshalling the type 'ListDNSStagesResponse' failed as data isn't a dictionary.`
390
+ );
391
+ }
392
+ return {
393
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalDNSStage),
394
+ totalCount: data.total_count
395
+ };
396
+ };
397
+ const unmarshalListHeadStagesResponseHeadStage = (data) => {
398
+ if (!json.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 (!json.isJSONObject(data)) {
409
+ throw new TypeError(
410
+ `Unmarshalling the type 'ListHeadStagesResponse' failed as data isn't a dictionary.`
411
+ );
412
+ }
413
+ return {
414
+ headStages: marshalling.unmarshalArrayOfObject(
415
+ data.head_stages,
416
+ unmarshalListHeadStagesResponseHeadStage
417
+ ),
418
+ totalCount: data.total_count
419
+ };
420
+ };
421
+ const unmarshalListPipelinesResponse = (data) => {
422
+ if (!json.isJSONObject(data)) {
423
+ throw new TypeError(
424
+ `Unmarshalling the type 'ListPipelinesResponse' failed as data isn't a dictionary.`
425
+ );
426
+ }
427
+ return {
428
+ pipelines: marshalling.unmarshalArrayOfObject(data.pipelines, unmarshalPipeline),
429
+ totalCount: data.total_count
430
+ };
431
+ };
432
+ const unmarshalListPipelinesWithStagesResponse = (data) => {
433
+ if (!json.isJSONObject(data)) {
434
+ throw new TypeError(
435
+ `Unmarshalling the type 'ListPipelinesWithStagesResponse' failed as data isn't a dictionary.`
436
+ );
437
+ }
438
+ return {
439
+ pipelines: marshalling.unmarshalArrayOfObject(data.pipelines, unmarshalPipelineStages),
440
+ totalCount: data.total_count
441
+ };
442
+ };
443
+ const unmarshalListPlansResponse = (data) => {
444
+ if (!json.isJSONObject(data)) {
445
+ throw new TypeError(
446
+ `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`
447
+ );
448
+ }
449
+ return {
450
+ plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlanDetails),
451
+ totalCount: data.total_count
452
+ };
453
+ };
454
+ const unmarshalListPurgeRequestsResponse = (data) => {
455
+ if (!json.isJSONObject(data)) {
456
+ throw new TypeError(
457
+ `Unmarshalling the type 'ListPurgeRequestsResponse' failed as data isn't a dictionary.`
458
+ );
459
+ }
460
+ return {
461
+ purgeRequests: marshalling.unmarshalArrayOfObject(
462
+ data.purge_requests,
463
+ unmarshalPurgeRequest
464
+ ),
465
+ totalCount: data.total_count
466
+ };
467
+ };
468
+ const unmarshalListRouteRulesResponse = (data) => {
469
+ if (!json.isJSONObject(data)) {
470
+ throw new TypeError(
471
+ `Unmarshalling the type 'ListRouteRulesResponse' failed as data isn't a dictionary.`
472
+ );
473
+ }
474
+ return {
475
+ routeRules: marshalling.unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule)
476
+ };
477
+ };
478
+ const unmarshalListRouteStagesResponse = (data) => {
479
+ if (!json.isJSONObject(data)) {
480
+ throw new TypeError(
481
+ `Unmarshalling the type 'ListRouteStagesResponse' failed as data isn't a dictionary.`
482
+ );
483
+ }
484
+ return {
485
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalRouteStage),
486
+ totalCount: data.total_count
487
+ };
488
+ };
489
+ const unmarshalListTLSStagesResponse = (data) => {
490
+ if (!json.isJSONObject(data)) {
491
+ throw new TypeError(
492
+ `Unmarshalling the type 'ListTLSStagesResponse' failed as data isn't a dictionary.`
493
+ );
494
+ }
495
+ return {
496
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalTLSStage),
497
+ totalCount: data.total_count
498
+ };
499
+ };
500
+ const unmarshalListWafStagesResponse = (data) => {
501
+ if (!json.isJSONObject(data)) {
502
+ throw new TypeError(
503
+ `Unmarshalling the type 'ListWafStagesResponse' failed as data isn't a dictionary.`
504
+ );
505
+ }
506
+ return {
507
+ stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalWafStage),
508
+ totalCount: data.total_count
509
+ };
510
+ };
511
+ const unmarshalPlan = (data) => {
512
+ if (!json.isJSONObject(data)) {
513
+ throw new TypeError(
514
+ `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`
515
+ );
516
+ }
517
+ return {
518
+ planName: data.plan_name
519
+ };
520
+ };
521
+ const unmarshalSetRouteRulesResponse = (data) => {
522
+ if (!json.isJSONObject(data)) {
523
+ throw new TypeError(
524
+ `Unmarshalling the type 'SetRouteRulesResponse' failed as data isn't a dictionary.`
525
+ );
526
+ }
527
+ return {
528
+ routeRules: marshalling.unmarshalArrayOfObject(data.route_rules, unmarshalRouteRule)
529
+ };
530
+ };
531
+ const marshalRuleHttpMatchPathFilter = (request, defaults) => ({
532
+ path_filter_type: request.pathFilterType,
533
+ value: request.value
534
+ });
535
+ const marshalRuleHttpMatch = (request, defaults) => ({
536
+ method_filters: request.methodFilters,
537
+ path_filter: request.pathFilter !== void 0 ? marshalRuleHttpMatchPathFilter(request.pathFilter) : void 0
538
+ });
539
+ const marshalSetRouteRulesRequestRouteRule = (request, defaults) => ({
540
+ ...marshalling.resolveOneOf([
541
+ {
542
+ param: "rule_http_match",
543
+ value: request.ruleHttpMatch !== void 0 ? marshalRuleHttpMatch(request.ruleHttpMatch) : void 0
544
+ }
545
+ ]),
546
+ ...marshalling.resolveOneOf([
547
+ { param: "backend_stage_id", value: request.backendStageId }
548
+ ])
549
+ });
550
+ const marshalAddRouteRulesRequest = (request, defaults) => ({
551
+ route_rules: request.routeRules !== void 0 ? request.routeRules.map(
552
+ (elt) => marshalSetRouteRulesRequestRouteRule(elt)
553
+ ) : void 0,
554
+ ...marshalling.resolveOneOf([
555
+ { param: "after_position", value: request.afterPosition },
556
+ { param: "before_position", value: request.beforePosition }
557
+ ])
558
+ });
559
+ const marshalCheckDomainRequest = (request, defaults) => ({
560
+ cname: request.cname,
561
+ fqdn: request.fqdn,
562
+ project_id: request.projectId ?? defaults.defaultProjectId
563
+ });
564
+ const marshalScalewayLb = (request, defaults) => ({
565
+ domain_name: request.domainName,
566
+ frontend_id: request.frontendId,
567
+ id: request.id,
568
+ is_ssl: request.isSsl,
569
+ zone: request.zone
570
+ });
571
+ const marshalCheckLbOriginRequest = (request, defaults) => ({
572
+ lb: request.lb !== void 0 ? marshalScalewayLb(request.lb) : void 0
573
+ });
574
+ const marshalCheckPEMChainRequestSecretChain = (request, defaults) => ({
575
+ secret_id: request.secretId,
576
+ secret_region: request.secretRegion
577
+ });
578
+ const marshalCheckPEMChainRequest = (request, defaults) => ({
579
+ fqdn: request.fqdn,
580
+ project_id: request.projectId ?? defaults.defaultProjectId,
581
+ ...marshalling.resolveOneOf([
582
+ {
583
+ param: "secret",
584
+ value: request.secret !== void 0 ? marshalCheckPEMChainRequestSecretChain(request.secret) : void 0
585
+ },
586
+ { param: "raw", value: request.raw }
587
+ ])
588
+ });
589
+ const marshalScalewayLbBackendConfig = (request, defaults) => ({
590
+ lbs: request.lbs.map((elt) => marshalScalewayLb(elt))
591
+ });
592
+ const marshalScalewayS3BackendConfig = (request, defaults) => ({
593
+ bucket_name: request.bucketName,
594
+ bucket_region: request.bucketRegion,
595
+ is_website: request.isWebsite
596
+ });
597
+ const marshalCreateBackendStageRequest = (request, defaults) => ({
598
+ ...marshalling.resolveOneOf([
599
+ {
600
+ param: "scaleway_s3",
601
+ value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0
602
+ },
603
+ {
604
+ param: "scaleway_lb",
605
+ value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0
606
+ }
607
+ ])
608
+ });
609
+ const marshalCreateCacheStageRequest = (request, defaults) => ({
610
+ fallback_ttl: request.fallbackTtl,
611
+ ...marshalling.resolveOneOf([
612
+ { param: "backend_stage_id", value: request.backendStageId },
613
+ { param: "waf_stage_id", value: request.wafStageId },
614
+ { param: "route_stage_id", value: request.routeStageId }
615
+ ])
616
+ });
617
+ const marshalCreateDNSStageRequest = (request, defaults) => ({
618
+ fqdns: request.fqdns,
619
+ ...marshalling.resolveOneOf([
620
+ { param: "tls_stage_id", value: request.tlsStageId },
621
+ { param: "cache_stage_id", value: request.cacheStageId },
622
+ { param: "backend_stage_id", value: request.backendStageId }
623
+ ])
624
+ });
625
+ const marshalCreatePipelineRequest = (request, defaults) => ({
626
+ description: request.description,
627
+ name: request.name,
628
+ project_id: request.projectId ?? defaults.defaultProjectId
629
+ });
630
+ const marshalCreatePurgeRequestRequest = (request, defaults) => ({
631
+ pipeline_id: request.pipelineId,
632
+ ...marshalling.resolveOneOf([
633
+ { param: "assets", value: request.assets },
634
+ { param: "all", value: request.all }
635
+ ])
636
+ });
637
+ const marshalCreateRouteStageRequest = (request, defaults) => ({
638
+ ...marshalling.resolveOneOf([{ param: "waf_stage_id", value: request.wafStageId }])
639
+ });
640
+ const marshalTLSSecret = (request, defaults) => ({
641
+ region: request.region,
642
+ secret_id: request.secretId
643
+ });
644
+ const marshalCreateTLSStageRequest = (request, defaults) => ({
645
+ managed_certificate: request.managedCertificate,
646
+ secrets: request.secrets !== void 0 ? request.secrets.map((elt) => marshalTLSSecret(elt)) : void 0,
647
+ ...marshalling.resolveOneOf([
648
+ { param: "cache_stage_id", value: request.cacheStageId },
649
+ { param: "backend_stage_id", value: request.backendStageId },
650
+ { param: "route_stage_id", value: request.routeStageId },
651
+ { param: "waf_stage_id", value: request.wafStageId }
652
+ ])
653
+ });
654
+ const marshalCreateWafStageRequest = (request, defaults) => ({
655
+ mode: request.mode,
656
+ paranoia_level: request.paranoiaLevel,
657
+ ...marshalling.resolveOneOf([
658
+ { param: "backend_stage_id", value: request.backendStageId }
659
+ ])
660
+ });
661
+ const marshalSelectPlanRequest = (request, defaults) => ({
662
+ plan_name: request.planName,
663
+ project_id: request.projectId ?? defaults.defaultProjectId
664
+ });
665
+ const marshalSetHeadStageRequestAddNewHeadStage = (request, defaults) => ({
666
+ new_stage_id: request.newStageId
667
+ });
668
+ const marshalSetHeadStageRequestRemoveHeadStage = (request, defaults) => ({
669
+ remove_stage_id: request.removeStageId
670
+ });
671
+ const marshalSetHeadStageRequestSwapHeadStage = (request, defaults) => ({
672
+ current_stage_id: request.currentStageId,
673
+ new_stage_id: request.newStageId
674
+ });
675
+ const marshalSetHeadStageRequest = (request, defaults) => ({
676
+ ...marshalling.resolveOneOf([
677
+ {
678
+ param: "add_new_head_stage",
679
+ value: request.addNewHeadStage !== void 0 ? marshalSetHeadStageRequestAddNewHeadStage(
680
+ request.addNewHeadStage
681
+ ) : void 0
682
+ },
683
+ {
684
+ param: "remove_head_stage",
685
+ value: request.removeHeadStage !== void 0 ? marshalSetHeadStageRequestRemoveHeadStage(
686
+ request.removeHeadStage
687
+ ) : void 0
688
+ },
689
+ {
690
+ param: "swap_head_stage",
691
+ value: request.swapHeadStage !== void 0 ? marshalSetHeadStageRequestSwapHeadStage(
692
+ request.swapHeadStage
693
+ ) : void 0
694
+ }
695
+ ])
696
+ });
697
+ const marshalSetRouteRulesRequest = (request, defaults) => ({
698
+ route_rules: request.routeRules !== void 0 ? request.routeRules.map(
699
+ (elt) => marshalSetRouteRulesRequestRouteRule(elt)
700
+ ) : void 0
701
+ });
702
+ const marshalUpdateBackendStageRequest = (request, defaults) => ({
703
+ pipeline_id: request.pipelineId,
704
+ ...marshalling.resolveOneOf([
705
+ {
706
+ param: "scaleway_s3",
707
+ value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0
708
+ },
709
+ {
710
+ param: "scaleway_lb",
711
+ value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0
712
+ }
713
+ ])
714
+ });
715
+ const marshalUpdateCacheStageRequest = (request, defaults) => ({
716
+ fallback_ttl: request.fallbackTtl,
717
+ ...marshalling.resolveOneOf([
718
+ { param: "backend_stage_id", value: request.backendStageId },
719
+ { param: "waf_stage_id", value: request.wafStageId },
720
+ { param: "route_stage_id", value: request.routeStageId }
721
+ ])
722
+ });
723
+ const marshalUpdateDNSStageRequest = (request, defaults) => ({
724
+ fqdns: request.fqdns,
725
+ ...marshalling.resolveOneOf([
726
+ { param: "tls_stage_id", value: request.tlsStageId },
727
+ { param: "cache_stage_id", value: request.cacheStageId },
728
+ { param: "backend_stage_id", value: request.backendStageId }
729
+ ])
730
+ });
731
+ const marshalUpdatePipelineRequest = (request, defaults) => ({
732
+ description: request.description,
733
+ name: request.name
734
+ });
735
+ const marshalUpdateRouteStageRequest = (request, defaults) => ({
736
+ ...marshalling.resolveOneOf([{ param: "waf_stage_id", value: request.wafStageId }])
737
+ });
738
+ const marshalTLSSecretsConfig = (request, defaults) => ({
739
+ tls_secrets: request.tlsSecrets.map((elt) => marshalTLSSecret(elt))
740
+ });
741
+ const marshalUpdateTLSStageRequest = (request, defaults) => ({
742
+ managed_certificate: request.managedCertificate,
743
+ tls_secrets_config: request.tlsSecretsConfig !== void 0 ? marshalTLSSecretsConfig(request.tlsSecretsConfig) : void 0,
744
+ ...marshalling.resolveOneOf([
745
+ { param: "cache_stage_id", value: request.cacheStageId },
746
+ { param: "backend_stage_id", value: request.backendStageId },
747
+ { param: "route_stage_id", value: request.routeStageId },
748
+ { param: "waf_stage_id", value: request.wafStageId }
749
+ ])
750
+ });
751
+ const marshalUpdateWafStageRequest = (request, defaults) => ({
752
+ mode: request.mode,
753
+ paranoia_level: request.paranoiaLevel,
754
+ ...marshalling.resolveOneOf([
755
+ { param: "backend_stage_id", value: request.backendStageId }
756
+ ])
757
+ });
758
+ exports.marshalAddRouteRulesRequest = marshalAddRouteRulesRequest;
759
+ exports.marshalCheckDomainRequest = marshalCheckDomainRequest;
760
+ exports.marshalCheckLbOriginRequest = marshalCheckLbOriginRequest;
761
+ exports.marshalCheckPEMChainRequest = marshalCheckPEMChainRequest;
762
+ exports.marshalCreateBackendStageRequest = marshalCreateBackendStageRequest;
763
+ exports.marshalCreateCacheStageRequest = marshalCreateCacheStageRequest;
764
+ exports.marshalCreateDNSStageRequest = marshalCreateDNSStageRequest;
765
+ exports.marshalCreatePipelineRequest = marshalCreatePipelineRequest;
766
+ exports.marshalCreatePurgeRequestRequest = marshalCreatePurgeRequestRequest;
767
+ exports.marshalCreateRouteStageRequest = marshalCreateRouteStageRequest;
768
+ exports.marshalCreateTLSStageRequest = marshalCreateTLSStageRequest;
769
+ exports.marshalCreateWafStageRequest = marshalCreateWafStageRequest;
770
+ exports.marshalSelectPlanRequest = marshalSelectPlanRequest;
771
+ exports.marshalSetHeadStageRequest = marshalSetHeadStageRequest;
772
+ exports.marshalSetRouteRulesRequest = marshalSetRouteRulesRequest;
773
+ exports.marshalUpdateBackendStageRequest = marshalUpdateBackendStageRequest;
774
+ exports.marshalUpdateCacheStageRequest = marshalUpdateCacheStageRequest;
775
+ exports.marshalUpdateDNSStageRequest = marshalUpdateDNSStageRequest;
776
+ exports.marshalUpdatePipelineRequest = marshalUpdatePipelineRequest;
777
+ exports.marshalUpdateRouteStageRequest = marshalUpdateRouteStageRequest;
778
+ exports.marshalUpdateTLSStageRequest = marshalUpdateTLSStageRequest;
779
+ exports.marshalUpdateWafStageRequest = marshalUpdateWafStageRequest;
780
+ exports.unmarshalAddRouteRulesResponse = unmarshalAddRouteRulesResponse;
781
+ exports.unmarshalBackendStage = unmarshalBackendStage;
782
+ exports.unmarshalCacheStage = unmarshalCacheStage;
783
+ exports.unmarshalCheckDomainResponse = unmarshalCheckDomainResponse;
784
+ exports.unmarshalCheckLbOriginResponse = unmarshalCheckLbOriginResponse;
785
+ exports.unmarshalCheckPEMChainResponse = unmarshalCheckPEMChainResponse;
786
+ exports.unmarshalDNSStage = unmarshalDNSStage;
787
+ exports.unmarshalGetBillingResponse = unmarshalGetBillingResponse;
788
+ exports.unmarshalHeadStageResponse = unmarshalHeadStageResponse;
789
+ exports.unmarshalListBackendStagesResponse = unmarshalListBackendStagesResponse;
790
+ exports.unmarshalListCacheStagesResponse = unmarshalListCacheStagesResponse;
791
+ exports.unmarshalListDNSStagesResponse = unmarshalListDNSStagesResponse;
792
+ exports.unmarshalListHeadStagesResponse = unmarshalListHeadStagesResponse;
793
+ exports.unmarshalListPipelinesResponse = unmarshalListPipelinesResponse;
794
+ exports.unmarshalListPipelinesWithStagesResponse = unmarshalListPipelinesWithStagesResponse;
795
+ exports.unmarshalListPlansResponse = unmarshalListPlansResponse;
796
+ exports.unmarshalListPurgeRequestsResponse = unmarshalListPurgeRequestsResponse;
797
+ exports.unmarshalListRouteRulesResponse = unmarshalListRouteRulesResponse;
798
+ exports.unmarshalListRouteStagesResponse = unmarshalListRouteStagesResponse;
799
+ exports.unmarshalListTLSStagesResponse = unmarshalListTLSStagesResponse;
800
+ exports.unmarshalListWafStagesResponse = unmarshalListWafStagesResponse;
801
+ exports.unmarshalPipeline = unmarshalPipeline;
802
+ exports.unmarshalPipelineStages = unmarshalPipelineStages;
803
+ exports.unmarshalPlan = unmarshalPlan;
804
+ exports.unmarshalPurgeRequest = unmarshalPurgeRequest;
805
+ exports.unmarshalRouteStage = unmarshalRouteStage;
806
+ exports.unmarshalSetRouteRulesResponse = unmarshalSetRouteRulesResponse;
807
+ exports.unmarshalTLSStage = unmarshalTLSStage;
808
+ exports.unmarshalWafStage = unmarshalWafStage;