@scaleway/sdk 2.58.0 → 2.59.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 (40) hide show
  1. package/dist/api/audit_trail/v1alpha1/index.gen.d.ts +1 -1
  2. package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +12 -0
  3. package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +12 -0
  4. package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +9 -0
  5. package/dist/api/iam/v1alpha1/api.gen.cjs +54 -0
  6. package/dist/api/iam/v1alpha1/api.gen.d.ts +26 -1
  7. package/dist/api/iam/v1alpha1/api.gen.js +55 -1
  8. package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
  9. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +23 -0
  10. package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +4 -1
  11. package/dist/api/iam/v1alpha1/marshalling.gen.js +23 -0
  12. package/dist/api/iam/v1alpha1/types.gen.d.ts +29 -1
  13. package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +8 -0
  14. package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +7 -0
  15. package/dist/api/iam/v1alpha1/validation-rules.gen.js +9 -1
  16. package/dist/api/marketplace/v2/types.gen.d.ts +5 -2
  17. package/dist/api/vpcgw/index.gen.cjs +2 -0
  18. package/dist/api/vpcgw/index.gen.d.ts +1 -0
  19. package/dist/api/vpcgw/index.gen.js +3 -1
  20. package/dist/api/vpcgw/v2/api.gen.cjs +517 -0
  21. package/dist/api/vpcgw/v2/api.gen.d.ts +267 -0
  22. package/dist/api/vpcgw/v2/api.gen.js +517 -0
  23. package/dist/api/vpcgw/v2/content.gen.cjs +15 -0
  24. package/dist/api/vpcgw/v2/content.gen.d.ts +5 -0
  25. package/dist/api/vpcgw/v2/content.gen.js +15 -0
  26. package/dist/api/vpcgw/v2/index.gen.cjs +7 -0
  27. package/dist/api/vpcgw/v2/index.gen.d.ts +3 -0
  28. package/dist/api/vpcgw/v2/index.gen.js +7 -0
  29. package/dist/api/vpcgw/v2/marshalling.gen.cjs +259 -0
  30. package/dist/api/vpcgw/v2/marshalling.gen.d.ts +22 -0
  31. package/dist/api/vpcgw/v2/marshalling.gen.js +259 -0
  32. package/dist/api/vpcgw/v2/types.gen.d.ts +450 -0
  33. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  34. package/dist/api/webhosting/v1/marshalling.gen.cjs +14 -1
  35. package/dist/api/webhosting/v1/marshalling.gen.js +15 -2
  36. package/dist/api/webhosting/v1/types.gen.d.ts +20 -0
  37. package/dist/scw/constants.cjs +1 -1
  38. package/dist/scw/constants.d.ts +2 -2
  39. package/dist/scw/constants.js +1 -1
  40. package/package.json +2 -2
