@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,872 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends sdkClient.API {
10
+ pageOfListPipelines = (request = {}) => this.client.fetch(
11
+ {
12
+ method: "GET",
13
+ path: `/edge-services/v1beta1/pipelines`,
14
+ urlParams: sdkClient.urlParams(
15
+ ["has_backend_stage_lb", request.hasBackendStageLb],
16
+ ["name", request.name],
17
+ ["order_by", request.orderBy],
18
+ ["organization_id", request.organizationId],
19
+ ["page", request.page],
20
+ [
21
+ "page_size",
22
+ request.pageSize ?? this.client.settings.defaultPageSize
23
+ ],
24
+ ["project_id", request.projectId]
25
+ )
26
+ },
27
+ marshalling_gen.unmarshalListPipelinesResponse
28
+ );
29
+ /**
30
+ * List pipelines. List all pipelines, for a Scaleway Organization or Scaleway Project. By default, the pipelines returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
31
+ *
32
+ * @param request - The request {@link ListPipelinesRequest}
33
+ * @returns A Promise of ListPipelinesResponse
34
+ */
35
+ listPipelines = (request = {}) => sdkClient.enrichForPagination("pipelines", this.pageOfListPipelines, request);
36
+ /**
37
+ * Create pipeline. Create a new pipeline. You must specify a `dns_stage_id` to form a stage-chain that goes all the way to the backend stage (origin), so the HTTP request will be processed according to the stages you created.
38
+ *
39
+ * @param request - The request {@link CreatePipelineRequest}
40
+ * @returns A Promise of Pipeline
41
+ */
42
+ createPipeline = (request) => this.client.fetch(
43
+ {
44
+ body: JSON.stringify(
45
+ marshalling_gen.marshalCreatePipelineRequest(request, this.client.settings)
46
+ ),
47
+ headers: jsonContentHeaders,
48
+ method: "POST",
49
+ path: `/edge-services/v1beta1/pipelines`
50
+ },
51
+ marshalling_gen.unmarshalPipeline
52
+ );
53
+ /**
54
+ * Get pipeline. Retrieve information about an existing pipeline, specified by its `pipeline_id`. Its full details, including errors, are returned in the response object.
55
+ *
56
+ * @param request - The request {@link GetPipelineRequest}
57
+ * @returns A Promise of Pipeline
58
+ */
59
+ getPipeline = (request) => this.client.fetch(
60
+ {
61
+ method: "GET",
62
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}`
63
+ },
64
+ marshalling_gen.unmarshalPipeline
65
+ );
66
+ /**
67
+ * Waits for {@link Pipeline} to be in a final state.
68
+ *
69
+ * @param request - The request {@link GetPipelineRequest}
70
+ * @param options - The waiting options
71
+ * @returns A Promise of Pipeline
72
+ */
73
+ waitForPipeline = (request, options) => sdkClient.waitForResource(
74
+ options?.stop ?? ((res) => Promise.resolve(
75
+ !content_gen.PIPELINE_TRANSIENT_STATUSES.includes(res.status)
76
+ )),
77
+ this.getPipeline,
78
+ request,
79
+ options
80
+ );
81
+ pageOfListPipelinesWithStages = (request = {}) => this.client.fetch(
82
+ {
83
+ method: "GET",
84
+ path: `/edge-services/v1beta1/pipelines-stages`,
85
+ urlParams: sdkClient.urlParams(
86
+ ["name", request.name],
87
+ ["order_by", request.orderBy],
88
+ ["organization_id", request.organizationId],
89
+ ["page", request.page],
90
+ [
91
+ "page_size",
92
+ request.pageSize ?? this.client.settings.defaultPageSize
93
+ ],
94
+ ["project_id", request.projectId]
95
+ )
96
+ },
97
+ marshalling_gen.unmarshalListPipelinesWithStagesResponse
98
+ );
99
+ listPipelinesWithStages = (request = {}) => sdkClient.enrichForPagination(
100
+ "pipelines",
101
+ this.pageOfListPipelinesWithStages,
102
+ request
103
+ );
104
+ /**
105
+ * Update pipeline. Update the parameters of an existing pipeline, specified by its `pipeline_id`. Parameters which can be updated include the `name`, `description` and `dns_stage_id`.
106
+ *
107
+ * @param request - The request {@link UpdatePipelineRequest}
108
+ * @returns A Promise of Pipeline
109
+ */
110
+ updatePipeline = (request) => this.client.fetch(
111
+ {
112
+ body: JSON.stringify(
113
+ marshalling_gen.marshalUpdatePipelineRequest(request, this.client.settings)
114
+ ),
115
+ headers: jsonContentHeaders,
116
+ method: "PATCH",
117
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}`
118
+ },
119
+ marshalling_gen.unmarshalPipeline
120
+ );
121
+ /**
122
+ * Delete pipeline. Delete an existing pipeline, specified by its `pipeline_id`. Deleting a pipeline is permanent, and cannot be undone. Note that all stages linked to the pipeline are also deleted.
123
+ *
124
+ * @param request - The request {@link DeletePipelineRequest}
125
+ */
126
+ deletePipeline = (request) => this.client.fetch({
127
+ method: "DELETE",
128
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}`
129
+ });
130
+ pageOfListHeadStages = (request) => this.client.fetch(
131
+ {
132
+ method: "GET",
133
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/head-stages`,
134
+ urlParams: sdkClient.urlParams(
135
+ ["page", request.page],
136
+ [
137
+ "page_size",
138
+ request.pageSize ?? this.client.settings.defaultPageSize
139
+ ]
140
+ )
141
+ },
142
+ marshalling_gen.unmarshalListHeadStagesResponse
143
+ );
144
+ listHeadStages = (request) => sdkClient.enrichForPagination("headStages", this.pageOfListHeadStages, request);
145
+ /**
146
+ * Configure a entry point to your pipeline. You must specify a `head stage` to form a stage-chain that goes all the way to the backend stage (origin), so the HTTP request will be processed according to the stages you created.. You must specify either a `add_new_head_stage` (to add a new head stage), `remove_head_stage` (to remove a head stage) or `swap_head_stage` (to replace a head stage).
147
+ *
148
+ * @param request - The request {@link SetHeadStageRequest}
149
+ * @returns A Promise of HeadStageResponse
150
+ */
151
+ setHeadStage = (request) => this.client.fetch(
152
+ {
153
+ body: JSON.stringify(
154
+ marshalling_gen.marshalSetHeadStageRequest(request, this.client.settings)
155
+ ),
156
+ headers: jsonContentHeaders,
157
+ method: "POST",
158
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/set-head-stage`
159
+ },
160
+ marshalling_gen.unmarshalHeadStageResponse
161
+ );
162
+ pageOfListDNSStages = (request) => this.client.fetch(
163
+ {
164
+ method: "GET",
165
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/dns-stages`,
166
+ urlParams: sdkClient.urlParams(
167
+ ["fqdn", request.fqdn],
168
+ ["order_by", request.orderBy],
169
+ ["page", request.page],
170
+ [
171
+ "page_size",
172
+ request.pageSize ?? this.client.settings.defaultPageSize
173
+ ]
174
+ )
175
+ },
176
+ marshalling_gen.unmarshalListDNSStagesResponse
177
+ );
178
+ /**
179
+ * List DNS stages. List all DNS stages, for a Scaleway Organization or Scaleway Project. By default, the DNS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
180
+ *
181
+ * @param request - The request {@link ListDNSStagesRequest}
182
+ * @returns A Promise of ListDNSStagesResponse
183
+ */
184
+ listDNSStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListDNSStages, request);
185
+ /**
186
+ * Create DNS stage. Create a new DNS stage. You must specify the `fqdns` field to customize the domain endpoint, using a domain you already own.
187
+ *
188
+ * @param request - The request {@link CreateDNSStageRequest}
189
+ * @returns A Promise of DNSStage
190
+ */
191
+ createDNSStage = (request) => this.client.fetch(
192
+ {
193
+ body: JSON.stringify(
194
+ marshalling_gen.marshalCreateDNSStageRequest(request, this.client.settings)
195
+ ),
196
+ headers: jsonContentHeaders,
197
+ method: "POST",
198
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/dns-stages`
199
+ },
200
+ marshalling_gen.unmarshalDNSStage
201
+ );
202
+ /**
203
+ * Get DNS stage. Retrieve information about an existing DNS stage, specified by its `dns_stage_id`. Its full details, including FQDNs, are returned in the response object.
204
+ *
205
+ * @param request - The request {@link GetDNSStageRequest}
206
+ * @returns A Promise of DNSStage
207
+ */
208
+ getDNSStage = (request) => this.client.fetch(
209
+ {
210
+ method: "GET",
211
+ path: `/edge-services/v1beta1/dns-stages/${sdkClient.validatePathParam("dnsStageId", request.dnsStageId)}`
212
+ },
213
+ marshalling_gen.unmarshalDNSStage
214
+ );
215
+ /**
216
+ * Update DNS stage. Update the parameters of an existing DNS stage, specified by its `dns_stage_id`.
217
+ *
218
+ * @param request - The request {@link UpdateDNSStageRequest}
219
+ * @returns A Promise of DNSStage
220
+ */
221
+ updateDNSStage = (request) => this.client.fetch(
222
+ {
223
+ body: JSON.stringify(
224
+ marshalling_gen.marshalUpdateDNSStageRequest(request, this.client.settings)
225
+ ),
226
+ headers: jsonContentHeaders,
227
+ method: "PATCH",
228
+ path: `/edge-services/v1beta1/dns-stages/${sdkClient.validatePathParam("dnsStageId", request.dnsStageId)}`
229
+ },
230
+ marshalling_gen.unmarshalDNSStage
231
+ );
232
+ /**
233
+ * Delete DNS stage. Delete an existing DNS stage, specified by its `dns_stage_id`. Deleting a DNS stage is permanent, and cannot be undone.
234
+ *
235
+ * @param request - The request {@link DeleteDNSStageRequest}
236
+ */
237
+ deleteDNSStage = (request) => this.client.fetch({
238
+ method: "DELETE",
239
+ path: `/edge-services/v1beta1/dns-stages/${sdkClient.validatePathParam("dnsStageId", request.dnsStageId)}`
240
+ });
241
+ pageOfListTLSStages = (request) => this.client.fetch(
242
+ {
243
+ method: "GET",
244
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/tls-stages`,
245
+ urlParams: sdkClient.urlParams(
246
+ ["order_by", request.orderBy],
247
+ ["page", request.page],
248
+ [
249
+ "page_size",
250
+ request.pageSize ?? this.client.settings.defaultPageSize
251
+ ],
252
+ ["secret_id", request.secretId],
253
+ ["secret_region", request.secretRegion]
254
+ )
255
+ },
256
+ marshalling_gen.unmarshalListTLSStagesResponse
257
+ );
258
+ /**
259
+ * List TLS stages. List all TLS stages, for a Scaleway Organization or Scaleway Project. By default, the TLS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
260
+ *
261
+ * @param request - The request {@link ListTLSStagesRequest}
262
+ * @returns A Promise of ListTLSStagesResponse
263
+ */
264
+ listTLSStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListTLSStages, request);
265
+ /**
266
+ * Create TLS stage. Create a new TLS stage. You must specify either the `secrets` or `managed_certificate` fields to customize the SSL/TLS certificate of your endpoint. Choose `secrets` if you are using a pre-existing certificate held in Scaleway Secret Manager, or `managed_certificate` to let Scaleway generate and manage a Let's Encrypt certificate for your customized endpoint.
267
+ *
268
+ * @param request - The request {@link CreateTLSStageRequest}
269
+ * @returns A Promise of TLSStage
270
+ */
271
+ createTLSStage = (request) => this.client.fetch(
272
+ {
273
+ body: JSON.stringify(
274
+ marshalling_gen.marshalCreateTLSStageRequest(request, this.client.settings)
275
+ ),
276
+ headers: jsonContentHeaders,
277
+ method: "POST",
278
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/tls-stages`
279
+ },
280
+ marshalling_gen.unmarshalTLSStage
281
+ );
282
+ /**
283
+ * Get TLS stage. Retrieve information about an existing TLS stage, specified by its `tls_stage_id`. Its full details, including secrets and certificate expiration date are returned in the response object.
284
+ *
285
+ * @param request - The request {@link GetTLSStageRequest}
286
+ * @returns A Promise of TLSStage
287
+ */
288
+ getTLSStage = (request) => this.client.fetch(
289
+ {
290
+ method: "GET",
291
+ path: `/edge-services/v1beta1/tls-stages/${sdkClient.validatePathParam("tlsStageId", request.tlsStageId)}`
292
+ },
293
+ marshalling_gen.unmarshalTLSStage
294
+ );
295
+ /**
296
+ * Update TLS stage. Update the parameters of an existing TLS stage, specified by its `tls_stage_id`. Both `tls_secrets_config` and `managed_certificate` parameters can be updated.
297
+ *
298
+ * @param request - The request {@link UpdateTLSStageRequest}
299
+ * @returns A Promise of TLSStage
300
+ */
301
+ updateTLSStage = (request) => this.client.fetch(
302
+ {
303
+ body: JSON.stringify(
304
+ marshalling_gen.marshalUpdateTLSStageRequest(request, this.client.settings)
305
+ ),
306
+ headers: jsonContentHeaders,
307
+ method: "PATCH",
308
+ path: `/edge-services/v1beta1/tls-stages/${sdkClient.validatePathParam("tlsStageId", request.tlsStageId)}`
309
+ },
310
+ marshalling_gen.unmarshalTLSStage
311
+ );
312
+ /**
313
+ * Delete TLS stage. Delete an existing TLS stage, specified by its `tls_stage_id`. Deleting a TLS stage is permanent, and cannot be undone.
314
+ *
315
+ * @param request - The request {@link DeleteTLSStageRequest}
316
+ */
317
+ deleteTLSStage = (request) => this.client.fetch({
318
+ method: "DELETE",
319
+ path: `/edge-services/v1beta1/tls-stages/${sdkClient.validatePathParam("tlsStageId", request.tlsStageId)}`
320
+ });
321
+ pageOfListCacheStages = (request) => this.client.fetch(
322
+ {
323
+ method: "GET",
324
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/cache-stages`,
325
+ urlParams: sdkClient.urlParams(
326
+ ["order_by", request.orderBy],
327
+ ["page", request.page],
328
+ [
329
+ "page_size",
330
+ request.pageSize ?? this.client.settings.defaultPageSize
331
+ ]
332
+ )
333
+ },
334
+ marshalling_gen.unmarshalListCacheStagesResponse
335
+ );
336
+ /**
337
+ * List cache stages. List all cache stages, for a Scaleway Organization or Scaleway Project. By default, the cache stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
338
+ *
339
+ * @param request - The request {@link ListCacheStagesRequest}
340
+ * @returns A Promise of ListCacheStagesResponse
341
+ */
342
+ listCacheStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListCacheStages, request);
343
+ /**
344
+ * Create cache stage. Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache.
345
+ *
346
+ * @param request - The request {@link CreateCacheStageRequest}
347
+ * @returns A Promise of CacheStage
348
+ */
349
+ createCacheStage = (request) => this.client.fetch(
350
+ {
351
+ body: JSON.stringify(
352
+ marshalling_gen.marshalCreateCacheStageRequest(request, this.client.settings)
353
+ ),
354
+ headers: jsonContentHeaders,
355
+ method: "POST",
356
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/cache-stages`
357
+ },
358
+ marshalling_gen.unmarshalCacheStage
359
+ );
360
+ /**
361
+ * Get cache stage. Retrieve information about an existing cache stage, specified by its `cache_stage_id`. Its full details, including Time To Live (TTL), are returned in the response object.
362
+ *
363
+ * @param request - The request {@link GetCacheStageRequest}
364
+ * @returns A Promise of CacheStage
365
+ */
366
+ getCacheStage = (request) => this.client.fetch(
367
+ {
368
+ method: "GET",
369
+ path: `/edge-services/v1beta1/cache-stages/${sdkClient.validatePathParam("cacheStageId", request.cacheStageId)}`
370
+ },
371
+ marshalling_gen.unmarshalCacheStage
372
+ );
373
+ /**
374
+ * Update cache stage. Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl` and `backend_stage_id`.
375
+ *
376
+ * @param request - The request {@link UpdateCacheStageRequest}
377
+ * @returns A Promise of CacheStage
378
+ */
379
+ updateCacheStage = (request) => this.client.fetch(
380
+ {
381
+ body: JSON.stringify(
382
+ marshalling_gen.marshalUpdateCacheStageRequest(request, this.client.settings)
383
+ ),
384
+ headers: jsonContentHeaders,
385
+ method: "PATCH",
386
+ path: `/edge-services/v1beta1/cache-stages/${sdkClient.validatePathParam("cacheStageId", request.cacheStageId)}`
387
+ },
388
+ marshalling_gen.unmarshalCacheStage
389
+ );
390
+ /**
391
+ * Delete cache stage. Delete an existing cache stage, specified by its `cache_stage_id`. Deleting a cache stage is permanent, and cannot be undone.
392
+ *
393
+ * @param request - The request {@link DeleteCacheStageRequest}
394
+ */
395
+ deleteCacheStage = (request) => this.client.fetch({
396
+ method: "DELETE",
397
+ path: `/edge-services/v1beta1/cache-stages/${sdkClient.validatePathParam("cacheStageId", request.cacheStageId)}`
398
+ });
399
+ pageOfListBackendStages = (request) => this.client.fetch(
400
+ {
401
+ method: "GET",
402
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/backend-stages`,
403
+ urlParams: sdkClient.urlParams(
404
+ ["bucket_name", request.bucketName],
405
+ ["bucket_region", request.bucketRegion],
406
+ ["lb_id", request.lbId],
407
+ ["order_by", request.orderBy],
408
+ ["page", request.page],
409
+ [
410
+ "page_size",
411
+ request.pageSize ?? this.client.settings.defaultPageSize
412
+ ]
413
+ )
414
+ },
415
+ marshalling_gen.unmarshalListBackendStagesResponse
416
+ );
417
+ /**
418
+ * List backend stages. List all backend stages, for a Scaleway Organization or Scaleway Project. By default, the backend stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
419
+ *
420
+ * @param request - The request {@link ListBackendStagesRequest}
421
+ * @returns A Promise of ListBackendStagesResponse
422
+ */
423
+ listBackendStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListBackendStages, request);
424
+ /**
425
+ * Create backend stage. Create a new backend stage. You must specify either a `scaleway_s3` (for a Scaleway Object Storage bucket) or `scaleway_lb` (for a Scaleway Load Balancer) field to configure the origin.
426
+ *
427
+ * @param request - The request {@link CreateBackendStageRequest}
428
+ * @returns A Promise of BackendStage
429
+ */
430
+ createBackendStage = (request) => this.client.fetch(
431
+ {
432
+ body: JSON.stringify(
433
+ marshalling_gen.marshalCreateBackendStageRequest(request, this.client.settings)
434
+ ),
435
+ headers: jsonContentHeaders,
436
+ method: "POST",
437
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/backend-stages`
438
+ },
439
+ marshalling_gen.unmarshalBackendStage
440
+ );
441
+ /**
442
+ * Get backend stage. Retrieve information about an existing backend stage, specified by its `backend_stage_id`. Its full details, including `scaleway_s3` or `scaleway_lb`, are returned in the response object.
443
+ *
444
+ * @param request - The request {@link GetBackendStageRequest}
445
+ * @returns A Promise of BackendStage
446
+ */
447
+ getBackendStage = (request) => this.client.fetch(
448
+ {
449
+ method: "GET",
450
+ path: `/edge-services/v1beta1/backend-stages/${sdkClient.validatePathParam("backendStageId", request.backendStageId)}`
451
+ },
452
+ marshalling_gen.unmarshalBackendStage
453
+ );
454
+ /**
455
+ * Update backend stage. Update the parameters of an existing backend stage, specified by its `backend_stage_id`.
456
+ *
457
+ * @param request - The request {@link UpdateBackendStageRequest}
458
+ * @returns A Promise of BackendStage
459
+ */
460
+ updateBackendStage = (request) => this.client.fetch(
461
+ {
462
+ body: JSON.stringify(
463
+ marshalling_gen.marshalUpdateBackendStageRequest(request, this.client.settings)
464
+ ),
465
+ headers: jsonContentHeaders,
466
+ method: "PATCH",
467
+ path: `/edge-services/v1beta1/backend-stages/${sdkClient.validatePathParam("backendStageId", request.backendStageId)}`
468
+ },
469
+ marshalling_gen.unmarshalBackendStage
470
+ );
471
+ /**
472
+ * Delete backend stage. Delete an existing backend stage, specified by its `backend_stage_id`. Deleting a backend stage is permanent, and cannot be undone.
473
+ *
474
+ * @param request - The request {@link DeleteBackendStageRequest}
475
+ */
476
+ deleteBackendStage = (request) => this.client.fetch({
477
+ method: "DELETE",
478
+ path: `/edge-services/v1beta1/backend-stages/${sdkClient.validatePathParam("backendStageId", request.backendStageId)}`
479
+ });
480
+ searchBackendStages = (request = {}) => this.client.fetch(
481
+ {
482
+ method: "GET",
483
+ path: `/edge-services/v1beta1/search-backend-stages`,
484
+ urlParams: sdkClient.urlParams(
485
+ ["bucket_name", request.bucketName],
486
+ ["bucket_region", request.bucketRegion],
487
+ ["lb_id", request.lbId],
488
+ ["order_by", request.orderBy],
489
+ ["page", request.page],
490
+ [
491
+ "page_size",
492
+ request.pageSize ?? this.client.settings.defaultPageSize
493
+ ],
494
+ [
495
+ "project_id",
496
+ request.projectId ?? this.client.settings.defaultProjectId
497
+ ]
498
+ )
499
+ },
500
+ marshalling_gen.unmarshalListBackendStagesResponse
501
+ );
502
+ pageOfListWafStages = (request) => this.client.fetch(
503
+ {
504
+ method: "GET",
505
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/waf-stages`,
506
+ urlParams: sdkClient.urlParams(
507
+ ["order_by", request.orderBy],
508
+ ["page", request.page],
509
+ [
510
+ "page_size",
511
+ request.pageSize ?? this.client.settings.defaultPageSize
512
+ ]
513
+ )
514
+ },
515
+ marshalling_gen.unmarshalListWafStagesResponse
516
+ );
517
+ /**
518
+ * List WAF stages. List all WAF stages, for a Scaleway Organization or Scaleway Project. By default, the WAF stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
519
+ *
520
+ * @param request - The request {@link ListWafStagesRequest}
521
+ * @returns A Promise of ListWafStagesResponse
522
+ */
523
+ listWafStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListWafStages, request);
524
+ /**
525
+ * Create WAF stage. Create a new WAF stage. You must specify the `mode` and `paranoia_level` fields to customize the WAF.
526
+ *
527
+ * @param request - The request {@link CreateWafStageRequest}
528
+ * @returns A Promise of WafStage
529
+ */
530
+ createWafStage = (request) => this.client.fetch(
531
+ {
532
+ body: JSON.stringify(
533
+ marshalling_gen.marshalCreateWafStageRequest(request, this.client.settings)
534
+ ),
535
+ headers: jsonContentHeaders,
536
+ method: "POST",
537
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/waf-stages`
538
+ },
539
+ marshalling_gen.unmarshalWafStage
540
+ );
541
+ /**
542
+ * Get WAF stage. Retrieve information about an existing WAF stage, specified by its `waf_stage_id`. Its full details are returned in the response object.
543
+ *
544
+ * @param request - The request {@link GetWafStageRequest}
545
+ * @returns A Promise of WafStage
546
+ */
547
+ getWafStage = (request) => this.client.fetch(
548
+ {
549
+ method: "GET",
550
+ path: `/edge-services/v1beta1/waf-stages/${sdkClient.validatePathParam("wafStageId", request.wafStageId)}`
551
+ },
552
+ marshalling_gen.unmarshalWafStage
553
+ );
554
+ /**
555
+ * Update WAF stage. Update the parameters of an existing WAF stage, specified by its `waf_stage_id`. Both `mode` and `paranoia_level` parameters can be updated.
556
+ *
557
+ * @param request - The request {@link UpdateWafStageRequest}
558
+ * @returns A Promise of WafStage
559
+ */
560
+ updateWafStage = (request) => this.client.fetch(
561
+ {
562
+ body: JSON.stringify(
563
+ marshalling_gen.marshalUpdateWafStageRequest(request, this.client.settings)
564
+ ),
565
+ headers: jsonContentHeaders,
566
+ method: "PATCH",
567
+ path: `/edge-services/v1beta1/waf-stages/${sdkClient.validatePathParam("wafStageId", request.wafStageId)}`
568
+ },
569
+ marshalling_gen.unmarshalWafStage
570
+ );
571
+ /**
572
+ * Delete WAF stage. Delete an existing WAF stage, specified by its `waf_stage_id`. Deleting a WAF stage is permanent, and cannot be undone.
573
+ *
574
+ * @param request - The request {@link DeleteWafStageRequest}
575
+ */
576
+ deleteWafStage = (request) => this.client.fetch({
577
+ method: "DELETE",
578
+ path: `/edge-services/v1beta1/waf-stages/${sdkClient.validatePathParam("wafStageId", request.wafStageId)}`
579
+ });
580
+ searchWafStages = (request = {}) => this.client.fetch(
581
+ {
582
+ method: "GET",
583
+ path: `/edge-services/v1beta1/search-waf-stages`,
584
+ urlParams: sdkClient.urlParams(
585
+ ["order_by", request.orderBy],
586
+ ["page", request.page],
587
+ [
588
+ "page_size",
589
+ request.pageSize ?? this.client.settings.defaultPageSize
590
+ ],
591
+ [
592
+ "project_id",
593
+ request.projectId ?? this.client.settings.defaultProjectId
594
+ ]
595
+ )
596
+ },
597
+ marshalling_gen.unmarshalListWafStagesResponse
598
+ );
599
+ pageOfListRouteStages = (request) => this.client.fetch(
600
+ {
601
+ method: "GET",
602
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/route-stages`,
603
+ urlParams: sdkClient.urlParams(
604
+ ["order_by", request.orderBy],
605
+ ["page", request.page],
606
+ [
607
+ "page_size",
608
+ request.pageSize ?? this.client.settings.defaultPageSize
609
+ ]
610
+ )
611
+ },
612
+ marshalling_gen.unmarshalListRouteStagesResponse
613
+ );
614
+ /**
615
+ * List route stages. List all route stages, for a given pipeline. By default, the route stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
616
+ *
617
+ * @param request - The request {@link ListRouteStagesRequest}
618
+ * @returns A Promise of ListRouteStagesResponse
619
+ */
620
+ listRouteStages = (request) => sdkClient.enrichForPagination("stages", this.pageOfListRouteStages, request);
621
+ /**
622
+ * Create route stage. Create a new route stage. You must specify the `waf_stage_id` field to customize the route.
623
+ *
624
+ * @param request - The request {@link CreateRouteStageRequest}
625
+ * @returns A Promise of RouteStage
626
+ */
627
+ createRouteStage = (request) => this.client.fetch(
628
+ {
629
+ body: JSON.stringify(
630
+ marshalling_gen.marshalCreateRouteStageRequest(request, this.client.settings)
631
+ ),
632
+ headers: jsonContentHeaders,
633
+ method: "POST",
634
+ path: `/edge-services/v1beta1/pipelines/${sdkClient.validatePathParam("pipelineId", request.pipelineId)}/route-stages`
635
+ },
636
+ marshalling_gen.unmarshalRouteStage
637
+ );
638
+ /**
639
+ * Get route stage. Retrieve information about an existing route stage, specified by its `route_stage_id`. The summary of the route stage (without route rules) is returned in the response object.
640
+ *
641
+ * @param request - The request {@link GetRouteStageRequest}
642
+ * @returns A Promise of RouteStage
643
+ */
644
+ getRouteStage = (request) => this.client.fetch(
645
+ {
646
+ method: "GET",
647
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}`
648
+ },
649
+ marshalling_gen.unmarshalRouteStage
650
+ );
651
+ /**
652
+ * Update route stage. Update the parameters of an existing route stage, specified by its `route_stage_id`.
653
+ *
654
+ * @param request - The request {@link UpdateRouteStageRequest}
655
+ * @returns A Promise of RouteStage
656
+ */
657
+ updateRouteStage = (request) => this.client.fetch(
658
+ {
659
+ body: JSON.stringify(
660
+ marshalling_gen.marshalUpdateRouteStageRequest(request, this.client.settings)
661
+ ),
662
+ headers: jsonContentHeaders,
663
+ method: "PATCH",
664
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}`
665
+ },
666
+ marshalling_gen.unmarshalRouteStage
667
+ );
668
+ /**
669
+ * Delete route stage. Delete an existing route stage, specified by its `route_stage_id`. Deleting a route stage is permanent, and cannot be undone.
670
+ *
671
+ * @param request - The request {@link DeleteRouteStageRequest}
672
+ */
673
+ deleteRouteStage = (request) => this.client.fetch({
674
+ method: "DELETE",
675
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}`
676
+ });
677
+ /**
678
+ * List route rules. List all route rules of an existing route stage, specified by its `route_stage_id`.
679
+ *
680
+ * @param request - The request {@link ListRouteRulesRequest}
681
+ * @returns A Promise of ListRouteRulesResponse
682
+ */
683
+ listRouteRules = (request) => this.client.fetch(
684
+ {
685
+ method: "GET",
686
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}/route-rules`
687
+ },
688
+ marshalling_gen.unmarshalListRouteRulesResponse
689
+ );
690
+ /**
691
+ * Set route rules. Set the rules of an existing route stage, specified by its `route_stage_id`.
692
+ *
693
+ * @param request - The request {@link SetRouteRulesRequest}
694
+ * @returns A Promise of SetRouteRulesResponse
695
+ */
696
+ setRouteRules = (request) => this.client.fetch(
697
+ {
698
+ body: JSON.stringify(
699
+ marshalling_gen.marshalSetRouteRulesRequest(request, this.client.settings)
700
+ ),
701
+ headers: jsonContentHeaders,
702
+ method: "PUT",
703
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}/route-rules`
704
+ },
705
+ marshalling_gen.unmarshalSetRouteRulesResponse
706
+ );
707
+ /**
708
+ * Add route rules. Add route rules to an existing route stage, specified by its `route_stage_id`.
709
+ *
710
+ * @param request - The request {@link AddRouteRulesRequest}
711
+ * @returns A Promise of AddRouteRulesResponse
712
+ */
713
+ addRouteRules = (request) => this.client.fetch(
714
+ {
715
+ body: JSON.stringify(
716
+ marshalling_gen.marshalAddRouteRulesRequest(request, this.client.settings)
717
+ ),
718
+ headers: jsonContentHeaders,
719
+ method: "POST",
720
+ path: `/edge-services/v1beta1/route-stages/${sdkClient.validatePathParam("routeStageId", request.routeStageId)}/route-rules`
721
+ },
722
+ marshalling_gen.unmarshalAddRouteRulesResponse
723
+ );
724
+ checkDomain = (request) => this.client.fetch(
725
+ {
726
+ body: JSON.stringify(
727
+ marshalling_gen.marshalCheckDomainRequest(request, this.client.settings)
728
+ ),
729
+ headers: jsonContentHeaders,
730
+ method: "POST",
731
+ path: `/edge-services/v1beta1/check-domain`
732
+ },
733
+ marshalling_gen.unmarshalCheckDomainResponse
734
+ );
735
+ checkPEMChain = (request) => this.client.fetch(
736
+ {
737
+ body: JSON.stringify(
738
+ marshalling_gen.marshalCheckPEMChainRequest(request, this.client.settings)
739
+ ),
740
+ headers: jsonContentHeaders,
741
+ method: "POST",
742
+ path: `/edge-services/v1beta1/check-pem-chain`
743
+ },
744
+ marshalling_gen.unmarshalCheckPEMChainResponse
745
+ );
746
+ pageOfListPurgeRequests = (request = {}) => this.client.fetch(
747
+ {
748
+ method: "GET",
749
+ path: `/edge-services/v1beta1/purge-requests`,
750
+ urlParams: sdkClient.urlParams(
751
+ ["order_by", request.orderBy],
752
+ ["organization_id", request.organizationId],
753
+ ["page", request.page],
754
+ [
755
+ "page_size",
756
+ request.pageSize ?? this.client.settings.defaultPageSize
757
+ ],
758
+ ["pipeline_id", request.pipelineId],
759
+ ["project_id", request.projectId]
760
+ )
761
+ },
762
+ marshalling_gen.unmarshalListPurgeRequestsResponse
763
+ );
764
+ /**
765
+ * List purge requests. List all purge requests, for a Scaleway Organization or Scaleway Project. This enables you to retrieve a history of all previously-made purge requests. By default, the purge requests returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
766
+ *
767
+ * @param request - The request {@link ListPurgeRequestsRequest}
768
+ * @returns A Promise of ListPurgeRequestsResponse
769
+ */
770
+ listPurgeRequests = (request = {}) => sdkClient.enrichForPagination("purgeRequests", this.pageOfListPurgeRequests, request);
771
+ /**
772
+ * Create purge request. Create a new purge request. You must specify either the `all` field (to purge all content) or a list of `assets` (to define the precise assets to purge).
773
+ *
774
+ * @param request - The request {@link CreatePurgeRequestRequest}
775
+ * @returns A Promise of PurgeRequest
776
+ */
777
+ createPurgeRequest = (request) => this.client.fetch(
778
+ {
779
+ body: JSON.stringify(
780
+ marshalling_gen.marshalCreatePurgeRequestRequest(request, this.client.settings)
781
+ ),
782
+ headers: jsonContentHeaders,
783
+ method: "POST",
784
+ path: `/edge-services/v1beta1/purge-requests`
785
+ },
786
+ marshalling_gen.unmarshalPurgeRequest
787
+ );
788
+ /**
789
+ * Get purge request. Retrieve information about a purge request, specified by its `purge_request_id`. Its full details, including `status` and `target`, are returned in the response object.
790
+ *
791
+ * @param request - The request {@link GetPurgeRequestRequest}
792
+ * @returns A Promise of PurgeRequest
793
+ */
794
+ getPurgeRequest = (request) => this.client.fetch(
795
+ {
796
+ method: "GET",
797
+ path: `/edge-services/v1beta1/purge-requests/${sdkClient.validatePathParam("purgeRequestId", request.purgeRequestId)}`
798
+ },
799
+ marshalling_gen.unmarshalPurgeRequest
800
+ );
801
+ /**
802
+ * Waits for {@link PurgeRequest} to be in a final state.
803
+ *
804
+ * @param request - The request {@link GetPurgeRequestRequest}
805
+ * @param options - The waiting options
806
+ * @returns A Promise of PurgeRequest
807
+ */
808
+ waitForPurgeRequest = (request, options) => sdkClient.waitForResource(
809
+ options?.stop ?? ((res) => Promise.resolve(
810
+ !content_gen.PURGE_REQUEST_TRANSIENT_STATUSES.includes(
811
+ res.status
812
+ )
813
+ )),
814
+ this.getPurgeRequest,
815
+ request,
816
+ options
817
+ );
818
+ checkLbOrigin = (request = {}) => this.client.fetch(
819
+ {
820
+ body: JSON.stringify(
821
+ marshalling_gen.marshalCheckLbOriginRequest(request, this.client.settings)
822
+ ),
823
+ headers: jsonContentHeaders,
824
+ method: "POST",
825
+ path: `/edge-services/v1beta1/check-lb-origin`
826
+ },
827
+ marshalling_gen.unmarshalCheckLbOriginResponse
828
+ );
829
+ listPlans = () => this.client.fetch(
830
+ {
831
+ method: "GET",
832
+ path: `/edge-services/v1beta1/plans`
833
+ },
834
+ marshalling_gen.unmarshalListPlansResponse
835
+ );
836
+ selectPlan = (request = {}) => this.client.fetch(
837
+ {
838
+ body: JSON.stringify(
839
+ marshalling_gen.marshalSelectPlanRequest(request, this.client.settings)
840
+ ),
841
+ headers: jsonContentHeaders,
842
+ method: "PATCH",
843
+ path: `/edge-services/v1beta1/current-plan`
844
+ },
845
+ marshalling_gen.unmarshalPlan
846
+ );
847
+ getCurrentPlan = (request = {}) => this.client.fetch(
848
+ {
849
+ method: "GET",
850
+ path: `/edge-services/v1beta1/current-plan/${sdkClient.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
851
+ },
852
+ marshalling_gen.unmarshalPlan
853
+ );
854
+ deleteCurrentPlan = (request = {}) => this.client.fetch({
855
+ method: "DELETE",
856
+ path: `/edge-services/v1beta1/current-plan/${sdkClient.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
857
+ });
858
+ /**
859
+ * Gives information on the currently selected Edge Services subscription plan, resource usage and associated billing information for this calendar month (including whether consumption falls within or exceeds the currently selected subscription plan.).
860
+ *
861
+ * @param request - The request {@link GetBillingRequest}
862
+ * @returns A Promise of GetBillingResponse
863
+ */
864
+ getBilling = (request = {}) => this.client.fetch(
865
+ {
866
+ method: "GET",
867
+ path: `/edge-services/v1beta1/billing/${sdkClient.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
868
+ },
869
+ marshalling_gen.unmarshalGetBillingResponse
870
+ );
871
+ }
872
+ exports.API = API;