@scaleway/sdk 1.14.0 → 1.16.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 (54) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +803 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/content.gen.js +4 -1
  15. package/dist/api/instance/v1/index.js +1 -1
  16. package/dist/api/instance/v1/marshalling.gen.js +27 -4
  17. package/dist/api/iot/v1/api.gen.js +508 -452
  18. package/dist/api/ipfs/index.js +2 -0
  19. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  20. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  21. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  22. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  23. package/dist/api/k8s/v1/api.gen.js +403 -342
  24. package/dist/api/k8s/v1/api.utils.js +7 -10
  25. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  26. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  27. package/dist/api/lb/v1/api.gen.js +1501 -1363
  28. package/dist/api/lb/v1/api.utils.js +71 -75
  29. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  30. package/dist/api/marketplace/v1/api.gen.js +35 -32
  31. package/dist/api/marketplace/v2/api.gen.js +117 -102
  32. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  33. package/dist/api/rdb/v1/api.gen.js +897 -819
  34. package/dist/api/redis/v1/api.gen.js +358 -333
  35. package/dist/api/redis/v1/marshalling.gen.js +1 -0
  36. package/dist/api/registry/v1/api.gen.js +211 -189
  37. package/dist/api/secret/v1alpha1/api.gen.js +295 -246
  38. package/dist/api/secret/v1alpha1/marshalling.gen.js +10 -1
  39. package/dist/api/tem/v1alpha1/api.gen.js +182 -147
  40. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  41. package/dist/api/test/v1/api.gen.js +116 -104
  42. package/dist/api/vpc/v1/api.gen.js +74 -65
  43. package/dist/api/vpc/v2/api.gen.js +200 -178
  44. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  45. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  46. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  47. package/dist/api/webhosting/v1alpha1/content.gen.js +1 -1
  48. package/dist/index.cjs +924 -453
  49. package/dist/index.d.ts +2152 -1558
  50. package/dist/index.js +28 -26
  51. package/dist/internal/logger/console-logger.js +4 -5
  52. package/dist/scw/constants.js +1 -1
  53. package/dist/scw/errors/scw-error.js +2 -2
  54. package/package.json +2 -2
