@scaleway/sdk 2.67.0 → 2.69.0

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