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