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