@@ -0,0 +1,517 @@
1
+ import { waitForResource } from "../../../internal/async/interval-retrier.js";
2
+ import { API as API$1 } from "../../../scw/api.js";
3
+ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
4
+ import "../../../vendor/base64/index.js";
5
+ import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
6
+ import { GATEWAY_TRANSIENT_STATUSES, GATEWAY_NETWORK_TRANSIENT_STATUSES } from "./content.gen.js";
7
+ import { unmarshalListGatewaysResponse, unmarshalGateway, marshalCreateGatewayRequest, marshalUpdateGatewayRequest, marshalUpgradeGatewayRequest, unmarshalListGatewayNetworksResponse, unmarshalGatewayNetwork, marshalCreateGatewayNetworkRequest, marshalUpdateGatewayNetworkRequest, unmarshalListPatRulesResponse, unmarshalPatRule, marshalCreatePatRuleRequest, marshalUpdatePatRuleRequest, marshalSetPatRulesRequest, unmarshalSetPatRulesResponse, unmarshalListGatewayTypesResponse, unmarshalListIPsResponse, unmarshalIP, marshalCreateIPRequest, marshalUpdateIPRequest } from "./marshalling.gen.js";
8
+ const jsonContentHeaders = {
9
+ "Content-Type": "application/json; charset=utf-8"
10
+ };
11
+ class API extends API$1 {
12
+ /** Lists the available zones of the API. */
13
+ static LOCALITIES = [
14
+ "fr-par-1",
15
+ "fr-par-2",
16
+ "nl-ams-1",
17
+ "nl-ams-2",
18
+ "nl-ams-3",
19
+ "pl-waw-1",
20
+ "pl-waw-2",
21
+ "pl-waw-3"
22
+ ];
23
+ pageOfListGateways = (request = {}) => this.client.fetch(
24
+ {
25
+ method: "GET",
26
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
27
+ urlParams: urlParams(
28
+ ["include_legacy", request.includeLegacy],
29
+ ["name", request.name],
30
+ ["order_by", request.orderBy],
31
+ ["organization_id", request.organizationId],
32
+ ["page", request.page],
33
+ [
34
+ "page_size",
35
+ request.pageSize ?? this.client.settings.defaultPageSize
36
+ ],
37
+ ["private_network_ids", request.privateNetworkIds],
38
+ ["project_id", request.projectId],
39
+ ["status", request.status],
40
+ ["tags", request.tags],
41
+ ["types", request.types]
42
+ )
43
+ },
44
+ unmarshalListGatewaysResponse
45
+ );
46
+ /**
47
+ * List Public Gateways. List Public Gateways in a given Scaleway Organization
48
+ * or Project. By default, results are displayed in ascending order of
49
+ * creation date.
50
+ *
51
+ * @param request - The request {@link ListGatewaysRequest}
52
+ * @returns A Promise of ListGatewaysResponse
53
+ */
54
+ listGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListGateways, request);
55
+ /**
56
+ * Get a Public Gateway. Get details of a Public Gateway, specified by its
57
+ * gateway ID. The response object contains full details of the gateway,
58
+ * including its **name**, **type**, **status** and more.
59
+ *
60
+ * @param request - The request {@link GetGatewayRequest}
61
+ * @returns A Promise of Gateway
62
+ */
63
+ getGateway = (request) => this.client.fetch(
64
+ {
65
+ method: "GET",
66
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
67
+ },
68
+ unmarshalGateway
69
+ );
70
+ /**
71
+ * Waits for {@link Gateway} to be in a final state.
72
+ *
73
+ * @param request - The request {@link GetGatewayRequest}
74
+ * @param options - The waiting options
75
+ * @returns A Promise of Gateway
76
+ */
77
+ waitForGateway = (request, options) => waitForResource(
78
+ options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
79
+ this.getGateway,
80
+ request,
81
+ options
82
+ );
83
+ /**
84
+ * Create a Public Gateway. Create a new Public Gateway in the specified
85
+ * Scaleway Project, defining its **name**, **type** and other configuration
86
+ * details such as whether to enable SSH bastion.
87
+ *
88
+ * @param request - The request {@link CreateGatewayRequest}
89
+ * @returns A Promise of Gateway
90
+ */
91
+ createGateway = (request) => this.client.fetch(
92
+ {
93
+ body: JSON.stringify(
94
+ marshalCreateGatewayRequest(request, this.client.settings)
95
+ ),
96
+ headers: jsonContentHeaders,
97
+ method: "POST",
98
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
99
+ },
100
+ unmarshalGateway
101
+ );
102
+ /**
103
+ * Update a Public Gateway. Update the parameters of an existing Public
104
+ * Gateway, for example, its **name**, **tags**, **SSH bastion
105
+ * configuration**, and **DNS servers**.
106
+ *
107
+ * @param request - The request {@link UpdateGatewayRequest}
108
+ * @returns A Promise of Gateway
109
+ */
110
+ updateGateway = (request) => this.client.fetch(
111
+ {
112
+ body: JSON.stringify(
113
+ marshalUpdateGatewayRequest(request, this.client.settings)
114
+ ),
115
+ headers: jsonContentHeaders,
116
+ method: "PATCH",
117
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
118
+ },
119
+ unmarshalGateway
120
+ );
121
+ /**
122
+ * Delete a Public Gateway. Delete an existing Public Gateway, specified by
123
+ * its gateway ID. This action is irreversible.
124
+ *
125
+ * @param request - The request {@link DeleteGatewayRequest}
126
+ * @returns A Promise of Gateway
127
+ */
128
+ deleteGateway = (request) => this.client.fetch(
129
+ {
130
+ method: "DELETE",
131
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
132
+ },
133
+ unmarshalGateway
134
+ );
135
+ /**
136
+ * Upgrade a Public Gateway to the latest version and/or to a different
137
+ * commercial offer type. Upgrade a given Public Gateway to the newest
138
+ * software version or to a different commercial offer type. This applies the
139
+ * latest bugfixes and features to your Public Gateway. Note that gateway
140
+ * service will be interrupted during the update.
141
+ *
142
+ * @param request - The request {@link UpgradeGatewayRequest}
143
+ * @returns A Promise of Gateway
144
+ */
145
+ upgradeGateway = (request) => this.client.fetch(
146
+ {
147
+ body: JSON.stringify(
148
+ marshalUpgradeGatewayRequest(request, this.client.settings)
149
+ ),
150
+ headers: jsonContentHeaders,
151
+ method: "POST",
152
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/upgrade`
153
+ },
154
+ unmarshalGateway
155
+ );
156
+ pageOfListGatewayNetworks = (request = {}) => this.client.fetch(
157
+ {
158
+ method: "GET",
159
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
160
+ urlParams: urlParams(
161
+ ["gateway_ids", request.gatewayIds],
162
+ ["masquerade_enabled", request.masqueradeEnabled],
163
+ ["order_by", request.orderBy],
164
+ ["page", request.page],
165
+ [
166
+ "page_size",
167
+ request.pageSize ?? this.client.settings.defaultPageSize
168
+ ],
169
+ ["private_network_ids", request.privateNetworkIds],
170
+ ["status", request.status]
171
+ )
172
+ },
173
+ unmarshalListGatewayNetworksResponse
174
+ );
175
+ /**
176
+ * List Public Gateway connections to Private Networks. List the connections
177
+ * between Public Gateways and Private Networks (a connection = a
178
+ * GatewayNetwork). You can choose to filter by `gateway-id` to list all
179
+ * Private Networks attached to the specified Public Gateway, or by
180
+ * `private_network_id` to list all Public Gateways attached to the specified
181
+ * Private Network. Other query parameters are also available. The result is
182
+ * an array of GatewayNetwork objects, each giving details of the connection
183
+ * between a given Public Gateway and a given Private Network.
184
+ *
185
+ * @param request - The request {@link ListGatewayNetworksRequest}
186
+ * @returns A Promise of ListGatewayNetworksResponse
187
+ */
188
+ listGatewayNetworks = (request = {}) => enrichForPagination(
189
+ "gatewayNetworks",
190
+ this.pageOfListGatewayNetworks,
191
+ request
192
+ );
193
+ /**
194
+ * Get a Public Gateway connection to a Private Network. Get details of a
195
+ * given connection between a Public Gateway and a Private Network (this
196
+ * connection = a GatewayNetwork), specified by its `gateway_network_id`. The
197
+ * response object contains details of the connection including the IDs of the
198
+ * Public Gateway and Private Network, the dates the connection was
199
+ * created/updated and its configuration settings.
200
+ *
201
+ * @param request - The request {@link GetGatewayNetworkRequest}
202
+ * @returns A Promise of GatewayNetwork
203
+ */
204
+ getGatewayNetwork = (request) => this.client.fetch(
205
+ {
206
+ method: "GET",
207
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
208
+ },
209
+ unmarshalGatewayNetwork
210
+ );
211
+ /**
212
+ * Waits for {@link GatewayNetwork} to be in a final state.
213
+ *
214
+ * @param request - The request {@link GetGatewayNetworkRequest}
215
+ * @param options - The waiting options
216
+ * @returns A Promise of GatewayNetwork
217
+ */
218
+ waitForGatewayNetwork = (request, options) => waitForResource(
219
+ options?.stop ?? ((res) => Promise.resolve(
220
+ !GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status)
221
+ )),
222
+ this.getGatewayNetwork,
223
+ request,
224
+ options
225
+ );
226
+ /**
227
+ * Attach a Public Gateway to a Private Network. Attach a specific Public
228
+ * Gateway to a specific Private Network (create a GatewayNetwork). You can
229
+ * configure parameters for the connection including whether to enable
230
+ * masquerade (dynamic NAT), and more.
231
+ *
232
+ * @param request - The request {@link CreateGatewayNetworkRequest}
233
+ * @returns A Promise of GatewayNetwork
234
+ */
235
+ createGatewayNetwork = (request) => this.client.fetch(
236
+ {
237
+ body: JSON.stringify(
238
+ marshalCreateGatewayNetworkRequest(request, this.client.settings)
239
+ ),
240
+ headers: jsonContentHeaders,
241
+ method: "POST",
242
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
243
+ },
244
+ unmarshalGatewayNetwork
245
+ );
246
+ /**
247
+ * Update a Public Gateway's connection to a Private Network. Update the
248
+ * configuration parameters of a connection between a given Public Gateway and
249
+ * Private Network (the connection = a GatewayNetwork). Updatable parameters
250
+ * include whether to enable traffic masquerade (dynamic NAT).
251
+ *
252
+ * @param request - The request {@link UpdateGatewayNetworkRequest}
253
+ * @returns A Promise of GatewayNetwork
254
+ */
255
+ updateGatewayNetwork = (request) => this.client.fetch(
256
+ {
257
+ body: JSON.stringify(
258
+ marshalUpdateGatewayNetworkRequest(request, this.client.settings)
259
+ ),
260
+ headers: jsonContentHeaders,
261
+ method: "PATCH",
262
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
263
+ },
264
+ unmarshalGatewayNetwork
265
+ );
266
+ /**
267
+ * Detach a Public Gateway from a Private Network. Detach a given Public
268
+ * Gateway from a given Private Network, i.e. delete a GatewayNetwork
269
+ * specified by a gateway_network_id.
270
+ *
271
+ * @param request - The request {@link DeleteGatewayNetworkRequest}
272
+ * @returns A Promise of GatewayNetwork
273
+ */
274
+ deleteGatewayNetwork = (request) => this.client.fetch(
275
+ {
276
+ method: "DELETE",
277
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
278
+ },
279
+ unmarshalGatewayNetwork
280
+ );
281
+ pageOfListPatRules = (request = {}) => this.client.fetch(
282
+ {
283
+ method: "GET",
284
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
285
+ urlParams: urlParams(
286
+ ["gateway_ids", request.gatewayIds],
287
+ ["order_by", request.orderBy],
288
+ ["page", request.page],
289
+ [
290
+ "page_size",
291
+ request.pageSize ?? this.client.settings.defaultPageSize
292
+ ],
293
+ ["private_ips", request.privateIps],
294
+ ["protocol", request.protocol]
295
+ )
296
+ },
297
+ unmarshalListPatRulesResponse
298
+ );
299
+ /**
300
+ * List PAT rules. List PAT rules. You can filter by gateway ID to list all
301
+ * PAT rules for a particular gateway, or filter for PAT rules targeting a
302
+ * specific IP address or using a specific protocol.
303
+ *
304
+ * @param request - The request {@link ListPatRulesRequest}
305
+ * @returns A Promise of ListPatRulesResponse
306
+ */
307
+ listPatRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPatRules, request);
308
+ /**
309
+ * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response
310
+ * object gives full details of the PAT rule, including the Public Gateway it
311
+ * belongs to and the configuration settings in terms of public / private
312
+ * ports, private IP and protocol.
313
+ *
314
+ * @param request - The request {@link GetPatRuleRequest}
315
+ * @returns A Promise of PatRule
316
+ */
317
+ getPatRule = (request) => this.client.fetch(
318
+ {
319
+ method: "GET",
320
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
321
+ },
322
+ unmarshalPatRule
323
+ );
324
+ /**
325
+ * Create a PAT rule. Create a new PAT rule on a specified Public Gateway,
326
+ * defining the protocol to use, public port to listen on, and private port /
327
+ * IP address to map to.
328
+ *
329
+ * @param request - The request {@link CreatePatRuleRequest}
330
+ * @returns A Promise of PatRule
331
+ */
332
+ createPatRule = (request) => this.client.fetch(
333
+ {
334
+ body: JSON.stringify(
335
+ marshalCreatePatRuleRequest(request, this.client.settings)
336
+ ),
337
+ headers: jsonContentHeaders,
338
+ method: "POST",
339
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
340
+ },
341
+ unmarshalPatRule
342
+ );
343
+ /**
344
+ * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID.
345
+ * Configuration settings including private/public port, private IP address
346
+ * and protocol can all be updated.
347
+ *
348
+ * @param request - The request {@link UpdatePatRuleRequest}
349
+ * @returns A Promise of PatRule
350
+ */
351
+ updatePatRule = (request) => this.client.fetch(
352
+ {
353
+ body: JSON.stringify(
354
+ marshalUpdatePatRuleRequest(request, this.client.settings)
355
+ ),
356
+ headers: jsonContentHeaders,
357
+ method: "PATCH",
358
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
359
+ },
360
+ unmarshalPatRule
361
+ );
362
+ /**
363
+ * Set all PAT rules. Set a definitive list of PAT rules attached to a Public
364
+ * Gateway. Each rule is identified by its public port and protocol. This will
365
+ * sync the current PAT rule list on the gateway with the new list, creating,
366
+ * updating or deleting PAT rules accordingly.
367
+ *
368
+ * @param request - The request {@link SetPatRulesRequest}
369
+ * @returns A Promise of SetPatRulesResponse
370
+ */
371
+ setPatRules = (request) => this.client.fetch(
372
+ {
373
+ body: JSON.stringify(
374
+ marshalSetPatRulesRequest(request, this.client.settings)
375
+ ),
376
+ headers: jsonContentHeaders,
377
+ method: "PUT",
378
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
379
+ },
380
+ unmarshalSetPatRulesResponse
381
+ );
382
+ /**
383
+ * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This
384
+ * action is irreversible.
385
+ *
386
+ * @param request - The request {@link DeletePatRuleRequest}
387
+ */
388
+ deletePatRule = (request) => this.client.fetch({
389
+ method: "DELETE",
390
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
391
+ });
392
+ /**
393
+ * List Public Gateway types. List the different Public Gateway commercial
394
+ * offer types available at Scaleway. The response is an array of objects
395
+ * describing the name and technical details of each available gateway type.
396
+ *
397
+ * @param request - The request {@link ListGatewayTypesRequest}
398
+ * @returns A Promise of ListGatewayTypesResponse
399
+ */
400
+ listGatewayTypes = (request = {}) => this.client.fetch(
401
+ {
402
+ method: "GET",
403
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
404
+ },
405
+ unmarshalListGatewayTypesResponse
406
+ );
407
+ pageOfListIPs = (request = {}) => this.client.fetch(
408
+ {
409
+ method: "GET",
410
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
411
+ urlParams: urlParams(
412
+ ["is_free", request.isFree],
413
+ ["order_by", request.orderBy],
414
+ ["organization_id", request.organizationId],
415
+ ["page", request.page],
416
+ [
417
+ "page_size",
418
+ request.pageSize ?? this.client.settings.defaultPageSize
419
+ ],
420
+ ["project_id", request.projectId],
421
+ ["reverse", request.reverse],
422
+ ["tags", request.tags]
423
+ )
424
+ },
425
+ unmarshalListIPsResponse
426
+ );
427
+ /**
428
+ * List IPs. List Public Gateway flexible IP addresses. A number of filter
429
+ * options are available for limiting results in the response.
430
+ *
431
+ * @param request - The request {@link ListIPsRequest}
432
+ * @returns A Promise of ListIPsResponse
433
+ */
434
+ listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
435
+ /**
436
+ * Get an IP. Get details of a Public Gateway flexible IP address, identified
437
+ * by its IP ID. The response object contains information including which (if
438
+ * any) Public Gateway using this IP address, the reverse and various other
439
+ * metadata.
440
+ *
441
+ * @param request - The request {@link GetIPRequest}
442
+ * @returns A Promise of IP
443
+ */
444
+ getIP = (request) => this.client.fetch(
445
+ {
446
+ method: "GET",
447
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
448
+ },
449
+ unmarshalIP
450
+ );
451
+ /**
452
+ * Reserve an IP. Create (reserve) a new flexible IP address that can be used
453
+ * for a Public Gateway in a specified Scaleway Project.
454
+ *
455
+ * @param request - The request {@link CreateIPRequest}
456
+ * @returns A Promise of IP
457
+ */
458
+ createIP = (request = {}) => this.client.fetch(
459
+ {
460
+ body: JSON.stringify(
461
+ marshalCreateIPRequest(request, this.client.settings)
462
+ ),
463
+ headers: jsonContentHeaders,
464
+ method: "POST",
465
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
466
+ },
467
+ unmarshalIP
468
+ );
469
+ /**
470
+ * Update an IP. Update details of an existing flexible IP address, including
471
+ * its tags, reverse and the Public Gateway it is assigned to.
472
+ *
473
+ * @param request - The request {@link UpdateIPRequest}
474
+ * @returns A Promise of IP
475
+ */
476
+ updateIP = (request) => this.client.fetch(
477
+ {
478
+ body: JSON.stringify(
479
+ marshalUpdateIPRequest(request, this.client.settings)
480
+ ),
481
+ headers: jsonContentHeaders,
482
+ method: "PATCH",
483
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
484
+ },
485
+ unmarshalIP
486
+ );
487
+ /**
488
+ * Delete an IP. Delete a flexible IP address from your account. This action
489
+ * is irreversible.
490
+ *
491
+ * @param request - The request {@link DeleteIPRequest}
492
+ */
493
+ deleteIP = (request) => this.client.fetch({
494
+ method: "DELETE",
495
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
496
+ });
497
+ /**
498
+ * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public
499
+ * Gateway, specified by its gateway ID. This adds any new SSH keys in the
500
+ * gateway's Scaleway Project to the gateway itself.
501
+ *
502
+ * @param request - The request {@link RefreshSSHKeysRequest}
503
+ * @returns A Promise of Gateway
504
+ */
505
+ refreshSSHKeys = (request) => this.client.fetch(
506
+ {
507
+ body: "{}",
508
+ headers: jsonContentHeaders,
509
+ method: "POST",
510
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
511
+ },
512
+ unmarshalGateway
513
+ );
514
+ }
515
+ export {
516
+ API
517
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const GATEWAY_NETWORK_TRANSIENT_STATUSES = [
4
+ "attaching",
5
+ "configuring",
6
+ "detaching"
7
+ ];
8
+ const GATEWAY_TRANSIENT_STATUSES = [
9
+ "allocating",
10
+ "configuring",
11
+ "stopping",
12
+ "deleting"
13
+ ];
14
+ exports.GATEWAY_NETWORK_TRANSIENT_STATUSES = GATEWAY_NETWORK_TRANSIENT_STATUSES;
15
+ exports.GATEWAY_TRANSIENT_STATUSES = GATEWAY_TRANSIENT_STATUSES;
@@ -0,0 +1,5 @@
1
+ import type { GatewayNetworkStatus, GatewayStatus } from './types.gen';
2
+ /** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */
3
+ export declare const GATEWAY_NETWORK_TRANSIENT_STATUSES: GatewayNetworkStatus[];
4
+ /** Lists transient statutes of the enum {@link GatewayStatus}. */
5
+ export declare const GATEWAY_TRANSIENT_STATUSES: GatewayStatus[];
@@ -0,0 +1,15 @@
1
+ const GATEWAY_NETWORK_TRANSIENT_STATUSES = [
2
+ "attaching",
3
+ "configuring",
4
+ "detaching"
5
+ ];
6
+ const GATEWAY_TRANSIENT_STATUSES = [
7
+ "allocating",
8
+ "configuring",
9
+ "stopping",
10
+ "deleting"
11
+ ];
12
+ export {
13
+ GATEWAY_NETWORK_TRANSIENT_STATUSES,
14
+ GATEWAY_TRANSIENT_STATUSES
15
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const content_gen = require("./content.gen.cjs");
5
+ exports.API = api_gen.API;
6
+ exports.GATEWAY_NETWORK_TRANSIENT_STATUSES = content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES;
7
+ exports.GATEWAY_TRANSIENT_STATUSES = content_gen.GATEWAY_TRANSIENT_STATUSES;
@@ -0,0 +1,3 @@
1
+ export { API } from './api.gen';
2
+ export * from './content.gen';
3
+ export type { CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GatewayNetworkStatus, GatewayStatus, GatewayType, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksRequestOrderBy, ListGatewayNetworksResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListGatewaysRequest, ListGatewaysRequestOrderBy, ListGatewaysResponse, ListIPsRequest, ListIPsRequestOrderBy, ListIPsResponse, ListPatRulesRequest, ListPatRulesRequestOrderBy, ListPatRulesResponse, PatRule, PatRuleProtocol, RefreshSSHKeysRequest, SetPatRulesRequest, SetPatRulesRequestRule, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest, } from './types.gen';
@@ -0,0 +1,7 @@
1
+ import { API } from "./api.gen.js";
2
+ import { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ export {
4
+ API,
5
+ GATEWAY_NETWORK_TRANSIENT_STATUSES,
6
+ GATEWAY_TRANSIENT_STATUSES
7
+ };