@@ -17,11 +17,11 @@ const jsonContentHeaders = {
17
17
  * This API allows you to manage your load balancer service. Load balancer API.
18
18
  */
19
19
  class API extends API$1 {
20
- constructor() {
21
- var _this;
22
- super(...arguments);
23
- _this = this;
24
- this.pageOfListLbs = function (request) {
20
+ /** Lists the available regions of the API. */
21
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
22
+ pageOfListLbs = (() => {
23
+ var _this = this;
24
+ return function (request) {
25
25
  if (request === void 0) {
26
26
  request = {};
27
27
  }
@@ -31,647 +31,717 @@ class API extends API$1 {
31
31
  urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
32
32
  }, unmarshalListLbsResponse);
33
33
  };
34
- /**
35
- * List load balancers.
36
- *
37
- * @param request - The request {@link ListLbsRequest}
38
- * @returns A Promise of ListLbsResponse
39
- */
40
- this.listLbs = function (request) {
34
+ })();
35
+
36
+ /**
37
+ * List load balancers.
38
+ *
39
+ * @param request - The request {@link ListLbsRequest}
40
+ * @returns A Promise of ListLbsResponse
41
+ */
42
+ listLbs = (() => {
43
+ var _this2 = this;
44
+ return function (request) {
41
45
  if (request === void 0) {
42
46
  request = {};
43
47
  }
44
- return enrichForPagination('lbs', _this.pageOfListLbs, request);
48
+ return enrichForPagination('lbs', _this2.pageOfListLbs, request);
45
49
  };
46
- /**
47
- * Create a load balancer.
48
- *
49
- * @param request - The request {@link CreateLbRequest}
50
- * @returns A Promise of Lb
51
- */
52
- this.createLb = request => this.client.fetch({
53
- body: JSON.stringify(marshalCreateLbRequest(request, this.client.settings)),
54
- headers: jsonContentHeaders,
55
- method: 'POST',
56
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs`
57
- }, unmarshalLb);
58
- /**
59
- * Get a load balancer.
60
- *
61
- * @param request - The request {@link GetLbRequest}
62
- * @returns A Promise of Lb
63
- */
64
- this.getLb = request => this.client.fetch({
65
- method: 'GET',
66
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`
67
- }, unmarshalLb);
68
- /**
69
- * Waits for {@link Lb} to be in a final state.
70
- *
71
- * @param request - The request {@link GetLbRequest}
72
- * @param options - The waiting options
73
- * @returns A Promise of Lb
74
- */
75
- this.waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);
76
- /**
77
- * Update a load balancer.
78
- *
79
- * @param request - The request {@link UpdateLbRequest}
80
- * @returns A Promise of Lb
81
- */
82
- this.updateLb = request => this.client.fetch({
83
- body: JSON.stringify(marshalUpdateLbRequest(request, this.client.settings)),
84
- headers: jsonContentHeaders,
85
- method: 'PUT',
86
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`
87
- }, unmarshalLb);
88
- /**
89
- * Delete a load balancer.
90
- *
91
- * @param request - The request {@link DeleteLbRequest}
92
- */
93
- this.deleteLb = request => this.client.fetch({
94
- method: 'DELETE',
95
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`,
96
- urlParams: urlParams(['release_ip', request.releaseIp])
97
- });
98
- /**
99
- * Migrate a load balancer.
100
- *
101
- * @param request - The request {@link MigrateLbRequest}
102
- * @returns A Promise of Lb
103
- */
104
- this.migrateLb = request => this.client.fetch({
105
- body: JSON.stringify(marshalMigrateLbRequest(request, this.client.settings)),
106
- headers: jsonContentHeaders,
107
- method: 'POST',
108
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`
109
- }, unmarshalLb);
110
- this.pageOfListIPs = function (request) {
50
+ })();
51
+
52
+ /**
53
+ * Create a load balancer.
54
+ *
55
+ * @param request - The request {@link CreateLbRequest}
56
+ * @returns A Promise of Lb
57
+ */
58
+ createLb = request => this.client.fetch({
59
+ body: JSON.stringify(marshalCreateLbRequest(request, this.client.settings)),
60
+ headers: jsonContentHeaders,
61
+ method: 'POST',
62
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs`
63
+ }, unmarshalLb);
64
+
65
+ /**
66
+ * Get a load balancer.
67
+ *
68
+ * @param request - The request {@link GetLbRequest}
69
+ * @returns A Promise of Lb
70
+ */
71
+ getLb = request => this.client.fetch({
72
+ method: 'GET',
73
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`
74
+ }, unmarshalLb);
75
+
76
+ /**
77
+ * Waits for {@link Lb} to be in a final state.
78
+ *
79
+ * @param request - The request {@link GetLbRequest}
80
+ * @param options - The waiting options
81
+ * @returns A Promise of Lb
82
+ */
83
+ waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);
84
+
85
+ /**
86
+ * Update a load balancer.
87
+ *
88
+ * @param request - The request {@link UpdateLbRequest}
89
+ * @returns A Promise of Lb
90
+ */
91
+ updateLb = request => this.client.fetch({
92
+ body: JSON.stringify(marshalUpdateLbRequest(request, this.client.settings)),
93
+ headers: jsonContentHeaders,
94
+ method: 'PUT',
95
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`
96
+ }, unmarshalLb);
97
+
98
+ /**
99
+ * Delete a load balancer.
100
+ *
101
+ * @param request - The request {@link DeleteLbRequest}
102
+ */
103
+ deleteLb = request => this.client.fetch({
104
+ method: 'DELETE',
105
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`,
106
+ urlParams: urlParams(['release_ip', request.releaseIp])
107
+ });
108
+
109
+ /**
110
+ * Migrate a load balancer.
111
+ *
112
+ * @param request - The request {@link MigrateLbRequest}
113
+ * @returns A Promise of Lb
114
+ */
115
+ migrateLb = request => this.client.fetch({
116
+ body: JSON.stringify(marshalMigrateLbRequest(request, this.client.settings)),
117
+ headers: jsonContentHeaders,
118
+ method: 'POST',
119
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`
120
+ }, unmarshalLb);
121
+ pageOfListIPs = (() => {
122
+ var _this3 = this;
123
+ return function (request) {
111
124
  if (request === void 0) {
112
125
  request = {};
113
126
  }
114
- return _this.client.fetch({
127
+ return _this3.client.fetch({
115
128
  method: 'GET',
116
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/ips`,
117
- urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
129
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/ips`,
130
+ urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
118
131
  }, unmarshalListIpsResponse);
119
132
  };
120
- /**
121
- * List IPs.
122
- *
123
- * @param request - The request {@link ListIPsRequest}
124
- * @returns A Promise of ListIpsResponse
125
- */
126
- this.listIPs = function (request) {
127
- if (request === void 0) {
128
- request = {};
129
- }
130
- return enrichForPagination('ips', _this.pageOfListIPs, request);
131
- };
132
- /**
133
- * Create an IP.
134
- *
135
- * @param request - The request {@link CreateIpRequest}
136
- * @returns A Promise of Ip
137
- */
138
- this.createIp = function (request) {
133
+ })();
134
+
135
+ /**
136
+ * List IPs.
137
+ *
138
+ * @param request - The request {@link ListIPsRequest}
139
+ * @returns A Promise of ListIpsResponse
140
+ */
141
+ listIPs = (() => {
142
+ var _this4 = this;
143
+ return function (request) {
139
144
  if (request === void 0) {
140
145
  request = {};
141
146
  }
142
- return _this.client.fetch({
143
- body: JSON.stringify(marshalCreateIpRequest(request, _this.client.settings)),
144
- headers: jsonContentHeaders,
145
- method: 'POST',
146
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/ips`
147
- }, unmarshalIp);
147
+ return enrichForPagination('ips', _this4.pageOfListIPs, request);
148
148
  };
149
- /**
150
- * Get an IP.
151
- *
152
- * @param request - The request {@link GetIpRequest}
153
- * @returns A Promise of Ip
154
- */
155
- this.getIp = request => this.client.fetch({
156
- method: 'GET',
157
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
158
- }, unmarshalIp);
159
- /**
160
- * Delete an IP.
161
- *
162
- * @param request - The request {@link ReleaseIpRequest}
163
- */
164
- this.releaseIp = request => this.client.fetch({
165
- method: 'DELETE',
166
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
167
- });
168
- /**
169
- * Update an IP.
170
- *
171
- * @param request - The request {@link UpdateIpRequest}
172
- * @returns A Promise of Ip
173
- */
174
- this.updateIp = request => this.client.fetch({
175
- body: JSON.stringify(marshalUpdateIpRequest(request, this.client.settings)),
176
- headers: jsonContentHeaders,
177
- method: 'PATCH',
178
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
179
- }, unmarshalIp);
180
- this.pageOfListBackends = request => this.client.fetch({
181
- method: 'GET',
182
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,
183
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
184
- }, unmarshalListBackendsResponse);
185
- /**
186
- * List backends in a given load balancer.
187
- *
188
- * @param request - The request {@link ListBackendsRequest}
189
- * @returns A Promise of ListBackendsResponse
190
- */
191
- this.listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);
192
- /**
193
- * Create a backend in a given load balancer.
194
- *
195
- * @param request - The request {@link CreateBackendRequest}
196
- * @returns A Promise of Backend
197
- */
198
- this.createBackend = request => this.client.fetch({
199
- body: JSON.stringify(marshalCreateBackendRequest(request, this.client.settings)),
200
- headers: jsonContentHeaders,
201
- method: 'POST',
202
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`
203
- }, unmarshalBackend);
204
- /**
205
- * Get a backend in a given load balancer.
206
- *
207
- * @param request - The request {@link GetBackendRequest}
208
- * @returns A Promise of Backend
209
- */
210
- this.getBackend = request => this.client.fetch({
211
- method: 'GET',
212
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
213
- }, unmarshalBackend);
214
- /**
215
- * Update a backend in a given load balancer.
216
- *
217
- * @param request - The request {@link UpdateBackendRequest}
218
- * @returns A Promise of Backend
219
- */
220
- this.updateBackend = request => this.client.fetch({
221
- body: JSON.stringify(marshalUpdateBackendRequest(request, this.client.settings)),
222
- headers: jsonContentHeaders,
223
- method: 'PUT',
224
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
225
- }, unmarshalBackend);
226
- /**
227
- * Delete a backend in a given load balancer.
228
- *
229
- * @param request - The request {@link DeleteBackendRequest}
230
- */
231
- this.deleteBackend = request => this.client.fetch({
232
- method: 'DELETE',
233
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
234
- });
235
- /**
236
- * Add a set of servers in a given backend.
237
- *
238
- * @param request - The request {@link AddBackendServersRequest}
239
- * @returns A Promise of Backend
240
- */
241
- this.addBackendServers = request => this.client.fetch({
242
- body: JSON.stringify(marshalAddBackendServersRequest(request, this.client.settings)),
243
- headers: jsonContentHeaders,
244
- method: 'POST',
245
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
246
- }, unmarshalBackend);
247
- /**
248
- * Remove a set of servers for a given backend.
249
- *
250
- * @param request - The request {@link RemoveBackendServersRequest}
251
- * @returns A Promise of Backend
252
- */
253
- this.removeBackendServers = request => this.client.fetch({
254
- body: JSON.stringify(marshalRemoveBackendServersRequest(request, this.client.settings)),
255
- headers: jsonContentHeaders,
256
- method: 'DELETE',
257
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
258
- }, unmarshalBackend);
259
- /**
260
- * Define all servers in a given backend.
261
- *
262
- * @param request - The request {@link SetBackendServersRequest}
263
- * @returns A Promise of Backend
264
- */
265
- this.setBackendServers = request => this.client.fetch({
266
- body: JSON.stringify(marshalSetBackendServersRequest(request, this.client.settings)),
267
- headers: jsonContentHeaders,
268
- method: 'PUT',
269
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
270
- }, unmarshalBackend);
271
- /**
272
- * Update an health check for a given backend.
273
- *
274
- * @param request - The request {@link UpdateHealthCheckRequest}
275
- * @returns A Promise of HealthCheck
276
- */
277
- this.updateHealthCheck = request => this.client.fetch({
278
- body: JSON.stringify(marshalUpdateHealthCheckRequest(request, this.client.settings)),
279
- headers: jsonContentHeaders,
280
- method: 'PUT',
281
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`
282
- }, unmarshalHealthCheck);
283
- this.pageOfListFrontends = request => this.client.fetch({
284
- method: 'GET',
285
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,
286
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
287
- }, unmarshalListFrontendsResponse);
288
- /**
289
- * List frontends in a given load balancer.
290
- *
291
- * @param request - The request {@link ListFrontendsRequest}
292
- * @returns A Promise of ListFrontendsResponse
293
- */
294
- this.listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);
295
- /**
296
- * Create a frontend in a given load balancer.
297
- *
298
- * @param request - The request {@link CreateFrontendRequest}
299
- * @returns A Promise of Frontend
300
- */
301
- this.createFrontend = request => this.client.fetch({
302
- body: JSON.stringify(marshalCreateFrontendRequest(request, this.client.settings)),
303
- headers: jsonContentHeaders,
304
- method: 'POST',
305
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`
306
- }, unmarshalFrontend);
307
- /**
308
- * Get a frontend.
309
- *
310
- * @param request - The request {@link GetFrontendRequest}
311
- * @returns A Promise of Frontend
312
- */
313
- this.getFrontend = request => this.client.fetch({
314
- method: 'GET',
315
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
316
- }, unmarshalFrontend);
317
- /**
318
- * Update a frontend.
319
- *
320
- * @param request - The request {@link UpdateFrontendRequest}
321
- * @returns A Promise of Frontend
322
- */
323
- this.updateFrontend = request => this.client.fetch({
324
- body: JSON.stringify(marshalUpdateFrontendRequest(request, this.client.settings)),
325
- headers: jsonContentHeaders,
326
- method: 'PUT',
327
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
328
- }, unmarshalFrontend);
329
- /**
330
- * Delete a frontend.
331
- *
332
- * @param request - The request {@link DeleteFrontendRequest}
333
- */
334
- this.deleteFrontend = request => this.client.fetch({
335
- method: 'DELETE',
336
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
337
- });
338
- this.pageOfListRoutes = function (request) {
149
+ })();
150
+
151
+ /**
152
+ * Create an IP.
153
+ *
154
+ * @param request - The request {@link CreateIpRequest}
155
+ * @returns A Promise of Ip
156
+ */
157
+ createIp = request => this.client.fetch({
158
+ body: JSON.stringify(marshalCreateIpRequest(request, this.client.settings)),
159
+ headers: jsonContentHeaders,
160
+ method: 'POST',
161
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`
162
+ }, unmarshalIp);
163
+
164
+ /**
165
+ * Get an IP.
166
+ *
167
+ * @param request - The request {@link GetIpRequest}
168
+ * @returns A Promise of Ip
169
+ */
170
+ getIp = request => this.client.fetch({
171
+ method: 'GET',
172
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
173
+ }, unmarshalIp);
174
+
175
+ /**
176
+ * Delete an IP.
177
+ *
178
+ * @param request - The request {@link ReleaseIpRequest}
179
+ */
180
+ releaseIp = request => this.client.fetch({
181
+ method: 'DELETE',
182
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
183
+ });
184
+
185
+ /**
186
+ * Update an IP.
187
+ *
188
+ * @param request - The request {@link UpdateIpRequest}
189
+ * @returns A Promise of Ip
190
+ */
191
+ updateIp = request => this.client.fetch({
192
+ body: JSON.stringify(marshalUpdateIpRequest(request, this.client.settings)),
193
+ headers: jsonContentHeaders,
194
+ method: 'PATCH',
195
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
196
+ }, unmarshalIp);
197
+ pageOfListBackends = request => this.client.fetch({
198
+ method: 'GET',
199
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,
200
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
201
+ }, unmarshalListBackendsResponse);
202
+
203
+ /**
204
+ * List backends in a given load balancer.
205
+ *
206
+ * @param request - The request {@link ListBackendsRequest}
207
+ * @returns A Promise of ListBackendsResponse
208
+ */
209
+ listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);
210
+
211
+ /**
212
+ * Create a backend in a given load balancer.
213
+ *
214
+ * @param request - The request {@link CreateBackendRequest}
215
+ * @returns A Promise of Backend
216
+ */
217
+ createBackend = request => this.client.fetch({
218
+ body: JSON.stringify(marshalCreateBackendRequest(request, this.client.settings)),
219
+ headers: jsonContentHeaders,
220
+ method: 'POST',
221
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`
222
+ }, unmarshalBackend);
223
+
224
+ /**
225
+ * Get a backend in a given load balancer.
226
+ *
227
+ * @param request - The request {@link GetBackendRequest}
228
+ * @returns A Promise of Backend
229
+ */
230
+ getBackend = request => this.client.fetch({
231
+ method: 'GET',
232
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
233
+ }, unmarshalBackend);
234
+
235
+ /**
236
+ * Update a backend in a given load balancer.
237
+ *
238
+ * @param request - The request {@link UpdateBackendRequest}
239
+ * @returns A Promise of Backend
240
+ */
241
+ updateBackend = request => this.client.fetch({
242
+ body: JSON.stringify(marshalUpdateBackendRequest(request, this.client.settings)),
243
+ headers: jsonContentHeaders,
244
+ method: 'PUT',
245
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
246
+ }, unmarshalBackend);
247
+
248
+ /**
249
+ * Delete a backend in a given load balancer.
250
+ *
251
+ * @param request - The request {@link DeleteBackendRequest}
252
+ */
253
+ deleteBackend = request => this.client.fetch({
254
+ method: 'DELETE',
255
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`
256
+ });
257
+
258
+ /**
259
+ * Add a set of servers in a given backend.
260
+ *
261
+ * @param request - The request {@link AddBackendServersRequest}
262
+ * @returns A Promise of Backend
263
+ */
264
+ addBackendServers = request => this.client.fetch({
265
+ body: JSON.stringify(marshalAddBackendServersRequest(request, this.client.settings)),
266
+ headers: jsonContentHeaders,
267
+ method: 'POST',
268
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
269
+ }, unmarshalBackend);
270
+
271
+ /**
272
+ * Remove a set of servers for a given backend.
273
+ *
274
+ * @param request - The request {@link RemoveBackendServersRequest}
275
+ * @returns A Promise of Backend
276
+ */
277
+ removeBackendServers = request => this.client.fetch({
278
+ body: JSON.stringify(marshalRemoveBackendServersRequest(request, this.client.settings)),
279
+ headers: jsonContentHeaders,
280
+ method: 'DELETE',
281
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
282
+ }, unmarshalBackend);
283
+
284
+ /**
285
+ * Define all servers in a given backend.
286
+ *
287
+ * @param request - The request {@link SetBackendServersRequest}
288
+ * @returns A Promise of Backend
289
+ */
290
+ setBackendServers = request => this.client.fetch({
291
+ body: JSON.stringify(marshalSetBackendServersRequest(request, this.client.settings)),
292
+ headers: jsonContentHeaders,
293
+ method: 'PUT',
294
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
295
+ }, unmarshalBackend);
296
+
297
+ /**
298
+ * Update an health check for a given backend.
299
+ *
300
+ * @param request - The request {@link UpdateHealthCheckRequest}
301
+ * @returns A Promise of HealthCheck
302
+ */
303
+ updateHealthCheck = request => this.client.fetch({
304
+ body: JSON.stringify(marshalUpdateHealthCheckRequest(request, this.client.settings)),
305
+ headers: jsonContentHeaders,
306
+ method: 'PUT',
307
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`
308
+ }, unmarshalHealthCheck);
309
+ pageOfListFrontends = request => this.client.fetch({
310
+ method: 'GET',
311
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,
312
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
313
+ }, unmarshalListFrontendsResponse);
314
+
315
+ /**
316
+ * List frontends in a given load balancer.
317
+ *
318
+ * @param request - The request {@link ListFrontendsRequest}
319
+ * @returns A Promise of ListFrontendsResponse
320
+ */
321
+ listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);
322
+
323
+ /**
324
+ * Create a frontend in a given load balancer.
325
+ *
326
+ * @param request - The request {@link CreateFrontendRequest}
327
+ * @returns A Promise of Frontend
328
+ */
329
+ createFrontend = request => this.client.fetch({
330
+ body: JSON.stringify(marshalCreateFrontendRequest(request, this.client.settings)),
331
+ headers: jsonContentHeaders,
332
+ method: 'POST',
333
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`
334
+ }, unmarshalFrontend);
335
+
336
+ /**
337
+ * Get a frontend.
338
+ *
339
+ * @param request - The request {@link GetFrontendRequest}
340
+ * @returns A Promise of Frontend
341
+ */
342
+ getFrontend = request => this.client.fetch({
343
+ method: 'GET',
344
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
345
+ }, unmarshalFrontend);
346
+
347
+ /**
348
+ * Update a frontend.
349
+ *
350
+ * @param request - The request {@link UpdateFrontendRequest}
351
+ * @returns A Promise of Frontend
352
+ */
353
+ updateFrontend = request => this.client.fetch({
354
+ body: JSON.stringify(marshalUpdateFrontendRequest(request, this.client.settings)),
355
+ headers: jsonContentHeaders,
356
+ method: 'PUT',
357
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
358
+ }, unmarshalFrontend);
359
+
360
+ /**
361
+ * Delete a frontend.
362
+ *
363
+ * @param request - The request {@link DeleteFrontendRequest}
364
+ */
365
+ deleteFrontend = request => this.client.fetch({
366
+ method: 'DELETE',
367
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
368
+ });
369
+ pageOfListRoutes = (() => {
370
+ var _this5 = this;
371
+ return function (request) {
339
372
  if (request === void 0) {
340
373
  request = {};
341
374
  }
342
- return _this.client.fetch({
375
+ return _this5.client.fetch({
343
376
  method: 'GET',
344
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/routes`,
345
- urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
377
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/routes`,
378
+ urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize])
346
379
  }, unmarshalListRoutesResponse);
347
380
  };
348
- /**
349
- * List all backend redirections.
350
- *
351
- * @param request - The request {@link ListRoutesRequest}
352
- * @returns A Promise of ListRoutesResponse
353
- */
354
- this.listRoutes = function (request) {
381
+ })();
382
+
383
+ /**
384
+ * List all backend redirections.
385
+ *
386
+ * @param request - The request {@link ListRoutesRequest}
387
+ * @returns A Promise of ListRoutesResponse
388
+ */
389
+ listRoutes = (() => {
390
+ var _this6 = this;
391
+ return function (request) {
355
392
  if (request === void 0) {
356
393
  request = {};
357
394
  }
358
- return enrichForPagination('routes', _this.pageOfListRoutes, request);
395
+ return enrichForPagination('routes', _this6.pageOfListRoutes, request);
359
396
  };
360
- /**
361
- * Create a backend redirection.
362
- *
363
- * @param request - The request {@link CreateRouteRequest}
364
- * @returns A Promise of Route
365
- */
366
- this.createRoute = request => this.client.fetch({
367
- body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
368
- headers: jsonContentHeaders,
369
- method: 'POST',
370
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`
371
- }, unmarshalRoute);
372
- /**
373
- * Get single backend redirection.
374
- *
375
- * @param request - The request {@link GetRouteRequest}
376
- * @returns A Promise of Route
377
- */
378
- this.getRoute = request => this.client.fetch({
379
- method: 'GET',
380
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
381
- }, unmarshalRoute);
382
- /**
383
- * Edit a backend redirection.
384
- *
385
- * @param request - The request {@link UpdateRouteRequest}
386
- * @returns A Promise of Route
387
- */
388
- this.updateRoute = request => this.client.fetch({
389
- body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
390
- headers: jsonContentHeaders,
391
- method: 'PUT',
392
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
393
- }, unmarshalRoute);
394
- /**
395
- * Delete a backend redirection.
396
- *
397
- * @param request - The request {@link DeleteRouteRequest}
398
- */
399
- this.deleteRoute = request => this.client.fetch({
400
- method: 'DELETE',
401
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
402
- });
403
- /**
404
- * Get usage statistics of a given load balancer.
405
- *
406
- * @deprecated
407
- * @param request - The request {@link GetLbStatsRequest}
408
- * @returns A Promise of LbStats
409
- */
410
- this.getLbStats = request => this.client.fetch({
411
- method: 'GET',
412
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,
413
- urlParams: urlParams(['backend_id', request.backendId])
414
- }, unmarshalLbStats);
415
- this.pageOfListBackendStats = request => this.client.fetch({
416
- method: 'GET',
417
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,
418
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
419
- }, unmarshalListBackendStatsResponse);
420
- this.listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);
421
- this.pageOfListAcls = request => this.client.fetch({
422
- method: 'GET',
423
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,
424
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
425
- }, unmarshalListAclResponse);
426
- /**
427
- * List ACL for a given frontend.
428
- *
429
- * @param request - The request {@link ListAclsRequest}
430
- * @returns A Promise of ListAclResponse
431
- */
432
- this.listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);
433
- /**
434
- * Create an ACL for a given frontend.
435
- *
436
- * @param request - The request {@link CreateAclRequest}
437
- * @returns A Promise of Acl
438
- */
439
- this.createAcl = request => this.client.fetch({
440
- body: JSON.stringify(marshalCreateAclRequest(request, this.client.settings)),
441
- headers: jsonContentHeaders,
442
- method: 'POST',
443
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
444
- }, unmarshalAcl);
445
- /**
446
- * Get an ACL.
447
- *
448
- * @param request - The request {@link GetAclRequest}
449
- * @returns A Promise of Acl
450
- */
451
- this.getAcl = request => this.client.fetch({
452
- method: 'GET',
453
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
454
- }, unmarshalAcl);
455
- /**
456
- * Update an ACL.
457
- *
458
- * @param request - The request {@link UpdateAclRequest}
459
- * @returns A Promise of Acl
460
- */
461
- this.updateAcl = request => this.client.fetch({
462
- body: JSON.stringify(marshalUpdateAclRequest(request, this.client.settings)),
463
- headers: jsonContentHeaders,
464
- method: 'PUT',
465
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
466
- }, unmarshalAcl);
467
- /**
468
- * Delete an ACL.
469
- *
470
- * @param request - The request {@link DeleteAclRequest}
471
- */
472
- this.deleteAcl = request => this.client.fetch({
473
- method: 'DELETE',
474
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
475
- });
476
- /**
477
- * Create a TLS certificate. Generate a new TLS certificate using Let's
478
- * Encrypt or import your certificate.
479
- *
480
- * @param request - The request {@link CreateCertificateRequest}
481
- * @returns A Promise of Certificate
482
- */
483
- this.createCertificate = request => this.client.fetch({
484
- body: JSON.stringify(marshalCreateCertificateRequest(request, this.client.settings)),
485
- headers: jsonContentHeaders,
486
- method: 'POST',
487
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`
488
- }, unmarshalCertificate);
489
- this.pageOfListCertificates = request => this.client.fetch({
490
- method: 'GET',
491
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,
492
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
493
- }, unmarshalListCertificatesResponse);
494
- /**
495
- * List all TLS certificates on a given load balancer.
496
- *
497
- * @param request - The request {@link ListCertificatesRequest}
498
- * @returns A Promise of ListCertificatesResponse
499
- */
500
- this.listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);
501
- /**
502
- * Get a TLS certificate.
503
- *
504
- * @param request - The request {@link GetCertificateRequest}
505
- * @returns A Promise of Certificate
506
- */
507
- this.getCertificate = request => this.client.fetch({
508
- method: 'GET',
509
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
510
- }, unmarshalCertificate);
511
- /**
512
- * Waits for {@link Certificate} to be in a final state.
513
- *
514
- * @param request - The request {@link GetCertificateRequest}
515
- * @param options - The waiting options
516
- * @returns A Promise of Certificate
517
- */
518
- this.waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);
519
- /**
520
- * Update a TLS certificate.
521
- *
522
- * @param request - The request {@link UpdateCertificateRequest}
523
- * @returns A Promise of Certificate
524
- */
525
- this.updateCertificate = request => this.client.fetch({
526
- body: JSON.stringify(marshalUpdateCertificateRequest(request, this.client.settings)),
527
- headers: jsonContentHeaders,
528
- method: 'PUT',
529
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
530
- }, unmarshalCertificate);
531
- /**
532
- * Delete a TLS certificate.
533
- *
534
- * @param request - The request {@link DeleteCertificateRequest}
535
- */
536
- this.deleteCertificate = request => this.client.fetch({
537
- method: 'DELETE',
538
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
539
- });
540
- this.pageOfListLbTypes = function (request) {
397
+ })();
398
+
399
+ /**
400
+ * Create a backend redirection.
401
+ *
402
+ * @param request - The request {@link CreateRouteRequest}
403
+ * @returns A Promise of Route
404
+ */
405
+ createRoute = request => this.client.fetch({
406
+ body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
407
+ headers: jsonContentHeaders,
408
+ method: 'POST',
409
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`
410
+ }, unmarshalRoute);
411
+
412
+ /**
413
+ * Get single backend redirection.
414
+ *
415
+ * @param request - The request {@link GetRouteRequest}
416
+ * @returns A Promise of Route
417
+ */
418
+ getRoute = request => this.client.fetch({
419
+ method: 'GET',
420
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
421
+ }, unmarshalRoute);
422
+
423
+ /**
424
+ * Edit a backend redirection.
425
+ *
426
+ * @param request - The request {@link UpdateRouteRequest}
427
+ * @returns A Promise of Route
428
+ */
429
+ updateRoute = request => this.client.fetch({
430
+ body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
431
+ headers: jsonContentHeaders,
432
+ method: 'PUT',
433
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
434
+ }, unmarshalRoute);
435
+
436
+ /**
437
+ * Delete a backend redirection.
438
+ *
439
+ * @param request - The request {@link DeleteRouteRequest}
440
+ */
441
+ deleteRoute = request => this.client.fetch({
442
+ method: 'DELETE',
443
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
444
+ });
445
+
446
+ /**
447
+ * Get usage statistics of a given load balancer.
448
+ *
449
+ * @deprecated
450
+ * @param request - The request {@link GetLbStatsRequest}
451
+ * @returns A Promise of LbStats
452
+ */
453
+ getLbStats = request => this.client.fetch({
454
+ method: 'GET',
455
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,
456
+ urlParams: urlParams(['backend_id', request.backendId])
457
+ }, unmarshalLbStats);
458
+ pageOfListBackendStats = request => this.client.fetch({
459
+ method: 'GET',
460
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,
461
+ urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
462
+ }, unmarshalListBackendStatsResponse);
463
+ listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);
464
+ pageOfListAcls = request => this.client.fetch({
465
+ method: 'GET',
466
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,
467
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
468
+ }, unmarshalListAclResponse);
469
+
470
+ /**
471
+ * List ACL for a given frontend.
472
+ *
473
+ * @param request - The request {@link ListAclsRequest}
474
+ * @returns A Promise of ListAclResponse
475
+ */
476
+ listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);
477
+
478
+ /**
479
+ * Create an ACL for a given frontend.
480
+ *
481
+ * @param request - The request {@link CreateAclRequest}
482
+ * @returns A Promise of Acl
483
+ */
484
+ createAcl = request => this.client.fetch({
485
+ body: JSON.stringify(marshalCreateAclRequest(request, this.client.settings)),
486
+ headers: jsonContentHeaders,
487
+ method: 'POST',
488
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
489
+ }, unmarshalAcl);
490
+
491
+ /**
492
+ * Get an ACL.
493
+ *
494
+ * @param request - The request {@link GetAclRequest}
495
+ * @returns A Promise of Acl
496
+ */
497
+ getAcl = request => this.client.fetch({
498
+ method: 'GET',
499
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
500
+ }, unmarshalAcl);
501
+
502
+ /**
503
+ * Update an ACL.
504
+ *
505
+ * @param request - The request {@link UpdateAclRequest}
506
+ * @returns A Promise of Acl
507
+ */
508
+ updateAcl = request => this.client.fetch({
509
+ body: JSON.stringify(marshalUpdateAclRequest(request, this.client.settings)),
510
+ headers: jsonContentHeaders,
511
+ method: 'PUT',
512
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
513
+ }, unmarshalAcl);
514
+
515
+ /**
516
+ * Delete an ACL.
517
+ *
518
+ * @param request - The request {@link DeleteAclRequest}
519
+ */
520
+ deleteAcl = request => this.client.fetch({
521
+ method: 'DELETE',
522
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
523
+ });
524
+
525
+ /**
526
+ * Create a TLS certificate. Generate a new TLS certificate using Let's
527
+ * Encrypt or import your certificate.
528
+ *
529
+ * @param request - The request {@link CreateCertificateRequest}
530
+ * @returns A Promise of Certificate
531
+ */
532
+ createCertificate = request => this.client.fetch({
533
+ body: JSON.stringify(marshalCreateCertificateRequest(request, this.client.settings)),
534
+ headers: jsonContentHeaders,
535
+ method: 'POST',
536
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`
537
+ }, unmarshalCertificate);
538
+ pageOfListCertificates = request => this.client.fetch({
539
+ method: 'GET',
540
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,
541
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
542
+ }, unmarshalListCertificatesResponse);
543
+
544
+ /**
545
+ * List all TLS certificates on a given load balancer.
546
+ *
547
+ * @param request - The request {@link ListCertificatesRequest}
548
+ * @returns A Promise of ListCertificatesResponse
549
+ */
550
+ listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);
551
+
552
+ /**
553
+ * Get a TLS certificate.
554
+ *
555
+ * @param request - The request {@link GetCertificateRequest}
556
+ * @returns A Promise of Certificate
557
+ */
558
+ getCertificate = request => this.client.fetch({
559
+ method: 'GET',
560
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
561
+ }, unmarshalCertificate);
562
+
563
+ /**
564
+ * Waits for {@link Certificate} to be in a final state.
565
+ *
566
+ * @param request - The request {@link GetCertificateRequest}
567
+ * @param options - The waiting options
568
+ * @returns A Promise of Certificate
569
+ */
570
+ waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);
571
+
572
+ /**
573
+ * Update a TLS certificate.
574
+ *
575
+ * @param request - The request {@link UpdateCertificateRequest}
576
+ * @returns A Promise of Certificate
577
+ */
578
+ updateCertificate = request => this.client.fetch({
579
+ body: JSON.stringify(marshalUpdateCertificateRequest(request, this.client.settings)),
580
+ headers: jsonContentHeaders,
581
+ method: 'PUT',
582
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
583
+ }, unmarshalCertificate);
584
+
585
+ /**
586
+ * Delete a TLS certificate.
587
+ *
588
+ * @param request - The request {@link DeleteCertificateRequest}
589
+ */
590
+ deleteCertificate = request => this.client.fetch({
591
+ method: 'DELETE',
592
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
593
+ });
594
+ pageOfListLbTypes = (() => {
595
+ var _this7 = this;
596
+ return function (request) {
541
597
  if (request === void 0) {
542
598
  request = {};
543
599
  }
544
- return _this.client.fetch({
600
+ return _this7.client.fetch({
545
601
  method: 'GET',
546
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/lb-types`,
547
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
602
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? _this7.client.settings.defaultRegion)}/lb-types`,
603
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize])
548
604
  }, unmarshalListLbTypesResponse);
549
605
  };
550
- /**
551
- * List all load balancer offer type.
552
- *
553
- * @param request - The request {@link ListLbTypesRequest}
554
- * @returns A Promise of ListLbTypesResponse
555
- */
556
- this.listLbTypes = function (request) {
606
+ })();
607
+
608
+ /**
609
+ * List all load balancer offer type.
610
+ *
611
+ * @param request - The request {@link ListLbTypesRequest}
612
+ * @returns A Promise of ListLbTypesResponse
613
+ */
614
+ listLbTypes = (() => {
615
+ var _this8 = this;
616
+ return function (request) {
557
617
  if (request === void 0) {
558
618
  request = {};
559
619
  }
560
- return enrichForPagination('lbTypes', _this.pageOfListLbTypes, request);
620
+ return enrichForPagination('lbTypes', _this8.pageOfListLbTypes, request);
561
621
  };
562
- /**
563
- * Create a subscriber, webhook or email.
564
- *
565
- * @param request - The request {@link CreateSubscriberRequest}
566
- * @returns A Promise of Subscriber
567
- */
568
- this.createSubscriber = request => this.client.fetch({
569
- body: JSON.stringify(marshalCreateSubscriberRequest(request, this.client.settings)),
570
- headers: jsonContentHeaders,
571
- method: 'POST',
572
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`
573
- }, unmarshalSubscriber);
574
- /**
575
- * Get a subscriber.
576
- *
577
- * @param request - The request {@link GetSubscriberRequest}
578
- * @returns A Promise of Subscriber
579
- */
580
- this.getSubscriber = request => this.client.fetch({
581
- method: 'GET',
582
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
583
- }, unmarshalSubscriber);
584
- this.pageOfListSubscriber = request => this.client.fetch({
585
- method: 'GET',
586
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`,
587
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
588
- }, unmarshalListSubscriberResponse);
589
- /**
590
- * List all subscriber.
591
- *
592
- * @param request - The request {@link ListSubscriberRequest}
593
- * @returns A Promise of ListSubscriberResponse
594
- */
595
- this.listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);
596
- /**
597
- * Update a subscriber.
598
- *
599
- * @param request - The request {@link UpdateSubscriberRequest}
600
- * @returns A Promise of Subscriber
601
- */
602
- this.updateSubscriber = request => this.client.fetch({
603
- body: JSON.stringify(marshalUpdateSubscriberRequest(request, this.client.settings)),
604
- headers: jsonContentHeaders,
605
- method: 'PUT',
606
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
607
- }, unmarshalSubscriber);
608
- /**
609
- * Delete a subscriber.
610
- *
611
- * @param request - The request {@link DeleteSubscriberRequest}
612
- */
613
- this.deleteSubscriber = request => this.client.fetch({
614
- method: 'DELETE',
615
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}`
616
- });
617
- /**
618
- * Subscribe a subscriber to a given load balancer.
619
- *
620
- * @param request - The request {@link SubscribeToLbRequest}
621
- * @returns A Promise of Lb
622
- */
623
- this.subscribeToLb = request => this.client.fetch({
624
- body: JSON.stringify(marshalSubscribeToLbRequest(request, this.client.settings)),
625
- headers: jsonContentHeaders,
626
- method: 'POST',
627
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`
628
- }, unmarshalLb);
629
- /**
630
- * Unsubscribe a subscriber from a given load balancer.
631
- *
632
- * @param request - The request {@link UnsubscribeFromLbRequest}
633
- * @returns A Promise of Lb
634
- */
635
- this.unsubscribeFromLb = request => this.client.fetch({
636
- method: 'DELETE',
637
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`
638
- }, unmarshalLb);
639
- this.pageOfListLbPrivateNetworks = request => this.client.fetch({
640
- method: 'GET',
641
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,
642
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
643
- }, unmarshalListLbPrivateNetworksResponse);
644
- /**
645
- * List attached private network of load balancer.
646
- *
647
- * @param request - The request {@link ListLbPrivateNetworksRequest}
648
- * @returns A Promise of ListLbPrivateNetworksResponse
649
- */
650
- this.listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);
651
- /**
652
- * Add load balancer on instance private network.
653
- *
654
- * @param request - The request {@link AttachPrivateNetworkRequest}
655
- * @returns A Promise of PrivateNetwork
656
- */
657
- this.attachPrivateNetwork = request => this.client.fetch({
658
- body: JSON.stringify(marshalAttachPrivateNetworkRequest(request, this.client.settings)),
659
- headers: jsonContentHeaders,
660
- method: 'POST',
661
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`
662
- }, unmarshalPrivateNetwork);
663
- /**
664
- * Remove load balancer of private network.
665
- *
666
- * @param request - The request {@link DetachPrivateNetworkRequest}
667
- */
668
- this.detachPrivateNetwork = request => this.client.fetch({
669
- body: '{}',
670
- headers: jsonContentHeaders,
671
- method: 'POST',
672
- path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`
673
- });
674
- }
622
+ })();
623
+
624
+ /**
625
+ * Create a subscriber, webhook or email.
626
+ *
627
+ * @param request - The request {@link CreateSubscriberRequest}
628
+ * @returns A Promise of Subscriber
629
+ */
630
+ createSubscriber = request => this.client.fetch({
631
+ body: JSON.stringify(marshalCreateSubscriberRequest(request, this.client.settings)),
632
+ headers: jsonContentHeaders,
633
+ method: 'POST',
634
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`
635
+ }, unmarshalSubscriber);
636
+
637
+ /**
638
+ * Get a subscriber.
639
+ *
640
+ * @param request - The request {@link GetSubscriberRequest}
641
+ * @returns A Promise of Subscriber
642
+ */
643
+ getSubscriber = request => this.client.fetch({
644
+ method: 'GET',
645
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
646
+ }, unmarshalSubscriber);
647
+ pageOfListSubscriber = request => this.client.fetch({
648
+ method: 'GET',
649
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`,
650
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
651
+ }, unmarshalListSubscriberResponse);
652
+
653
+ /**
654
+ * List all subscriber.
655
+ *
656
+ * @param request - The request {@link ListSubscriberRequest}
657
+ * @returns A Promise of ListSubscriberResponse
658
+ */
659
+ listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);
660
+
661
+ /**
662
+ * Update a subscriber.
663
+ *
664
+ * @param request - The request {@link UpdateSubscriberRequest}
665
+ * @returns A Promise of Subscriber
666
+ */
667
+ updateSubscriber = request => this.client.fetch({
668
+ body: JSON.stringify(marshalUpdateSubscriberRequest(request, this.client.settings)),
669
+ headers: jsonContentHeaders,
670
+ method: 'PUT',
671
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
672
+ }, unmarshalSubscriber);
673
+
674
+ /**
675
+ * Delete a subscriber.
676
+ *
677
+ * @param request - The request {@link DeleteSubscriberRequest}
678
+ */
679
+ deleteSubscriber = request => this.client.fetch({
680
+ method: 'DELETE',
681
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}`
682
+ });
683
+
684
+ /**
685
+ * Subscribe a subscriber to a given load balancer.
686
+ *
687
+ * @param request - The request {@link SubscribeToLbRequest}
688
+ * @returns A Promise of Lb
689
+ */
690
+ subscribeToLb = request => this.client.fetch({
691
+ body: JSON.stringify(marshalSubscribeToLbRequest(request, this.client.settings)),
692
+ headers: jsonContentHeaders,
693
+ method: 'POST',
694
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`
695
+ }, unmarshalLb);
696
+
697
+ /**
698
+ * Unsubscribe a subscriber from a given load balancer.
699
+ *
700
+ * @param request - The request {@link UnsubscribeFromLbRequest}
701
+ * @returns A Promise of Lb
702
+ */
703
+ unsubscribeFromLb = request => this.client.fetch({
704
+ method: 'DELETE',
705
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`
706
+ }, unmarshalLb);
707
+ pageOfListLbPrivateNetworks = request => this.client.fetch({
708
+ method: 'GET',
709
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,
710
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
711
+ }, unmarshalListLbPrivateNetworksResponse);
712
+
713
+ /**
714
+ * List attached private network of load balancer.
715
+ *
716
+ * @param request - The request {@link ListLbPrivateNetworksRequest}
717
+ * @returns A Promise of ListLbPrivateNetworksResponse
718
+ */
719
+ listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);
720
+
721
+ /**
722
+ * Add load balancer on instance private network.
723
+ *
724
+ * @param request - The request {@link AttachPrivateNetworkRequest}
725
+ * @returns A Promise of PrivateNetwork
726
+ */
727
+ attachPrivateNetwork = request => this.client.fetch({
728
+ body: JSON.stringify(marshalAttachPrivateNetworkRequest(request, this.client.settings)),
729
+ headers: jsonContentHeaders,
730
+ method: 'POST',
731
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`
732
+ }, unmarshalPrivateNetwork);
733
+
734
+ /**
735
+ * Remove load balancer of private network.
736
+ *
737
+ * @param request - The request {@link DetachPrivateNetworkRequest}
738
+ */
739
+ detachPrivateNetwork = request => this.client.fetch({
740
+ body: '{}',
741
+ headers: jsonContentHeaders,
742
+ method: 'POST',
743
+ path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`
744
+ });
675
745
  }
676
746
 
677
747
  /**
@@ -680,798 +750,866 @@ class API extends API$1 {
680
750
  * This API allows you to manage your Scaleway Load Balancer services. Load
681
751
  * Balancer API.
682
752
  */
683
- /** Lists the available regions of the API. */
684
- API.LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
685
753
  class ZonedAPI extends API$1 {
686
- constructor() {
687
- var _this2;
688
- super(...arguments);
689
- _this2 = this;
690
- this.pageOfListLbs = function (request) {
754
+ /** Lists the available zones of the API. */
755
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
756
+ pageOfListLbs = (() => {
757
+ var _this9 = this;
758
+ return function (request) {
691
759
  if (request === void 0) {
692
760
  request = {};
693
761
  }
694
- return _this2.client.fetch({
762
+ return _this9.client.fetch({
695
763
  method: 'GET',
696
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/lbs`,
697
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
764
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this9.client.settings.defaultZone)}/lbs`,
765
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['project_id', request.projectId])
698
766
  }, unmarshalListLbsResponse);
699
767
  };
700
- /**
701
- * List Load Balancers. List all Load Balancers in the specified zone, for a
702
- * Scaleway Organization or Scaleway Project. By default, the Load Balancers
703
- * returned in the list are ordered by creation date in ascending order,
704
- * though this can be modified via the `order_by` field.
705
- *
706
- * @param request - The request {@link ZonedApiListLbsRequest}
707
- * @returns A Promise of ListLbsResponse
708
- */
709
- this.listLbs = function (request) {
768
+ })();
769
+
770
+ /**
771
+ * List Load Balancers. List all Load Balancers in the specified zone, for a
772
+ * Scaleway Organization or Scaleway Project. By default, the Load Balancers
773
+ * returned in the list are ordered by creation date in ascending order,
774
+ * though this can be modified via the `order_by` field.
775
+ *
776
+ * @param request - The request {@link ZonedApiListLbsRequest}
777
+ * @returns A Promise of ListLbsResponse
778
+ */
779
+ listLbs = (() => {
780
+ var _this10 = this;
781
+ return function (request) {
710
782
  if (request === void 0) {
711
783
  request = {};
712
784
  }
713
- return enrichForPagination('lbs', _this2.pageOfListLbs, request);
785
+ return enrichForPagination('lbs', _this10.pageOfListLbs, request);
714
786
  };
715
- /**
716
- * Create a Load Balancer. Create a new Load Balancer. Note that the Load
717
- * Balancer will be created without frontends or backends; these must be
718
- * created separately via the dedicated endpoints.
719
- *
720
- * @param request - The request {@link ZonedApiCreateLbRequest}
721
- * @returns A Promise of Lb
722
- */
723
- this.createLb = request => this.client.fetch({
724
- body: JSON.stringify(marshalZonedApiCreateLbRequest(request, this.client.settings)),
725
- headers: jsonContentHeaders,
726
- method: 'POST',
727
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs`
728
- }, unmarshalLb);
729
- /**
730
- * Get a Load Balancer. Retrieve information about an existing Load Balancer,
731
- * specified by its Load Balancer ID. Its full details, including name, status
732
- * and IP address, are returned in the response object.
733
- *
734
- * @param request - The request {@link ZonedApiGetLbRequest}
735
- * @returns A Promise of Lb
736
- */
737
- this.getLb = request => this.client.fetch({
738
- method: 'GET',
739
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`
740
- }, unmarshalLb);
741
- /**
742
- * Waits for {@link Lb} to be in a final state.
743
- *
744
- * @param request - The request {@link GetLbRequest}
745
- * @param options - The waiting options
746
- * @returns A Promise of Lb
747
- */
748
- this.waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);
749
- /**
750
- * Update a Load Balancer. Update the parameters of an existing Load Balancer,
751
- * specified by its Load Balancer ID. Note that the request type is PUT and
752
- * not PATCH. You must set all parameters.
753
- *
754
- * @param request - The request {@link ZonedApiUpdateLbRequest}
755
- * @returns A Promise of Lb
756
- */
757
- this.updateLb = request => this.client.fetch({
758
- body: JSON.stringify(marshalZonedApiUpdateLbRequest(request, this.client.settings)),
759
- headers: jsonContentHeaders,
760
- method: 'PUT',
761
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`
762
- }, unmarshalLb);
763
- /**
764
- * Delete a Load Balancer. Delete an existing Load Balancer, specified by its
765
- * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be
766
- * undone. The Load Balancer's flexible IP address can either be deleted with
767
- * the Load Balancer, or kept in your account for future use.
768
- *
769
- * @param request - The request {@link ZonedApiDeleteLbRequest}
770
- */
771
- this.deleteLb = request => this.client.fetch({
772
- method: 'DELETE',
773
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`,
774
- urlParams: urlParams(['release_ip', request.releaseIp])
775
- });
776
- /**
777
- * Migrate a Load Balancer. Migrate an existing Load Balancer from one
778
- * commercial type to another. Allows you to scale your Load Balancer up or
779
- * down in terms of bandwidth or multi-cloud provision.
780
- *
781
- * @param request - The request {@link ZonedApiMigrateLbRequest}
782
- * @returns A Promise of Lb
783
- */
784
- this.migrateLb = request => this.client.fetch({
785
- body: JSON.stringify(marshalZonedApiMigrateLbRequest(request, this.client.settings)),
786
- headers: jsonContentHeaders,
787
- method: 'POST',
788
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`
789
- }, unmarshalLb);
790
- this.pageOfListIPs = function (request) {
787
+ })();
788
+
789
+ /**
790
+ * Create a Load Balancer. Create a new Load Balancer. Note that the Load
791
+ * Balancer will be created without frontends or backends; these must be
792
+ * created separately via the dedicated endpoints.
793
+ *
794
+ * @param request - The request {@link ZonedApiCreateLbRequest}
795
+ * @returns A Promise of Lb
796
+ */
797
+ createLb = request => this.client.fetch({
798
+ body: JSON.stringify(marshalZonedApiCreateLbRequest(request, this.client.settings)),
799
+ headers: jsonContentHeaders,
800
+ method: 'POST',
801
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs`
802
+ }, unmarshalLb);
803
+
804
+ /**
805
+ * Get a Load Balancer. Retrieve information about an existing Load Balancer,
806
+ * specified by its Load Balancer ID. Its full details, including name, status
807
+ * and IP address, are returned in the response object.
808
+ *
809
+ * @param request - The request {@link ZonedApiGetLbRequest}
810
+ * @returns A Promise of Lb
811
+ */
812
+ getLb = request => this.client.fetch({
813
+ method: 'GET',
814
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`
815
+ }, unmarshalLb);
816
+
817
+ /**
818
+ * Waits for {@link Lb} to be in a final state.
819
+ *
820
+ * @param request - The request {@link GetLbRequest}
821
+ * @param options - The waiting options
822
+ * @returns A Promise of Lb
823
+ */
824
+ waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);
825
+
826
+ /**
827
+ * Update a Load Balancer. Update the parameters of an existing Load Balancer,
828
+ * specified by its Load Balancer ID. Note that the request type is PUT and
829
+ * not PATCH. You must set all parameters.
830
+ *
831
+ * @param request - The request {@link ZonedApiUpdateLbRequest}
832
+ * @returns A Promise of Lb
833
+ */
834
+ updateLb = request => this.client.fetch({
835
+ body: JSON.stringify(marshalZonedApiUpdateLbRequest(request, this.client.settings)),
836
+ headers: jsonContentHeaders,
837
+ method: 'PUT',
838
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`
839
+ }, unmarshalLb);
840
+
841
+ /**
842
+ * Delete a Load Balancer. Delete an existing Load Balancer, specified by its
843
+ * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be
844
+ * undone. The Load Balancer's flexible IP address can either be deleted with
845
+ * the Load Balancer, or kept in your account for future use.
846
+ *
847
+ * @param request - The request {@link ZonedApiDeleteLbRequest}
848
+ */
849
+ deleteLb = request => this.client.fetch({
850
+ method: 'DELETE',
851
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`,
852
+ urlParams: urlParams(['release_ip', request.releaseIp])
853
+ });
854
+
855
+ /**
856
+ * Migrate a Load Balancer. Migrate an existing Load Balancer from one
857
+ * commercial type to another. Allows you to scale your Load Balancer up or
858
+ * down in terms of bandwidth or multi-cloud provision.
859
+ *
860
+ * @param request - The request {@link ZonedApiMigrateLbRequest}
861
+ * @returns A Promise of Lb
862
+ */
863
+ migrateLb = request => this.client.fetch({
864
+ body: JSON.stringify(marshalZonedApiMigrateLbRequest(request, this.client.settings)),
865
+ headers: jsonContentHeaders,
866
+ method: 'POST',
867
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`
868
+ }, unmarshalLb);
869
+ pageOfListIPs = (() => {
870
+ var _this11 = this;
871
+ return function (request) {
791
872
  if (request === void 0) {
792
873
  request = {};
793
874
  }
794
- return _this2.client.fetch({
875
+ return _this11.client.fetch({
795
876
  method: 'GET',
796
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/ips`,
797
- urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
877
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this11.client.settings.defaultZone)}/ips`,
878
+ urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this11.client.settings.defaultPageSize], ['project_id', request.projectId])
798
879
  }, unmarshalListIpsResponse);
799
880
  };
800
- /**
801
- * List IP addresses. List the Load Balancer flexible IP addresses held in the
802
- * account (filtered by Organization ID or Project ID). It is also possible to
803
- * search for a specific IP address.
804
- *
805
- * @param request - The request {@link ZonedApiListIPsRequest}
806
- * @returns A Promise of ListIpsResponse
807
- */
808
- this.listIPs = function (request) {
809
- if (request === void 0) {
810
- request = {};
811
- }
812
- return enrichForPagination('ips', _this2.pageOfListIPs, request);
813
- };
814
- /**
815
- * Create an IP address. Create a new Load Balancer flexible IP address, in
816
- * the specified Scaleway Project. This can be attached to new Load Balancers
817
- * created in the future.
818
- *
819
- * @param request - The request {@link ZonedApiCreateIpRequest}
820
- * @returns A Promise of Ip
821
- */
822
- this.createIp = function (request) {
881
+ })();
882
+
883
+ /**
884
+ * List IP addresses. List the Load Balancer flexible IP addresses held in the
885
+ * account (filtered by Organization ID or Project ID). It is also possible to
886
+ * search for a specific IP address.
887
+ *
888
+ * @param request - The request {@link ZonedApiListIPsRequest}
889
+ * @returns A Promise of ListIpsResponse
890
+ */
891
+ listIPs = (() => {
892
+ var _this12 = this;
893
+ return function (request) {
823
894
  if (request === void 0) {
824
895
  request = {};
825
896
  }
826
- return _this2.client.fetch({
827
- body: JSON.stringify(marshalZonedApiCreateIpRequest(request, _this2.client.settings)),
828
- headers: jsonContentHeaders,
829
- method: 'POST',
830
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/ips`
831
- }, unmarshalIp);
897
+ return enrichForPagination('ips', _this12.pageOfListIPs, request);
832
898
  };
