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