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