833
- /**
834
- * Get an IP address. Retrieve the full details of a Load Balancer flexible IP
835
- * address.
836
- *
837
- * @param request - The request {@link ZonedApiGetIpRequest}
838
- * @returns A Promise of Ip
839
- */
840
- this.getIp = request => this.client.fetch({
841
- method: 'GET',
842
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
843
- }, unmarshalIp);
844
- /**
845
- * Delete an IP address. Delete a Load Balancer flexible IP address. This
846
- * action is irreversible, and cannot be undone.
847
- *
848
- * @param request - The request {@link ZonedApiReleaseIpRequest}
849
- */
850
- this.releaseIp = request => this.client.fetch({
851
- method: 'DELETE',
852
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
853
- });
854
- /**
855
- * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP
856
- * address.
857
- *
858
- * @param request - The request {@link ZonedApiUpdateIpRequest}
859
- * @returns A Promise of Ip
860
- */
861
- this.updateIp = request => this.client.fetch({
862
- body: JSON.stringify(marshalZonedApiUpdateIpRequest(request, this.client.settings)),
863
- headers: jsonContentHeaders,
864
- method: 'PATCH',
865
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
866
- }, unmarshalIp);
867
- this.pageOfListBackends = request => this.client.fetch({
868
- method: 'GET',
869
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,
870
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
871
- }, unmarshalListBackendsResponse);
872
- /**
873
- * List the backends of a given Load Balancer. List all the backends of a Load
874
- * Balancer, specified by its Load Balancer ID. By default, results are
875
- * returned in ascending order by the creation date of each backend. The
876
- * response is an array of backend objects, containing full details of each
877
- * one including their configuration parameters such as protocol, port and
878
- * forwarding algorithm.
879
- *
880
- * @param request - The request {@link ZonedApiListBackendsRequest}
881
- * @returns A Promise of ListBackendsResponse
882
- */
883
- this.listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);
884
- /**
885
- * Create a backend for a given Load Balancer. Create a new backend for a
886
- * given Load Balancer, specifying its full configuration including protocol,
887
- * port and forwarding algorithm.
888
- *
889
- * @param request - The request {@link ZonedApiCreateBackendRequest}
890
- * @returns A Promise of Backend
891
- */
892
- this.createBackend = request => this.client.fetch({
893
- body: JSON.stringify(marshalZonedApiCreateBackendRequest(request, this.client.settings)),
894
- headers: jsonContentHeaders,
895
- method: 'POST',
896
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`
897
- }, unmarshalBackend);
898
- /**
899
- * Get a backend of a given Load Balancer. Get the full details of a given
900
- * backend, specified by its backend ID. The response contains the backend's
901
- * full configuration parameters including protocol, port and forwarding
902
- * algorithm.
903
- *
904
- * @param request - The request {@link ZonedApiGetBackendRequest}
905
- * @returns A Promise of Backend
906
- */
907
- this.getBackend = request => this.client.fetch({
908
- method: 'GET',
909
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
910
- }, unmarshalBackend);
911
- /**
912
- * Update a backend of a given Load Balancer. Update a backend of a given Load
913
- * Balancer, specified by its backend ID. Note that the request type is PUT
914
- * and not PATCH. You must set all parameters.
915
- *
916
- * @param request - The request {@link ZonedApiUpdateBackendRequest}
917
- * @returns A Promise of Backend
918
- */
919
- this.updateBackend = request => this.client.fetch({
920
- body: JSON.stringify(marshalZonedApiUpdateBackendRequest(request, this.client.settings)),
921
- headers: jsonContentHeaders,
922
- method: 'PUT',
923
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
924
- }, unmarshalBackend);
925
- /**
926
- * Delete a backend of a given Load Balancer. Delete a backend of a given Load
927
- * Balancer, specified by its backend ID. This action is irreversible and
928
- * cannot be undone.
929
- *
930
- * @param request - The request {@link ZonedApiDeleteBackendRequest}
931
- */
932
- this.deleteBackend = request => this.client.fetch({
933
- method: 'DELETE',
934
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
935
- });
936
- /**
937
- * Add a set of backend servers to a given backend. For a given backend
938
- * specified by its backend ID, add a set of backend servers (identified by
939
- * their IP addresses) it should forward traffic to. These will be appended to
940
- * any existing set of backend servers for this backend.
941
- *
942
- * @param request - The request {@link ZonedApiAddBackendServersRequest}
943
- * @returns A Promise of Backend
944
- */
945
- this.addBackendServers = request => this.client.fetch({
946
- body: JSON.stringify(marshalZonedApiAddBackendServersRequest(request, this.client.settings)),
947
- headers: jsonContentHeaders,
948
- method: 'POST',
949
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
950
- }, unmarshalBackend);
951
- /**
952
- * Remove a set of servers for a given backend. For a given backend specified
953
- * by its backend ID, remove the specified backend servers (identified by
954
- * their IP addresses) so that it no longer forwards traffic to them.
955
- *
956
- * @param request - The request {@link ZonedApiRemoveBackendServersRequest}
957
- * @returns A Promise of Backend
958
- */
959
- this.removeBackendServers = request => this.client.fetch({
960
- body: JSON.stringify(marshalZonedApiRemoveBackendServersRequest(request, this.client.settings)),
961
- headers: jsonContentHeaders,
962
- method: 'DELETE',
963
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
964
- }, unmarshalBackend);
965
- /**
966
- * Define all backend servers for a given backend. For a given backend
967
- * specified by its backend ID, define the set of backend servers (identified
968
- * by their IP addresses) that it should forward traffic to. Any existing
969
- * backend servers configured for this backend will be removed.
970
- *
971
- * @param request - The request {@link ZonedApiSetBackendServersRequest}
972
- * @returns A Promise of Backend
973
- */
974
- this.setBackendServers = request => this.client.fetch({
975
- body: JSON.stringify(marshalZonedApiSetBackendServersRequest(request, this.client.settings)),
976
- headers: jsonContentHeaders,
977
- method: 'PUT',
978
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
979
- }, unmarshalBackend);
980
- /**
981
- * Update a health check for a given backend. Update the configuration of the
982
- * health check performed by a given backend to verify the health of its
983
- * backend servers, identified by its backend ID. Note that the request type
984
- * is PUT and not PATCH. You must set all parameters.
985
- *
986
- * @param request - The request {@link ZonedApiUpdateHealthCheckRequest}
987
- * @returns A Promise of HealthCheck
988
- */
989
- this.updateHealthCheck = request => this.client.fetch({
990
- body: JSON.stringify(marshalZonedApiUpdateHealthCheckRequest(request, this.client.settings)),
991
- headers: jsonContentHeaders,
992
- method: 'PUT',
993
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`
994
- }, unmarshalHealthCheck);
995
- this.pageOfListFrontends = request => this.client.fetch({
996
- method: 'GET',
997
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,
998
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
999
- }, unmarshalListFrontendsResponse);
1000
- /**
1001
- * List frontends of a given Load Balancer. List all the frontends of a Load
1002
- * Balancer, specified by its Load Balancer ID. By default, results are
1003
- * returned in ascending order by the creation date of each frontend. The
1004
- * response is an array of frontend objects, containing full details of each
1005
- * one including the port they listen on and the backend they are attached
1006
- * to.
1007
- *
1008
- * @param request - The request {@link ZonedApiListFrontendsRequest}
1009
- * @returns A Promise of ListFrontendsResponse
1010
- */
1011
- this.listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);
1012
- /**
1013
- * Create a frontend in a given Load Balancer. Create a new frontend for a
1014
- * given Load Balancer, specifying its configuration including the port it
1015
- * should listen on and the backend to attach it to.
1016
- *
1017
- * @param request - The request {@link ZonedApiCreateFrontendRequest}
1018
- * @returns A Promise of Frontend
1019
- */
1020
- this.createFrontend = request => this.client.fetch({
1021
- body: JSON.stringify(marshalZonedApiCreateFrontendRequest(request, this.client.settings)),
1022
- headers: jsonContentHeaders,
1023
- method: 'POST',
1024
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`
1025
- }, unmarshalFrontend);
1026
- /**
1027
- * Get a frontend. Get the full details of a given frontend, specified by its
1028
- * frontend ID. The response contains the frontend's full configuration
1029
- * parameters including the backend it is attached to, the port it listens on,
1030
- * and any certificates it has.
1031
- *
1032
- * @param request - The request {@link ZonedApiGetFrontendRequest}
1033
- * @returns A Promise of Frontend
1034
- */
1035
- this.getFrontend = request => this.client.fetch({
1036
- method: 'GET',
1037
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1038
- }, unmarshalFrontend);
1039
- /**
1040
- * Update a frontend. Update a given frontend, specified by its frontend ID.
1041
- * You can update configuration parameters including its name and the port it
1042
- * listens on. Note that the request type is PUT and not PATCH. You must set
1043
- * all parameters.
1044
- *
1045
- * @param request - The request {@link ZonedApiUpdateFrontendRequest}
1046
- * @returns A Promise of Frontend
1047
- */
1048
- this.updateFrontend = request => this.client.fetch({
1049
- body: JSON.stringify(marshalZonedApiUpdateFrontendRequest(request, this.client.settings)),
1050
- headers: jsonContentHeaders,
1051
- method: 'PUT',
1052
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1053
- }, unmarshalFrontend);
1054
- /**
1055
- * Delete a frontend. Delete a given frontend, specified by its frontend ID.
1056
- * This action is irreversible and cannot be undone.
1057
- *
1058
- * @param request - The request {@link ZonedApiDeleteFrontendRequest}
1059
- */
1060
- this.deleteFrontend = request => this.client.fetch({
1061
- method: 'DELETE',
1062
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1063
- });
1064
- this.pageOfListRoutes = function (request) {
899
+ })();
900
+
901
+ /**
902
+ * Create an IP address. Create a new Load Balancer flexible IP address, in
903
+ * the specified Scaleway Project. This can be attached to new Load Balancers
904
+ * created in the future.
905
+ *
906
+ * @param request - The request {@link ZonedApiCreateIpRequest}
907
+ * @returns A Promise of Ip
908
+ */
909
+ createIp = request => this.client.fetch({
910
+ body: JSON.stringify(marshalZonedApiCreateIpRequest(request, this.client.settings)),
911
+ headers: jsonContentHeaders,
912
+ method: 'POST',
913
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`
914
+ }, unmarshalIp);
915
+
916
+ /**
917
+ * Get an IP address. Retrieve the full details of a Load Balancer flexible IP
918
+ * address.
919
+ *
920
+ * @param request - The request {@link ZonedApiGetIpRequest}
921
+ * @returns A Promise of Ip
922
+ */
923
+ getIp = request => this.client.fetch({
924
+ method: 'GET',
925
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
926
+ }, unmarshalIp);
927
+
928
+ /**
929
+ * Delete an IP address. Delete a Load Balancer flexible IP address. This
930
+ * action is irreversible, and cannot be undone.
931
+ *
932
+ * @param request - The request {@link ZonedApiReleaseIpRequest}
933
+ */
934
+ releaseIp = request => this.client.fetch({
935
+ method: 'DELETE',
936
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
937
+ });
938
+
939
+ /**
940
+ * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP
941
+ * address.
942
+ *
943
+ * @param request - The request {@link ZonedApiUpdateIpRequest}
944
+ * @returns A Promise of Ip
945
+ */
946
+ updateIp = request => this.client.fetch({
947
+ body: JSON.stringify(marshalZonedApiUpdateIpRequest(request, this.client.settings)),
948
+ headers: jsonContentHeaders,
949
+ method: 'PATCH',
950
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
951
+ }, unmarshalIp);
952
+ pageOfListBackends = request => this.client.fetch({
953
+ method: 'GET',
954
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,
955
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
956
+ }, unmarshalListBackendsResponse);
957
+
958
+ /**
959
+ * List the backends of a given Load Balancer. List all the backends of a Load
960
+ * Balancer, specified by its Load Balancer ID. By default, results are
961
+ * returned in ascending order by the creation date of each backend. The
962
+ * response is an array of backend objects, containing full details of each
963
+ * one including their configuration parameters such as protocol, port and
964
+ * forwarding algorithm.
965
+ *
966
+ * @param request - The request {@link ZonedApiListBackendsRequest}
967
+ * @returns A Promise of ListBackendsResponse
968
+ */
969
+ listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);
970
+
971
+ /**
972
+ * Create a backend for a given Load Balancer. Create a new backend for a
973
+ * given Load Balancer, specifying its full configuration including protocol,
974
+ * port and forwarding algorithm.
975
+ *
976
+ * @param request - The request {@link ZonedApiCreateBackendRequest}
977
+ * @returns A Promise of Backend
978
+ */
979
+ createBackend = request => this.client.fetch({
980
+ body: JSON.stringify(marshalZonedApiCreateBackendRequest(request, this.client.settings)),
981
+ headers: jsonContentHeaders,
982
+ method: 'POST',
983
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`
984
+ }, unmarshalBackend);
985
+
986
+ /**
987
+ * Get a backend of a given Load Balancer. Get the full details of a given
988
+ * backend, specified by its backend ID. The response contains the backend's
989
+ * full configuration parameters including protocol, port and forwarding
990
+ * algorithm.
991
+ *
992
+ * @param request - The request {@link ZonedApiGetBackendRequest}
993
+ * @returns A Promise of Backend
994
+ */
995
+ getBackend = request => this.client.fetch({
996
+ method: 'GET',
997
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
998
+ }, unmarshalBackend);
999
+
1000
+ /**
1001
+ * Update a backend of a given Load Balancer. Update a backend of a given Load
1002
+ * Balancer, specified by its backend ID. Note that the request type is PUT
1003
+ * and not PATCH. You must set all parameters.
1004
+ *
1005
+ * @param request - The request {@link ZonedApiUpdateBackendRequest}
1006
+ * @returns A Promise of Backend
1007
+ */
1008
+ updateBackend = request => this.client.fetch({
1009
+ body: JSON.stringify(marshalZonedApiUpdateBackendRequest(request, this.client.settings)),
1010
+ headers: jsonContentHeaders,
1011
+ method: 'PUT',
1012
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
1013
+ }, unmarshalBackend);
1014
+
1015
+ /**
1016
+ * Delete a backend of a given Load Balancer. Delete a backend of a given Load
1017
+ * Balancer, specified by its backend ID. This action is irreversible and
1018
+ * cannot be undone.
1019
+ *
1020
+ * @param request - The request {@link ZonedApiDeleteBackendRequest}
1021
+ */
1022
+ deleteBackend = request => this.client.fetch({
1023
+ method: 'DELETE',
1024
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`
1025
+ });
1026
+
1027
+ /**
1028
+ * Add a set of backend servers to a given backend. For a given backend
1029
+ * specified by its backend ID, add a set of backend servers (identified by
1030
+ * their IP addresses) it should forward traffic to. These will be appended to
1031
+ * any existing set of backend servers for this backend.
1032
+ *
1033
+ * @param request - The request {@link ZonedApiAddBackendServersRequest}
1034
+ * @returns A Promise of Backend
1035
+ */
1036
+ addBackendServers = request => this.client.fetch({
1037
+ body: JSON.stringify(marshalZonedApiAddBackendServersRequest(request, this.client.settings)),
1038
+ headers: jsonContentHeaders,
1039
+ method: 'POST',
1040
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
1041
+ }, unmarshalBackend);
1042
+
1043
+ /**
1044
+ * Remove a set of servers for a given backend. For a given backend specified
1045
+ * by its backend ID, remove the specified backend servers (identified by
1046
+ * their IP addresses) so that it no longer forwards traffic to them.
1047
+ *
1048
+ * @param request - The request {@link ZonedApiRemoveBackendServersRequest}
1049
+ * @returns A Promise of Backend
1050
+ */
1051
+ removeBackendServers = request => this.client.fetch({
1052
+ body: JSON.stringify(marshalZonedApiRemoveBackendServersRequest(request, this.client.settings)),
1053
+ headers: jsonContentHeaders,
1054
+ method: 'DELETE',
1055
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
1056
+ }, unmarshalBackend);
1057
+
1058
+ /**
1059
+ * Define all backend servers for a given backend. For a given backend
1060
+ * specified by its backend ID, define the set of backend servers (identified
1061
+ * by their IP addresses) that it should forward traffic to. Any existing
1062
+ * backend servers configured for this backend will be removed.
1063
+ *
1064
+ * @param request - The request {@link ZonedApiSetBackendServersRequest}
1065
+ * @returns A Promise of Backend
1066
+ */
1067
+ setBackendServers = request => this.client.fetch({
1068
+ body: JSON.stringify(marshalZonedApiSetBackendServersRequest(request, this.client.settings)),
1069
+ headers: jsonContentHeaders,
1070
+ method: 'PUT',
1071
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`
1072
+ }, unmarshalBackend);
1073
+
1074
+ /**
1075
+ * Update a health check for a given backend. Update the configuration of the
1076
+ * health check performed by a given backend to verify the health of its
1077
+ * backend servers, identified by its backend ID. Note that the request type
1078
+ * is PUT and not PATCH. You must set all parameters.
1079
+ *
1080
+ * @param request - The request {@link ZonedApiUpdateHealthCheckRequest}
1081
+ * @returns A Promise of HealthCheck
1082
+ */
1083
+ updateHealthCheck = request => this.client.fetch({
1084
+ body: JSON.stringify(marshalZonedApiUpdateHealthCheckRequest(request, this.client.settings)),
1085
+ headers: jsonContentHeaders,
1086
+ method: 'PUT',
1087
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`
1088
+ }, unmarshalHealthCheck);
1089
+ pageOfListFrontends = request => this.client.fetch({
1090
+ method: 'GET',
1091
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,
1092
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1093
+ }, unmarshalListFrontendsResponse);
1094
+
1095
+ /**
1096
+ * List frontends of a given Load Balancer. List all the frontends of a Load
1097
+ * Balancer, specified by its Load Balancer ID. By default, results are
1098
+ * returned in ascending order by the creation date of each frontend. The
1099
+ * response is an array of frontend objects, containing full details of each
1100
+ * one including the port they listen on and the backend they are attached
1101
+ * to.
1102
+ *
1103
+ * @param request - The request {@link ZonedApiListFrontendsRequest}
1104
+ * @returns A Promise of ListFrontendsResponse
1105
+ */
1106
+ listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);
1107
+
1108
+ /**
1109
+ * Create a frontend in a given Load Balancer. Create a new frontend for a
1110
+ * given Load Balancer, specifying its configuration including the port it
1111
+ * should listen on and the backend to attach it to.
1112
+ *
1113
+ * @param request - The request {@link ZonedApiCreateFrontendRequest}
1114
+ * @returns A Promise of Frontend
1115
+ */
1116
+ createFrontend = request => this.client.fetch({
1117
+ body: JSON.stringify(marshalZonedApiCreateFrontendRequest(request, this.client.settings)),
1118
+ headers: jsonContentHeaders,
1119
+ method: 'POST',
1120
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`
1121
+ }, unmarshalFrontend);
1122
+
1123
+ /**
1124
+ * Get a frontend. Get the full details of a given frontend, specified by its
1125
+ * frontend ID. The response contains the frontend's full configuration
1126
+ * parameters including the backend it is attached to, the port it listens on,
1127
+ * and any certificates it has.
1128
+ *
1129
+ * @param request - The request {@link ZonedApiGetFrontendRequest}
1130
+ * @returns A Promise of Frontend
1131
+ */
1132
+ getFrontend = request => this.client.fetch({
1133
+ method: 'GET',
1134
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1135
+ }, unmarshalFrontend);
1136
+
1137
+ /**
1138
+ * Update a frontend. Update a given frontend, specified by its frontend ID.
1139
+ * You can update configuration parameters including its name and the port it
1140
+ * listens on. Note that the request type is PUT and not PATCH. You must set
1141
+ * all parameters.
1142
+ *
1143
+ * @param request - The request {@link ZonedApiUpdateFrontendRequest}
1144
+ * @returns A Promise of Frontend
1145
+ */
1146
+ updateFrontend = request => this.client.fetch({
1147
+ body: JSON.stringify(marshalZonedApiUpdateFrontendRequest(request, this.client.settings)),
1148
+ headers: jsonContentHeaders,
1149
+ method: 'PUT',
1150
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1151
+ }, unmarshalFrontend);
1152
+
1153
+ /**
1154
+ * Delete a frontend. Delete a given frontend, specified by its frontend ID.
1155
+ * This action is irreversible and cannot be undone.
1156
+ *
1157
+ * @param request - The request {@link ZonedApiDeleteFrontendRequest}
1158
+ */
1159
+ deleteFrontend = request => this.client.fetch({
1160
+ method: 'DELETE',
1161
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`
1162
+ });
1163
+ pageOfListRoutes = (() => {
1164
+ var _this13 = this;
1165
+ return function (request) {
1065
1166
  if (request === void 0) {
1066
1167
  request = {};
1067
1168
  }
1068
- return _this2.client.fetch({
1169
+ return _this13.client.fetch({
1069
1170
  method: 'GET',
1070
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/routes`,
1071
- urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize])
1171
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this13.client.settings.defaultZone)}/routes`,
1172
+ urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this13.client.settings.defaultPageSize])
1072
1173
  }, unmarshalListRoutesResponse);
1073
1174
  };
1074
- /**
1075
- * List all routes. List all routes for a given frontend. The response is an
1076
- * array of routes, each one with a specified backend to direct to if a
1077
- * certain condition is matched (based on the value of the SNI field or HTTP
1078
- * Host header).
1079
- *
1080
- * @param request - The request {@link ZonedApiListRoutesRequest}
1081
- * @returns A Promise of ListRoutesResponse
1082
- */
1083
- this.listRoutes = function (request) {
1175
+ })();
1176
+
1177
+ /**
1178
+ * List all routes. List all routes for a given frontend. The response is an
1179
+ * array of routes, each one with a specified backend to direct to if a
1180
+ * certain condition is matched (based on the value of the SNI field or HTTP
1181
+ * Host header).
1182
+ *
1183
+ * @param request - The request {@link ZonedApiListRoutesRequest}
1184
+ * @returns A Promise of ListRoutesResponse
1185
+ */
1186
+ listRoutes = (() => {
1187
+ var _this14 = this;
1188
+ return function (request) {
1084
1189
  if (request === void 0) {
1085
1190
  request = {};
1086
1191
  }
1087
- return enrichForPagination('routes', _this2.pageOfListRoutes, request);
1192
+ return enrichForPagination('routes', _this14.pageOfListRoutes, request);
1088
1193
  };
1089
- /**
1090
- * Create a route. Create a new route on a given frontend. To configure a
1091
- * route, specify the backend to direct to if a certain condition is matched
1092
- * (based on the value of the SNI field or HTTP Host header).
1093
- *
1094
- * @param request - The request {@link ZonedApiCreateRouteRequest}
1095
- * @returns A Promise of Route
1096
- */
1097
- this.createRoute = request => this.client.fetch({
1098
- body: JSON.stringify(marshalZonedApiCreateRouteRequest(request, this.client.settings)),
1099
- headers: jsonContentHeaders,
1100
- method: 'POST',
1101
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes`
1102
- }, unmarshalRoute);
1103
- /**
1104
- * Get a route. Retrieve information about an existing route, specified by its
1105
- * route ID. Its full details, origin frontend, target backend and match
1106
- * condition, are returned in the response object.
1107
- *
1108
- * @param request - The request {@link ZonedApiGetRouteRequest}
1109
- * @returns A Promise of Route
1110
- */
1111
- this.getRoute = request => this.client.fetch({
1112
- method: 'GET',
1113
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1114
- }, unmarshalRoute);
1115
- /**
1116
- * Update a route. Update the configuration of an existing route, specified by
1117
- * its route ID.
1118
- *
1119
- * @param request - The request {@link ZonedApiUpdateRouteRequest}
1120
- * @returns A Promise of Route
1121
- */
1122
- this.updateRoute = request => this.client.fetch({
1123
- body: JSON.stringify(marshalZonedApiUpdateRouteRequest(request, this.client.settings)),
1124
- headers: jsonContentHeaders,
1125
- method: 'PUT',
1126
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1127
- }, unmarshalRoute);
1128
- /**
1129
- * Delete a route. Delete an existing route, specified by its route ID.
1130
- * Deleting a route is permanent, and cannot be undone.
1131
- *
1132
- * @param request - The request {@link ZonedApiDeleteRouteRequest}
1133
- */
1134
- this.deleteRoute = request => this.client.fetch({
1135
- method: 'DELETE',
1136
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1137
- });
1138
- /**
1139
- * Get usage statistics of a given Load Balancer.
1140
- *
1141
- * @deprecated
1142
- * @param request - The request {@link ZonedApiGetLbStatsRequest}
1143
- * @returns A Promise of LbStats
1144
- */
1145
- this.getLbStats = request => this.client.fetch({
1146
- method: 'GET',
1147
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,
1148
- urlParams: urlParams(['backend_id', request.backendId])
1149
- }, unmarshalLbStats);
1150
- this.pageOfListBackendStats = request => this.client.fetch({
1151
- method: 'GET',
1152
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,
1153
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1154
- }, unmarshalListBackendStatsResponse);
1155
- /**
1156
- * List backend server statistics. List information about your backend
1157
- * servers, including their state and the result of their last health check.
1158
- *
1159
- * @param request - The request {@link ZonedApiListBackendStatsRequest}
1160
- * @returns A Promise of ListBackendStatsResponse
1161
- */
1162
- this.listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);
1163
- this.pageOfListAcls = request => this.client.fetch({
1164
- method: 'GET',
1165
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,
1166
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1167
- }, unmarshalListAclResponse);
1168
- /**
1169
- * List ACLs for a given frontend. List the ACLs for a given frontend,
1170
- * specified by its frontend ID. The response is an array of ACL objects, each
1171
- * one representing an ACL that denies or allows traffic based on certain
1172
- * conditions.
1173
- *
1174
- * @param request - The request {@link ZonedApiListAclsRequest}
1175
- * @returns A Promise of ListAclResponse
1176
- */
1177
- this.listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);
1178
- /**
1179
- * Create an ACL for a given frontend. Create a new ACL for a given frontend.
1180
- * Each ACL must have a name, an action to perform (allow or deny), and a
1181
- * match rule (the action is carried out when the incoming traffic matches the
1182
- * rule).
1183
- *
1184
- * @param request - The request {@link ZonedApiCreateAclRequest}
1185
- * @returns A Promise of Acl
1186
- */
1187
- this.createAcl = request => this.client.fetch({
1188
- body: JSON.stringify(marshalZonedApiCreateAclRequest(request, this.client.settings)),
1189
- headers: jsonContentHeaders,
1190
- method: 'POST',
1191
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
1192
- }, unmarshalAcl);
1193
- /**
1194
- * Get an ACL. Get information for a particular ACL, specified by its ACL ID.
1195
- * The response returns full details of the ACL, including its name, action,
1196
- * match rule and frontend.
1197
- *
1198
- * @param request - The request {@link ZonedApiGetAclRequest}
1199
- * @returns A Promise of Acl
1200
- */
1201
- this.getAcl = request => this.client.fetch({
1202
- method: 'GET',
1203
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1204
- }, unmarshalAcl);
1205
- /**
1206
- * Update an ACL. Update a particular ACL, specified by its ACL ID. You can
1207
- * update details including its name, action and match rule.
1208
- *
1209
- * @param request - The request {@link ZonedApiUpdateAclRequest}
1210
- * @returns A Promise of Acl
1211
- */
1212
- this.updateAcl = request => this.client.fetch({
1213
- body: JSON.stringify(marshalZonedApiUpdateAclRequest(request, this.client.settings)),
1214
- headers: jsonContentHeaders,
1215
- method: 'PUT',
1216
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1217
- }, unmarshalAcl);
1218
- /**
1219
- * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is
1220
- * irreversible and cannot be undone.
1221
- *
1222
- * @param request - The request {@link ZonedApiDeleteAclRequest}
1223
- */
1224
- this.deleteAcl = request => this.client.fetch({
1225
- method: 'DELETE',
1226
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1227
- });
1228
- /**
1229
- * Define all ACLs for a given frontend. For a given frontend specified by its
1230
- * frontend ID, define and add the complete set of ACLS for that frontend. Any
1231
- * existing ACLs on this frontend will be removed.
1232
- *
1233
- * @param request - The request {@link ZonedApiSetAclsRequest}
1234
- * @returns A Promise of SetAclsResponse
1235
- */
1236
- this.setAcls = request => this.client.fetch({
1237
- body: JSON.stringify(marshalZonedApiSetAclsRequest(request, this.client.settings)),
1238
- headers: jsonContentHeaders,
1239
- method: 'PUT',
1240
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
1241
- }, unmarshalSetAclsResponse);
1242
- /**
1243
- * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a
1244
- * given Load Balancer. You can choose to create a Let's Encrypt certificate,
1245
- * or import a custom certificate.
1246
- *
1247
- * @param request - The request {@link ZonedApiCreateCertificateRequest}
1248
- * @returns A Promise of Certificate
1249
- */
1250
- this.createCertificate = request => this.client.fetch({
1251
- body: JSON.stringify(marshalZonedApiCreateCertificateRequest(request, this.client.settings)),
1252
- headers: jsonContentHeaders,
1253
- method: 'POST',
1254
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`
1255
- }, unmarshalCertificate);
1256
- this.pageOfListCertificates = request => this.client.fetch({
1257
- method: 'GET',
1258
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,
1259
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1260
- }, unmarshalListCertificatesResponse);
1261
- /**
1262
- * List all SSL/TLS certificates on a given Load Balancer. List all the
1263
- * SSL/TLS certificates on a given Load Balancer. The response is an array of
1264
- * certificate objects, which are by default listed in ascending order of
1265
- * creation date.
1266
- *
1267
- * @param request - The request {@link ZonedApiListCertificatesRequest}
1268
- * @returns A Promise of ListCertificatesResponse
1269
- */
1270
- this.listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);
1271
- /**
1272
- * Get an SSL/TLS certificate. Get information for a particular SSL/TLS
1273
- * certificate, specified by its certificate ID. The response returns full
1274
- * details of the certificate, including its type, main domain name, and
1275
- * alternative domain names.
1276
- *
1277
- * @param request - The request {@link ZonedApiGetCertificateRequest}
1278
- * @returns A Promise of Certificate
1279
- */
1280
- this.getCertificate = request => this.client.fetch({
1281
- method: 'GET',
1282
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1283
- }, unmarshalCertificate);
1284
- /**
1285
- * Waits for {@link Certificate} to be in a final state.
1286
- *
1287
- * @param request - The request {@link GetCertificateRequest}
1288
- * @param options - The waiting options
1289
- * @returns A Promise of Certificate
1290
- */
1291
- this.waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);
1292
- /**
1293
- * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS
1294
- * certificate, specified by its certificate ID.
1295
- *
1296
- * @param request - The request {@link ZonedApiUpdateCertificateRequest}
1297
- * @returns A Promise of Certificate
1298
- */
1299
- this.updateCertificate = request => this.client.fetch({
1300
- body: JSON.stringify(marshalZonedApiUpdateCertificateRequest(request, this.client.settings)),
1301
- headers: jsonContentHeaders,
1302
- method: 'PUT',
1303
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1304
- }, unmarshalCertificate);
1305
- /**
1306
- * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by
1307
- * its certificate ID. Deleting a certificate is irreversible and cannot be
1308
- * undone.
1309
- *
1310
- * @param request - The request {@link ZonedApiDeleteCertificateRequest}
1311
- */
1312
- this.deleteCertificate = request => this.client.fetch({
1313
- method: 'DELETE',
1314
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1315
- });
1316
- this.pageOfListLbTypes = function (request) {
1194
+ })();
1195
+
1196
+ /**
1197
+ * Create a route. Create a new route on a given frontend. To configure a
1198
+ * route, specify the backend to direct to if a certain condition is matched
1199
+ * (based on the value of the SNI field or HTTP Host header).
1200
+ *
1201
+ * @param request - The request {@link ZonedApiCreateRouteRequest}
1202
+ * @returns A Promise of Route
1203
+ */
1204
+ createRoute = request => this.client.fetch({
1205
+ body: JSON.stringify(marshalZonedApiCreateRouteRequest(request, this.client.settings)),
1206
+ headers: jsonContentHeaders,
1207
+ method: 'POST',
1208
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes`
1209
+ }, unmarshalRoute);
1210
+
1211
+ /**
1212
+ * Get a route. Retrieve information about an existing route, specified by its
1213
+ * route ID. Its full details, origin frontend, target backend and match
1214
+ * condition, are returned in the response object.
1215
+ *
1216
+ * @param request - The request {@link ZonedApiGetRouteRequest}
1217
+ * @returns A Promise of Route
1218
+ */
1219
+ getRoute = request => this.client.fetch({
1220
+ method: 'GET',
1221
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1222
+ }, unmarshalRoute);
1223
+
1224
+ /**
1225
+ * Update a route. Update the configuration of an existing route, specified by
1226
+ * its route ID.
1227
+ *
1228
+ * @param request - The request {@link ZonedApiUpdateRouteRequest}
1229
+ * @returns A Promise of Route
1230
+ */
1231
+ updateRoute = request => this.client.fetch({
1232
+ body: JSON.stringify(marshalZonedApiUpdateRouteRequest(request, this.client.settings)),
1233
+ headers: jsonContentHeaders,
1234
+ method: 'PUT',
1235
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1236
+ }, unmarshalRoute);
1237
+
1238
+ /**
1239
+ * Delete a route. Delete an existing route, specified by its route ID.
1240
+ * Deleting a route is permanent, and cannot be undone.
1241
+ *
1242
+ * @param request - The request {@link ZonedApiDeleteRouteRequest}
1243
+ */
1244
+ deleteRoute = request => this.client.fetch({
1245
+ method: 'DELETE',
1246
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`
1247
+ });
1248
+
1249
+ /**
1250
+ * Get usage statistics of a given Load Balancer.
1251
+ *
1252
+ * @deprecated
1253
+ * @param request - The request {@link ZonedApiGetLbStatsRequest}
1254
+ * @returns A Promise of LbStats
1255
+ */
1256
+ getLbStats = request => this.client.fetch({
1257
+ method: 'GET',
1258
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,
1259
+ urlParams: urlParams(['backend_id', request.backendId])
1260
+ }, unmarshalLbStats);
1261
+ pageOfListBackendStats = request => this.client.fetch({
1262
+ method: 'GET',
1263
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,
1264
+ urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1265
+ }, unmarshalListBackendStatsResponse);
1266
+
1267
+ /**
1268
+ * List backend server statistics. List information about your backend
1269
+ * servers, including their state and the result of their last health check.
1270
+ *
1271
+ * @param request - The request {@link ZonedApiListBackendStatsRequest}
1272
+ * @returns A Promise of ListBackendStatsResponse
1273
+ */
1274
+ listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);
1275
+ pageOfListAcls = request => this.client.fetch({
1276
+ method: 'GET',
1277
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,
1278
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1279
+ }, unmarshalListAclResponse);
1280
+
1281
+ /**
1282
+ * List ACLs for a given frontend. List the ACLs for a given frontend,
1283
+ * specified by its frontend ID. The response is an array of ACL objects, each
1284
+ * one representing an ACL that denies or allows traffic based on certain
1285
+ * conditions.
1286
+ *
1287
+ * @param request - The request {@link ZonedApiListAclsRequest}
1288
+ * @returns A Promise of ListAclResponse
1289
+ */
1290
+ listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);
1291
+
1292
+ /**
1293
+ * Create an ACL for a given frontend. Create a new ACL for a given frontend.
1294
+ * Each ACL must have a name, an action to perform (allow or deny), and a
1295
+ * match rule (the action is carried out when the incoming traffic matches the
1296
+ * rule).
1297
+ *
1298
+ * @param request - The request {@link ZonedApiCreateAclRequest}
1299
+ * @returns A Promise of Acl
1300
+ */
1301
+ createAcl = request => this.client.fetch({
1302
+ body: JSON.stringify(marshalZonedApiCreateAclRequest(request, this.client.settings)),
1303
+ headers: jsonContentHeaders,
1304
+ method: 'POST',
1305
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
1306
+ }, unmarshalAcl);
1307
+
1308
+ /**
1309
+ * Get an ACL. Get information for a particular ACL, specified by its ACL ID.
1310
+ * The response returns full details of the ACL, including its name, action,
1311
+ * match rule and frontend.
1312
+ *
1313
+ * @param request - The request {@link ZonedApiGetAclRequest}
1314
+ * @returns A Promise of Acl
1315
+ */
1316
+ getAcl = request => this.client.fetch({
1317
+ method: 'GET',
1318
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1319
+ }, unmarshalAcl);
1320
+
1321
+ /**
1322
+ * Update an ACL. Update a particular ACL, specified by its ACL ID. You can
1323
+ * update details including its name, action and match rule.
1324
+ *
1325
+ * @param request - The request {@link ZonedApiUpdateAclRequest}
1326
+ * @returns A Promise of Acl
1327
+ */
1328
+ updateAcl = request => this.client.fetch({
1329
+ body: JSON.stringify(marshalZonedApiUpdateAclRequest(request, this.client.settings)),
1330
+ headers: jsonContentHeaders,
1331
+ method: 'PUT',
1332
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1333
+ }, unmarshalAcl);
1334
+
1335
+ /**
1336
+ * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is
1337
+ * irreversible and cannot be undone.
1338
+ *
1339
+ * @param request - The request {@link ZonedApiDeleteAclRequest}
1340
+ */
1341
+ deleteAcl = request => this.client.fetch({
1342
+ method: 'DELETE',
1343
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
1344
+ });
1345
+
1346
+ /**
1347
+ * Define all ACLs for a given frontend. For a given frontend specified by its
1348
+ * frontend ID, define and add the complete set of ACLS for that frontend. Any
1349
+ * existing ACLs on this frontend will be removed.
1350
+ *
1351
+ * @param request - The request {@link ZonedApiSetAclsRequest}
1352
+ * @returns A Promise of SetAclsResponse
1353
+ */
1354
+ setAcls = request => this.client.fetch({
1355
+ body: JSON.stringify(marshalZonedApiSetAclsRequest(request, this.client.settings)),
1356
+ headers: jsonContentHeaders,
1357
+ method: 'PUT',
1358
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`
1359
+ }, unmarshalSetAclsResponse);
1360
+
1361
+ /**
1362
+ * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a
1363
+ * given Load Balancer. You can choose to create a Let's Encrypt certificate,
1364
+ * or import a custom certificate.
1365
+ *
1366
+ * @param request - The request {@link ZonedApiCreateCertificateRequest}
1367
+ * @returns A Promise of Certificate
1368
+ */
1369
+ createCertificate = request => this.client.fetch({
1370
+ body: JSON.stringify(marshalZonedApiCreateCertificateRequest(request, this.client.settings)),
1371
+ headers: jsonContentHeaders,
1372
+ method: 'POST',
1373
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`
1374
+ }, unmarshalCertificate);
1375
+ pageOfListCertificates = request => this.client.fetch({
1376
+ method: 'GET',
1377
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,
1378
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1379
+ }, unmarshalListCertificatesResponse);
1380
+
1381
+ /**
1382
+ * List all SSL/TLS certificates on a given Load Balancer. List all the
1383
+ * SSL/TLS certificates on a given Load Balancer. The response is an array of
1384
+ * certificate objects, which are by default listed in ascending order of
1385
+ * creation date.
1386
+ *
1387
+ * @param request - The request {@link ZonedApiListCertificatesRequest}
1388
+ * @returns A Promise of ListCertificatesResponse
1389
+ */
1390
+ listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);
1391
+
1392
+ /**
1393
+ * Get an SSL/TLS certificate. Get information for a particular SSL/TLS
1394
+ * certificate, specified by its certificate ID. The response returns full
1395
+ * details of the certificate, including its type, main domain name, and
1396
+ * alternative domain names.
1397
+ *
1398
+ * @param request - The request {@link ZonedApiGetCertificateRequest}
1399
+ * @returns A Promise of Certificate
1400
+ */
1401
+ getCertificate = request => this.client.fetch({
1402
+ method: 'GET',
1403
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1404
+ }, unmarshalCertificate);
1405
+
1406
+ /**
1407
+ * Waits for {@link Certificate} to be in a final state.
1408
+ *
1409
+ * @param request - The request {@link GetCertificateRequest}
1410
+ * @param options - The waiting options
1411
+ * @returns A Promise of Certificate
1412
+ */
1413
+ waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);
1414
+
1415
+ /**
1416
+ * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS
1417
+ * certificate, specified by its certificate ID.
1418
+ *
1419
+ * @param request - The request {@link ZonedApiUpdateCertificateRequest}
1420
+ * @returns A Promise of Certificate
1421
+ */
1422
+ updateCertificate = request => this.client.fetch({
1423
+ body: JSON.stringify(marshalZonedApiUpdateCertificateRequest(request, this.client.settings)),
1424
+ headers: jsonContentHeaders,
1425
+ method: 'PUT',
1426
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1427
+ }, unmarshalCertificate);
1428
+
1429
+ /**
1430
+ * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by
1431
+ * its certificate ID. Deleting a certificate is irreversible and cannot be
1432
+ * undone.
1433
+ *
1434
+ * @param request - The request {@link ZonedApiDeleteCertificateRequest}
1435
+ */
1436
+ deleteCertificate = request => this.client.fetch({
1437
+ method: 'DELETE',
1438
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`
1439
+ });
1440
+ pageOfListLbTypes = (() => {
1441
+ var _this15 = this;
1442
+ return function (request) {
1317
1443
  if (request === void 0) {
1318
1444
  request = {};
1319
1445
  }
1320
- return _this2.client.fetch({
1446
+ return _this15.client.fetch({
1321
1447
  method: 'GET',
1322
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/lb-types`,
1323
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize])
1448
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? _this15.client.settings.defaultZone)}/lb-types`,
1449
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this15.client.settings.defaultPageSize])
1324
1450
  }, unmarshalListLbTypesResponse);
1325
1451
  };
1326
- /**
1327
- * List all Load Balancer offer types. List all the different commercial Load
1328
- * Balancer types. The response includes an array of offer types, each with a
1329
- * name, description, and information about its stock availability.
1330
- *
1331
- * @param request - The request {@link ZonedApiListLbTypesRequest}
1332
- * @returns A Promise of ListLbTypesResponse
1333
- */
1334
- this.listLbTypes = function (request) {
1452
+ })();
1453
+
1454
+ /**
1455
+ * List all Load Balancer offer types. List all the different commercial Load
1456
+ * Balancer types. The response includes an array of offer types, each with a
1457
+ * name, description, and information about its stock availability.
1458
+ *
1459
+ * @param request - The request {@link ZonedApiListLbTypesRequest}
1460
+ * @returns A Promise of ListLbTypesResponse
1461
+ */
1462
+ listLbTypes = (() => {
1463
+ var _this16 = this;
1464
+ return function (request) {
1335
1465
  if (request === void 0) {
1336
1466
  request = {};
1337
1467
  }
1338
- return enrichForPagination('lbTypes', _this2.pageOfListLbTypes, request);
1468
+ return enrichForPagination('lbTypes', _this16.pageOfListLbTypes, request);
1339
1469
  };
1340
- /**
1341
- * Create a subscriber. Create a new subscriber, either with an email
1342
- * configuration or a webhook configuration, for a specified Scaleway
1343
- * Project.
1344
- *
1345
- * @param request - The request {@link ZonedApiCreateSubscriberRequest}
1346
- * @returns A Promise of Subscriber
1347
- */
1348
- this.createSubscriber = request => this.client.fetch({
1349
- body: JSON.stringify(marshalZonedApiCreateSubscriberRequest(request, this.client.settings)),
1350
- headers: jsonContentHeaders,
1351
- method: 'POST',
1352
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`
1353
- }, unmarshalSubscriber);
1354
- /**
1355
- * Get a subscriber. Retrieve information about an existing subscriber,
1356
- * specified by its subscriber ID. Its full details, including name and
1357
- * email/webhook configuration, are returned in the response object.
1358
- *
1359
- * @param request - The request {@link ZonedApiGetSubscriberRequest}
1360
- * @returns A Promise of Subscriber
1361
- */
1362
- this.getSubscriber = request => this.client.fetch({
1363
- method: 'GET',
1364
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
1365
- }, unmarshalSubscriber);
1366
- this.pageOfListSubscriber = request => this.client.fetch({
1367
- method: 'GET',
1368
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`,
1369
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
1370
- }, unmarshalListSubscriberResponse);
1371
- /**
1372
- * List all subscribers. List all subscribers to Load Balancer alerts. By
1373
- * default, returns all subscribers to Load Balancer alerts for the
1374
- * Organization associated with the authentication token used for the
1375
- * request.
1376
- *
1377
- * @param request - The request {@link ZonedApiListSubscriberRequest}
1378
- * @returns A Promise of ListSubscriberResponse
1379
- */
1380
- this.listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);
1381
- /**
1382
- * Update a subscriber. Update the parameters of a given subscriber (e.g.
1383
- * name, webhook configuration, email configuration), specified by its
1384
- * subscriber ID.
1385
- *
1386
- * @param request - The request {@link ZonedApiUpdateSubscriberRequest}
1387
- * @returns A Promise of Subscriber
1388
- */
1389
- this.updateSubscriber = request => this.client.fetch({
1390
- body: JSON.stringify(marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)),
1391
- headers: jsonContentHeaders,
1392
- method: 'PUT',
1393
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
1394
- }, unmarshalSubscriber);
1395
- /**
1396
- * Delete a subscriber. Delete an existing subscriber, specified by its
1397
- * subscriber ID. Deleting a subscriber is permanent, and cannot be undone.
1398
- *
1399
- * @param request - The request {@link ZonedApiDeleteSubscriberRequest}
1400
- */
1401
- this.deleteSubscriber = request => this.client.fetch({
1402
- method: 'DELETE',
1403
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}`
1404
- });
1405
- /**
1406
- * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an
1407
- * existing subscriber to alerts for a given Load Balancer.
1408
- *
1409
- * @param request - The request {@link ZonedApiSubscribeToLbRequest}
1410
- * @returns A Promise of Lb
1411
- */
1412
- this.subscribeToLb = request => this.client.fetch({
1413
- body: JSON.stringify(marshalZonedApiSubscribeToLbRequest(request, this.client.settings)),
1414
- headers: jsonContentHeaders,
1415
- method: 'POST',
1416
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`
1417
- }, unmarshalLb);
1418
- /**
1419
- * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe
1420
- * a subscriber from alerts for a given Load Balancer. The subscriber is not
1421
- * deleted, and can be resubscribed in the future if necessary.
1422
- *
1423
- * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest}
1424
- * @returns A Promise of Lb
1425
- */
1426
- this.unsubscribeFromLb = request => this.client.fetch({
1427
- method: 'DELETE',
1428
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`
1429
- }, unmarshalLb);
1430
- this.pageOfListLbPrivateNetworks = request => this.client.fetch({
1431
- method: 'GET',
1432
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,
1433
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1434
- }, unmarshalListLbPrivateNetworksResponse);
1435
- /**
1436
- * List Private Networks attached to a Load Balancer. List the Private
1437
- * Networks attached to a given Load Balancer, specified by its Load Balancer
1438
- * ID. The response is an array of Private Network objects, giving information
1439
- * including the status, configuration, name and creation date of each Private
1440
- * Network.
1441
- *
1442
- * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest}
1443
- * @returns A Promise of ListLbPrivateNetworksResponse
1444
- */
1445
- this.listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);
1446
- /**
1447
- * Attach a Load Balancer to a Private Network. Attach a specified Load
1448
- * Balancer to a specified Private Network, defining a static or DHCP
1449
- * configuration for the Load Balancer on the network.
1450
- *
1451
- * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest}
1452
- * @returns A Promise of PrivateNetwork
1453
- */
1454
- this.attachPrivateNetwork = request => this.client.fetch({
1455
- body: JSON.stringify(marshalZonedApiAttachPrivateNetworkRequest(request, this.client.settings)),
1456
- headers: jsonContentHeaders,
1457
- method: 'POST',
1458
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`
1459
- }, unmarshalPrivateNetwork);
1460
- /**
1461
- * Detach Load Balancer from Private Network. Detach a specified Load Balancer
1462
- * from a specified Private Network.
1463
- *
1464
- * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest}
1465
- */
1466
- this.detachPrivateNetwork = request => this.client.fetch({
1467
- body: '{}',
1468
- headers: jsonContentHeaders,
1469
- method: 'POST',
1470
- path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`
1471
- });
1472
- }
1470
+ })();
1471
+
1472
+ /**
1473
+ * Create a subscriber. Create a new subscriber, either with an email
1474
+ * configuration or a webhook configuration, for a specified Scaleway
1475
+ * Project.
1476
+ *
1477
+ * @param request - The request {@link ZonedApiCreateSubscriberRequest}
1478
+ * @returns A Promise of Subscriber
1479
+ */
1480
+ createSubscriber = request => this.client.fetch({
1481
+ body: JSON.stringify(marshalZonedApiCreateSubscriberRequest(request, this.client.settings)),
1482
+ headers: jsonContentHeaders,
1483
+ method: 'POST',
1484
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`
1485
+ }, unmarshalSubscriber);
1486
+
1487
+ /**
1488
+ * Get a subscriber. Retrieve information about an existing subscriber,
1489
+ * specified by its subscriber ID. Its full details, including name and
1490
+ * email/webhook configuration, are returned in the response object.
1491
+ *
1492
+ * @param request - The request {@link ZonedApiGetSubscriberRequest}
1493
+ * @returns A Promise of Subscriber
1494
+ */
1495
+ getSubscriber = request => this.client.fetch({
1496
+ method: 'GET',
1497
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
1498
+ }, unmarshalSubscriber);
1499
+ pageOfListSubscriber = request => this.client.fetch({
1500
+ method: 'GET',
1501
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`,
1502
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
1503
+ }, unmarshalListSubscriberResponse);
1504
+
1505
+ /**
1506
+ * List all subscribers. List all subscribers to Load Balancer alerts. By
1507
+ * default, returns all subscribers to Load Balancer alerts for the
1508
+ * Organization associated with the authentication token used for the
1509
+ * request.
1510
+ *
1511
+ * @param request - The request {@link ZonedApiListSubscriberRequest}
1512
+ * @returns A Promise of ListSubscriberResponse
1513
+ */
1514
+ listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);
1515
+
1516
+ /**
1517
+ * Update a subscriber. Update the parameters of a given subscriber (e.g.
1518
+ * name, webhook configuration, email configuration), specified by its
1519
+ * subscriber ID.
1520
+ *
1521
+ * @param request - The request {@link ZonedApiUpdateSubscriberRequest}
1522
+ * @returns A Promise of Subscriber
1523
+ */
1524
+ updateSubscriber = request => this.client.fetch({
1525
+ body: JSON.stringify(marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)),
1526
+ headers: jsonContentHeaders,
1527
+ method: 'PUT',
1528
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`
1529
+ }, unmarshalSubscriber);
1530
+
1531
+ /**
1532
+ * Delete a subscriber. Delete an existing subscriber, specified by its
1533
+ * subscriber ID. Deleting a subscriber is permanent, and cannot be undone.
1534
+ *
1535
+ * @param request - The request {@link ZonedApiDeleteSubscriberRequest}
1536
+ */
1537
+ deleteSubscriber = request => this.client.fetch({
1538
+ method: 'DELETE',
1539
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}`
1540
+ });
1541
+
1542
+ /**
1543
+ * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an
1544
+ * existing subscriber to alerts for a given Load Balancer.
1545
+ *
1546
+ * @param request - The request {@link ZonedApiSubscribeToLbRequest}
1547
+ * @returns A Promise of Lb
1548
+ */
1549
+ subscribeToLb = request => this.client.fetch({
1550
+ body: JSON.stringify(marshalZonedApiSubscribeToLbRequest(request, this.client.settings)),
1551
+ headers: jsonContentHeaders,
1552
+ method: 'POST',
1553
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`
1554
+ }, unmarshalLb);
1555
+
1556
+ /**
1557
+ * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe
1558
+ * a subscriber from alerts for a given Load Balancer. The subscriber is not
1559
+ * deleted, and can be resubscribed in the future if necessary.
1560
+ *
1561
+ * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest}
1562
+ * @returns A Promise of Lb
1563
+ */
1564
+ unsubscribeFromLb = request => this.client.fetch({
1565
+ method: 'DELETE',
1566
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`
1567
+ }, unmarshalLb);
1568
+ pageOfListLbPrivateNetworks = request => this.client.fetch({
1569
+ method: 'GET',
1570
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,
1571
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
1572
+ }, unmarshalListLbPrivateNetworksResponse);
1573
+
1574
+ /**
1575
+ * List Private Networks attached to a Load Balancer. List the Private
1576
+ * Networks attached to a given Load Balancer, specified by its Load Balancer
1577
+ * ID. The response is an array of Private Network objects, giving information
1578
+ * including the status, configuration, name and creation date of each Private
1579
+ * Network.
1580
+ *
1581
+ * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest}
1582
+ * @returns A Promise of ListLbPrivateNetworksResponse
1583
+ */
1584
+ listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);
1585
+
1586
+ /**
1587
+ * Attach a Load Balancer to a Private Network. Attach a specified Load
1588
+ * Balancer to a specified Private Network, defining a static or DHCP
1589
+ * configuration for the Load Balancer on the network.
1590
+ *
1591
+ * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest}
1592
+ * @returns A Promise of PrivateNetwork
1593
+ */
1594
+ attachPrivateNetwork = request => this.client.fetch({
1595
+ body: JSON.stringify(marshalZonedApiAttachPrivateNetworkRequest(request, this.client.settings)),
1596
+ headers: jsonContentHeaders,
1597
+ method: 'POST',
1598
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`
1599
+ }, unmarshalPrivateNetwork);
1600
+
1601
+ /**
1602
+ * Detach Load Balancer from Private Network. Detach a specified Load Balancer
1603
+ * from a specified Private Network.
1604
+ *
1605
+ * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest}
1606
+ */
1607
+ detachPrivateNetwork = request => this.client.fetch({
1608
+ body: '{}',
1609
+ headers: jsonContentHeaders,
1610
+ method: 'POST',
1611
+ path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`
1612
+ });
1473
1613
  }
1474
- /** Lists the available zones of the API. */
1475
- ZonedAPI.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
1476
1614
 
1477
1615
  export { API, ZonedAPI };