@scaleway/sdk-vpcgw 1.0.1

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.
@@ -0,0 +1,693 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends sdkClient.API {
10
+ /** Lists the available zones of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par-1",
13
+ "fr-par-2",
14
+ "nl-ams-1",
15
+ "nl-ams-2",
16
+ "nl-ams-3",
17
+ "pl-waw-1",
18
+ "pl-waw-2",
19
+ "pl-waw-3"
20
+ ];
21
+ pageOfListGateways = (request = {}) => this.client.fetch(
22
+ {
23
+ method: "GET",
24
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
25
+ urlParams: sdkClient.urlParams(
26
+ ["name", request.name],
27
+ ["order_by", request.orderBy],
28
+ ["organization_id", request.organizationId],
29
+ ["page", request.page],
30
+ [
31
+ "page_size",
32
+ request.pageSize ?? this.client.settings.defaultPageSize
33
+ ],
34
+ ["private_network_id", request.privateNetworkId],
35
+ ["project_id", request.projectId],
36
+ ["status", request.status],
37
+ ["tags", request.tags],
38
+ ["type", request.type]
39
+ )
40
+ },
41
+ marshalling_gen.unmarshalListGatewaysResponse
42
+ );
43
+ /**
44
+ * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.
45
+ *
46
+ * @deprecated
47
+ * @param request - The request {@link ListGatewaysRequest}
48
+ * @returns A Promise of ListGatewaysResponse
49
+ */
50
+ listGateways = (request = {}) => sdkClient.enrichForPagination("gateways", this.pageOfListGateways, request);
51
+ /**
52
+ * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more.
53
+ *
54
+ * @deprecated
55
+ * @param request - The request {@link GetGatewayRequest}
56
+ * @returns A Promise of Gateway
57
+ */
58
+ getGateway = (request) => this.client.fetch(
59
+ {
60
+ method: "GET",
61
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
62
+ },
63
+ marshalling_gen.unmarshalGateway
64
+ );
65
+ /**
66
+ * Waits for {@link Gateway} to be in a final state.
67
+ *
68
+ * @param request - The request {@link GetGatewayRequest}
69
+ * @param options - The waiting options
70
+ * @returns A Promise of Gateway
71
+ */
72
+ waitForGateway = (request, options) => sdkClient.waitForResource(
73
+ options?.stop ?? ((res) => Promise.resolve(
74
+ !content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status)
75
+ )),
76
+ this.getGateway,
77
+ request,
78
+ options
79
+ );
80
+ /**
81
+ * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion.
82
+ *
83
+ * @deprecated
84
+ * @param request - The request {@link CreateGatewayRequest}
85
+ * @returns A Promise of Gateway
86
+ */
87
+ createGateway = (request) => this.client.fetch(
88
+ {
89
+ body: JSON.stringify(
90
+ marshalling_gen.marshalCreateGatewayRequest(request, this.client.settings)
91
+ ),
92
+ headers: jsonContentHeaders,
93
+ method: "POST",
94
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
95
+ },
96
+ marshalling_gen.unmarshalGateway
97
+ );
98
+ /**
99
+ * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**.
100
+ *
101
+ * @deprecated
102
+ * @param request - The request {@link UpdateGatewayRequest}
103
+ * @returns A Promise of Gateway
104
+ */
105
+ updateGateway = (request) => this.client.fetch(
106
+ {
107
+ body: JSON.stringify(
108
+ marshalling_gen.marshalUpdateGatewayRequest(request, this.client.settings)
109
+ ),
110
+ headers: jsonContentHeaders,
111
+ method: "PATCH",
112
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
113
+ },
114
+ marshalling_gen.unmarshalGateway
115
+ );
116
+ /**
117
+ * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.
118
+ *
119
+ * @deprecated
120
+ * @param request - The request {@link DeleteGatewayRequest}
121
+ */
122
+ deleteGateway = (request) => this.client.fetch({
123
+ method: "DELETE",
124
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`,
125
+ urlParams: sdkClient.urlParams(["cleanup_dhcp", request.cleanupDhcp])
126
+ });
127
+ /**
128
+ * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.
129
+ *
130
+ * @deprecated
131
+ * @param request - The request {@link UpgradeGatewayRequest}
132
+ * @returns A Promise of Gateway
133
+ */
134
+ upgradeGateway = (request) => this.client.fetch(
135
+ {
136
+ body: JSON.stringify(
137
+ marshalling_gen.marshalUpgradeGatewayRequest(request, this.client.settings)
138
+ ),
139
+ headers: jsonContentHeaders,
140
+ method: "POST",
141
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}/upgrade`
142
+ },
143
+ marshalling_gen.unmarshalGateway
144
+ );
145
+ /**
146
+ * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP mobility (move from NAT IP to routed IP). This is idempotent: repeated calls after the first will return no error but have no effect.
147
+ *
148
+ * @deprecated
149
+ * @param request - The request {@link EnableIPMobilityRequest}
150
+ */
151
+ enableIPMobility = (request) => this.client.fetch({
152
+ body: "{}",
153
+ headers: jsonContentHeaders,
154
+ method: "POST",
155
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}/enable-ip-mobility`
156
+ });
157
+ pageOfListGatewayNetworks = (request = {}) => this.client.fetch(
158
+ {
159
+ method: "GET",
160
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
161
+ urlParams: sdkClient.urlParams(
162
+ ["dhcp_id", request.dhcpId],
163
+ ["enable_masquerade", request.enableMasquerade],
164
+ ["gateway_id", request.gatewayId],
165
+ ["order_by", request.orderBy],
166
+ ["page", request.page],
167
+ [
168
+ "page_size",
169
+ request.pageSize ?? this.client.settings.defaultPageSize
170
+ ],
171
+ ["private_network_id", request.privateNetworkId],
172
+ ["status", request.status]
173
+ )
174
+ },
175
+ marshalling_gen.unmarshalListGatewayNetworksResponse
176
+ );
177
+ /**
178
+ * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.
179
+ *
180
+ * @deprecated
181
+ * @param request - The request {@link ListGatewayNetworksRequest}
182
+ * @returns A Promise of ListGatewayNetworksResponse
183
+ */
184
+ listGatewayNetworks = (request = {}) => sdkClient.enrichForPagination(
185
+ "gatewayNetworks",
186
+ this.pageOfListGatewayNetworks,
187
+ request
188
+ );
189
+ /**
190
+ * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.
191
+ *
192
+ * @deprecated
193
+ * @param request - The request {@link GetGatewayNetworkRequest}
194
+ * @returns A Promise of GatewayNetwork
195
+ */
196
+ getGatewayNetwork = (request) => this.client.fetch(
197
+ {
198
+ method: "GET",
199
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${sdkClient.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
200
+ },
201
+ marshalling_gen.unmarshalGatewayNetwork
202
+ );
203
+ /**
204
+ * Waits for {@link GatewayNetwork} to be in a final state.
205
+ *
206
+ * @param request - The request {@link GetGatewayNetworkRequest}
207
+ * @param options - The waiting options
208
+ * @returns A Promise of GatewayNetwork
209
+ */
210
+ waitForGatewayNetwork = (request, options) => sdkClient.waitForResource(
211
+ options?.stop ?? ((res) => Promise.resolve(
212
+ !content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status)
213
+ )),
214
+ this.getGatewayNetwork,
215
+ request,
216
+ options
217
+ );
218
+ /**
219
+ * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including DHCP settings, whether to enable masquerade (dynamic NAT), and more.
220
+ *
221
+ * @deprecated
222
+ * @param request - The request {@link CreateGatewayNetworkRequest}
223
+ * @returns A Promise of GatewayNetwork
224
+ */
225
+ createGatewayNetwork = (request) => this.client.fetch(
226
+ {
227
+ body: JSON.stringify(
228
+ marshalling_gen.marshalCreateGatewayNetworkRequest(request, this.client.settings)
229
+ ),
230
+ headers: jsonContentHeaders,
231
+ method: "POST",
232
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
233
+ },
234
+ marshalling_gen.unmarshalGatewayNetwork
235
+ );
236
+ /**
237
+ * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include DHCP settings and whether to enable traffic masquerade (dynamic NAT).
238
+ *
239
+ * @deprecated
240
+ * @param request - The request {@link UpdateGatewayNetworkRequest}
241
+ * @returns A Promise of GatewayNetwork
242
+ */
243
+ updateGatewayNetwork = (request) => this.client.fetch(
244
+ {
245
+ body: JSON.stringify(
246
+ marshalling_gen.marshalUpdateGatewayNetworkRequest(request, this.client.settings)
247
+ ),
248
+ headers: jsonContentHeaders,
249
+ method: "PATCH",
250
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${sdkClient.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
251
+ },
252
+ marshalling_gen.unmarshalGatewayNetwork
253
+ );
254
+ /**
255
+ * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.
256
+ *
257
+ * @deprecated
258
+ * @param request - The request {@link DeleteGatewayNetworkRequest}
259
+ */
260
+ deleteGatewayNetwork = (request) => this.client.fetch({
261
+ method: "DELETE",
262
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${sdkClient.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`,
263
+ urlParams: sdkClient.urlParams(["cleanup_dhcp", request.cleanupDhcp])
264
+ });
265
+ pageOfListDHCPs = (request = {}) => this.client.fetch(
266
+ {
267
+ method: "GET",
268
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`,
269
+ urlParams: sdkClient.urlParams(
270
+ ["address", request.address],
271
+ ["has_address", request.hasAddress],
272
+ ["order_by", request.orderBy],
273
+ ["organization_id", request.organizationId],
274
+ ["page", request.page],
275
+ [
276
+ "page_size",
277
+ request.pageSize ?? this.client.settings.defaultPageSize
278
+ ],
279
+ ["project_id", request.projectId]
280
+ )
281
+ },
282
+ marshalling_gen.unmarshalListDHCPsResponse
283
+ );
284
+ /**
285
+ * List DHCP configurations. List DHCP configurations, optionally filtering by Organization, Project, Public Gateway IP address or more. The response is an array of DHCP configuration objects, each identified by a DHCP ID and containing configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
286
+ *
287
+ * @deprecated
288
+ * @param request - The request {@link ListDHCPsRequest}
289
+ * @returns A Promise of ListDHCPsResponse
290
+ */
291
+ listDHCPs = (request = {}) => sdkClient.enrichForPagination("dhcps", this.pageOfListDHCPs, request);
292
+ /**
293
+ * Get a DHCP configuration. Get a DHCP configuration object, identified by its DHCP ID. The response object contains configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
294
+ *
295
+ * @deprecated
296
+ * @param request - The request {@link GetDHCPRequest}
297
+ * @returns A Promise of DHCP
298
+ */
299
+ getDHCP = (request) => this.client.fetch(
300
+ {
301
+ method: "GET",
302
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${sdkClient.validatePathParam("dhcpId", request.dhcpId)}`
303
+ },
304
+ marshalling_gen.unmarshalDHCP
305
+ );
306
+ /**
307
+ * Create a DHCP configuration. Create a new DHCP configuration object, containing settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. The response object includes the ID of the DHCP configuration object. You can use this ID as part of a call to `Create a Public Gateway connection to a Private Network` or `Update a Public Gateway connection to a Private Network` to directly apply this DHCP configuration.
308
+ *
309
+ * @deprecated
310
+ * @param request - The request {@link CreateDHCPRequest}
311
+ * @returns A Promise of DHCP
312
+ */
313
+ createDHCP = (request) => this.client.fetch(
314
+ {
315
+ body: JSON.stringify(
316
+ marshalling_gen.marshalCreateDHCPRequest(request, this.client.settings)
317
+ ),
318
+ headers: jsonContentHeaders,
319
+ method: "POST",
320
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`
321
+ },
322
+ marshalling_gen.unmarshalDHCP
323
+ );
324
+ /**
325
+ * Update a DHCP configuration. Update a DHCP configuration object, identified by its DHCP ID.
326
+ *
327
+ * @deprecated
328
+ * @param request - The request {@link UpdateDHCPRequest}
329
+ * @returns A Promise of DHCP
330
+ */
331
+ updateDHCP = (request) => this.client.fetch(
332
+ {
333
+ body: JSON.stringify(
334
+ marshalling_gen.marshalUpdateDHCPRequest(request, this.client.settings)
335
+ ),
336
+ headers: jsonContentHeaders,
337
+ method: "PATCH",
338
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${sdkClient.validatePathParam("dhcpId", request.dhcpId)}`
339
+ },
340
+ marshalling_gen.unmarshalDHCP
341
+ );
342
+ /**
343
+ * Delete a DHCP configuration. Delete a DHCP configuration object, identified by its DHCP ID. Note that you cannot delete a DHCP configuration object that is currently being used by a Gateway Network.
344
+ *
345
+ * @deprecated
346
+ * @param request - The request {@link DeleteDHCPRequest}
347
+ */
348
+ deleteDHCP = (request) => this.client.fetch({
349
+ method: "DELETE",
350
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${sdkClient.validatePathParam("dhcpId", request.dhcpId)}`
351
+ });
352
+ pageOfListDHCPEntries = (request = {}) => this.client.fetch(
353
+ {
354
+ method: "GET",
355
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`,
356
+ urlParams: sdkClient.urlParams(
357
+ ["gateway_network_id", request.gatewayNetworkId],
358
+ ["hostname", request.hostname],
359
+ ["ip_address", request.ipAddress],
360
+ ["mac_address", request.macAddress],
361
+ ["order_by", request.orderBy],
362
+ ["page", request.page],
363
+ [
364
+ "page_size",
365
+ request.pageSize ?? this.client.settings.defaultPageSize
366
+ ],
367
+ ["type", request.type]
368
+ )
369
+ },
370
+ marshalling_gen.unmarshalListDHCPEntriesResponse
371
+ );
372
+ /**
373
+ * List DHCP entries. List DHCP entries, whether dynamically assigned and/or statically reserved. DHCP entries can be filtered by the Gateway Network they are on, their MAC address, IP address, type or hostname.
374
+ *
375
+ * @deprecated
376
+ * @param request - The request {@link ListDHCPEntriesRequest}
377
+ * @returns A Promise of ListDHCPEntriesResponse
378
+ */
379
+ listDHCPEntries = (request = {}) => sdkClient.enrichForPagination("dhcpEntries", this.pageOfListDHCPEntries, request);
380
+ /**
381
+ * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.
382
+ *
383
+ * @deprecated
384
+ * @param request - The request {@link GetDHCPEntryRequest}
385
+ * @returns A Promise of DHCPEntry
386
+ */
387
+ getDHCPEntry = (request) => this.client.fetch(
388
+ {
389
+ method: "GET",
390
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${sdkClient.validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
391
+ },
392
+ marshalling_gen.unmarshalDHCPEntry
393
+ );
394
+ /**
395
+ * Create a DHCP entry. Create a static DHCP reservation, specifying the Gateway Network for the reservation, the MAC address of the target device and the IP address to assign this device. The response is a DHCP entry object, confirming the ID and configuration details of the static DHCP reservation.
396
+ *
397
+ * @deprecated
398
+ * @param request - The request {@link CreateDHCPEntryRequest}
399
+ * @returns A Promise of DHCPEntry
400
+ */
401
+ createDHCPEntry = (request) => this.client.fetch(
402
+ {
403
+ body: JSON.stringify(
404
+ marshalling_gen.marshalCreateDHCPEntryRequest(request, this.client.settings)
405
+ ),
406
+ headers: jsonContentHeaders,
407
+ method: "POST",
408
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
409
+ },
410
+ marshalling_gen.unmarshalDHCPEntry
411
+ );
412
+ /**
413
+ * Update a DHCP entry. Update the IP address for a DHCP entry, specified by its DHCP entry ID. You can update an existing DHCP entry of any type (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually updating the IP address the entry will necessarily be of type `reservation` after the update.
414
+ *
415
+ * @deprecated
416
+ * @param request - The request {@link UpdateDHCPEntryRequest}
417
+ * @returns A Promise of DHCPEntry
418
+ */
419
+ updateDHCPEntry = (request) => this.client.fetch(
420
+ {
421
+ body: JSON.stringify(
422
+ marshalling_gen.marshalUpdateDHCPEntryRequest(request, this.client.settings)
423
+ ),
424
+ headers: jsonContentHeaders,
425
+ method: "PATCH",
426
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${sdkClient.validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
427
+ },
428
+ marshalling_gen.unmarshalDHCPEntry
429
+ );
430
+ /**
431
+ * Set all DHCP reservations on a Gateway Network. Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries accordingly.
432
+ *
433
+ * @deprecated
434
+ * @param request - The request {@link SetDHCPEntriesRequest}
435
+ * @returns A Promise of SetDHCPEntriesResponse
436
+ */
437
+ setDHCPEntries = (request) => this.client.fetch(
438
+ {
439
+ body: JSON.stringify(
440
+ marshalling_gen.marshalSetDHCPEntriesRequest(request, this.client.settings)
441
+ ),
442
+ headers: jsonContentHeaders,
443
+ method: "PUT",
444
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
445
+ },
446
+ marshalling_gen.unmarshalSetDHCPEntriesResponse
447
+ );
448
+ /**
449
+ * Delete a DHCP entry. Delete a static DHCP reservation, identified by its DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, these are deleted automatically when their time-to-live expires.
450
+ *
451
+ * @deprecated
452
+ * @param request - The request {@link DeleteDHCPEntryRequest}
453
+ */
454
+ deleteDHCPEntry = (request) => this.client.fetch({
455
+ method: "DELETE",
456
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${sdkClient.validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
457
+ });
458
+ pageOfListPATRules = (request = {}) => this.client.fetch(
459
+ {
460
+ method: "GET",
461
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
462
+ urlParams: sdkClient.urlParams(
463
+ ["gateway_id", request.gatewayId],
464
+ ["order_by", request.orderBy],
465
+ ["page", request.page],
466
+ [
467
+ "page_size",
468
+ request.pageSize ?? this.client.settings.defaultPageSize
469
+ ],
470
+ ["private_ip", request.privateIp],
471
+ ["protocol", request.protocol]
472
+ )
473
+ },
474
+ marshalling_gen.unmarshalListPATRulesResponse
475
+ );
476
+ /**
477
+ * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.
478
+ *
479
+ * @deprecated
480
+ * @param request - The request {@link ListPATRulesRequest}
481
+ * @returns A Promise of ListPATRulesResponse
482
+ */
483
+ listPATRules = (request = {}) => sdkClient.enrichForPagination("patRules", this.pageOfListPATRules, request);
484
+ /**
485
+ * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.
486
+ *
487
+ * @deprecated
488
+ * @param request - The request {@link GetPATRuleRequest}
489
+ * @returns A Promise of PATRule
490
+ */
491
+ getPATRule = (request) => this.client.fetch(
492
+ {
493
+ method: "GET",
494
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${sdkClient.validatePathParam("patRuleId", request.patRuleId)}`
495
+ },
496
+ marshalling_gen.unmarshalPATRule
497
+ );
498
+ /**
499
+ * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.
500
+ *
501
+ * @deprecated
502
+ * @param request - The request {@link CreatePATRuleRequest}
503
+ * @returns A Promise of PATRule
504
+ */
505
+ createPATRule = (request) => this.client.fetch(
506
+ {
507
+ body: JSON.stringify(
508
+ marshalling_gen.marshalCreatePATRuleRequest(request, this.client.settings)
509
+ ),
510
+ headers: jsonContentHeaders,
511
+ method: "POST",
512
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
513
+ },
514
+ marshalling_gen.unmarshalPATRule
515
+ );
516
+ /**
517
+ * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.
518
+ *
519
+ * @deprecated
520
+ * @param request - The request {@link UpdatePATRuleRequest}
521
+ * @returns A Promise of PATRule
522
+ */
523
+ updatePATRule = (request) => this.client.fetch(
524
+ {
525
+ body: JSON.stringify(
526
+ marshalling_gen.marshalUpdatePATRuleRequest(request, this.client.settings)
527
+ ),
528
+ headers: jsonContentHeaders,
529
+ method: "PATCH",
530
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${sdkClient.validatePathParam("patRuleId", request.patRuleId)}`
531
+ },
532
+ marshalling_gen.unmarshalPATRule
533
+ );
534
+ /**
535
+ * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.
536
+ *
537
+ * @deprecated
538
+ * @param request - The request {@link SetPATRulesRequest}
539
+ * @returns A Promise of SetPATRulesResponse
540
+ */
541
+ setPATRules = (request) => this.client.fetch(
542
+ {
543
+ body: JSON.stringify(
544
+ marshalling_gen.marshalSetPATRulesRequest(request, this.client.settings)
545
+ ),
546
+ headers: jsonContentHeaders,
547
+ method: "PUT",
548
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
549
+ },
550
+ marshalling_gen.unmarshalSetPATRulesResponse
551
+ );
552
+ /**
553
+ * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.
554
+ *
555
+ * @deprecated
556
+ * @param request - The request {@link DeletePATRuleRequest}
557
+ */
558
+ deletePATRule = (request) => this.client.fetch({
559
+ method: "DELETE",
560
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${sdkClient.validatePathParam("patRuleId", request.patRuleId)}`
561
+ });
562
+ /**
563
+ * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
564
+ *
565
+ * @deprecated
566
+ * @param request - The request {@link ListGatewayTypesRequest}
567
+ * @returns A Promise of ListGatewayTypesResponse
568
+ */
569
+ listGatewayTypes = (request = {}) => this.client.fetch(
570
+ {
571
+ method: "GET",
572
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
573
+ },
574
+ marshalling_gen.unmarshalListGatewayTypesResponse
575
+ );
576
+ pageOfListIPs = (request = {}) => this.client.fetch(
577
+ {
578
+ method: "GET",
579
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
580
+ urlParams: sdkClient.urlParams(
581
+ ["is_free", request.isFree],
582
+ ["order_by", request.orderBy],
583
+ ["organization_id", request.organizationId],
584
+ ["page", request.page],
585
+ [
586
+ "page_size",
587
+ request.pageSize ?? this.client.settings.defaultPageSize
588
+ ],
589
+ ["project_id", request.projectId],
590
+ ["reverse", request.reverse],
591
+ ["tags", request.tags]
592
+ )
593
+ },
594
+ marshalling_gen.unmarshalListIPsResponse
595
+ );
596
+ /**
597
+ * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.
598
+ *
599
+ * @deprecated
600
+ * @param request - The request {@link ListIPsRequest}
601
+ * @returns A Promise of ListIPsResponse
602
+ */
603
+ listIPs = (request = {}) => sdkClient.enrichForPagination("ips", this.pageOfListIPs, request);
604
+ /**
605
+ * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.
606
+ *
607
+ * @deprecated
608
+ * @param request - The request {@link GetIPRequest}
609
+ * @returns A Promise of IP
610
+ */
611
+ getIP = (request) => this.client.fetch(
612
+ {
613
+ method: "GET",
614
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
615
+ },
616
+ marshalling_gen.unmarshalIP
617
+ );
618
+ /**
619
+ * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.
620
+ *
621
+ * @deprecated
622
+ * @param request - The request {@link CreateIPRequest}
623
+ * @returns A Promise of IP
624
+ */
625
+ createIP = (request = {}) => this.client.fetch(
626
+ {
627
+ body: JSON.stringify(
628
+ marshalling_gen.marshalCreateIPRequest(request, this.client.settings)
629
+ ),
630
+ headers: jsonContentHeaders,
631
+ method: "POST",
632
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
633
+ },
634
+ marshalling_gen.unmarshalIP
635
+ );
636
+ /**
637
+ * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.
638
+ *
639
+ * @deprecated
640
+ * @param request - The request {@link UpdateIPRequest}
641
+ * @returns A Promise of IP
642
+ */
643
+ updateIP = (request) => this.client.fetch(
644
+ {
645
+ body: JSON.stringify(
646
+ marshalling_gen.marshalUpdateIPRequest(request, this.client.settings)
647
+ ),
648
+ headers: jsonContentHeaders,
649
+ method: "PATCH",
650
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
651
+ },
652
+ marshalling_gen.unmarshalIP
653
+ );
654
+ /**
655
+ * Delete an IP. Delete a flexible IP address from your account. This action is irreversible.
656
+ *
657
+ * @deprecated
658
+ * @param request - The request {@link DeleteIPRequest}
659
+ */
660
+ deleteIP = (request) => this.client.fetch({
661
+ method: "DELETE",
662
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
663
+ });
664
+ /**
665
+ * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
666
+ *
667
+ * @deprecated
668
+ * @param request - The request {@link RefreshSSHKeysRequest}
669
+ * @returns A Promise of Gateway
670
+ */
671
+ refreshSSHKeys = (request) => this.client.fetch(
672
+ {
673
+ body: "{}",
674
+ headers: jsonContentHeaders,
675
+ method: "POST",
676
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
677
+ },
678
+ marshalling_gen.unmarshalGateway
679
+ );
680
+ /**
681
+ * Put a Public Gateway in IPAM mode. Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.
682
+ *
683
+ * @deprecated
684
+ * @param request - The request {@link MigrateToV2Request}
685
+ */
686
+ migrateToV2 = (request) => this.client.fetch({
687
+ body: "{}",
688
+ headers: jsonContentHeaders,
689
+ method: "POST",
690
+ path: `/vpc-gw/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}/migrate-to-v2`
691
+ });
692
+ }
693
+ exports.API = API;