@scaleway/sdk-edge-services 2.4.0 → 2.5.0

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