@scaleway/sdk-vpc 2.2.1 → 2.3.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.
@@ -1,465 +1,268 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
2
- import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, unmarshalListSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse, marshalCreateRouteRequest, unmarshalRoute, marshalUpdateRouteRequest, unmarshalGetAclResponse, marshalSetAclRequest, unmarshalSetAclResponse, unmarshalListVPCConnectorsResponse, marshalCreateVPCConnectorRequest, unmarshalVPCConnector, marshalUpdateVPCConnectorRequest } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class API extends API$1 {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- regions: [
13
- "fr-par",
14
- "nl-ams",
15
- "pl-waw"
16
- ]
17
- });
18
- pageOfListVPCs = (request = {}) => this.client.fetch(
19
- {
20
- method: "GET",
21
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
22
- urlParams: urlParams(
23
- ["is_default", request.isDefault],
24
- ["name", request.name],
25
- ["order_by", request.orderBy],
26
- ["organization_id", request.organizationId],
27
- ["page", request.page],
28
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
29
- ["project_id", request.projectId],
30
- ["routing_enabled", request.routingEnabled],
31
- ["tags", request.tags]
32
- )
33
- },
34
- unmarshalListVPCsResponse
35
- );
36
- /**
37
- * List VPCs. List existing VPCs in the specified region.
38
- *
39
- * @param request - The request {@link ListVPCsRequest}
40
- * @returns A Promise of ListVPCsResponse
41
- */
42
- listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
43
- /**
44
- * Create a VPC. Create a new VPC in the specified region.
45
- *
46
- * @param request - The request {@link CreateVPCRequest}
47
- * @returns A Promise of VPC
48
- */
49
- createVPC = (request) => this.client.fetch(
50
- {
51
- body: JSON.stringify(
52
- marshalCreateVPCRequest(request, this.client.settings)
53
- ),
54
- headers: jsonContentHeaders,
55
- method: "POST",
56
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
57
- },
58
- unmarshalVPC
59
- );
60
- /**
61
- * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
62
- *
63
- * @param request - The request {@link GetVPCRequest}
64
- * @returns A Promise of VPC
65
- */
66
- getVPC = (request) => this.client.fetch(
67
- {
68
- method: "GET",
69
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
70
- },
71
- unmarshalVPC
72
- );
73
- /**
74
- * Update VPC. Update parameters including name and tags of the specified VPC.
75
- *
76
- * @param request - The request {@link UpdateVPCRequest}
77
- * @returns A Promise of VPC
78
- */
79
- updateVPC = (request) => this.client.fetch(
80
- {
81
- body: JSON.stringify(
82
- marshalUpdateVPCRequest(request, this.client.settings)
83
- ),
84
- headers: jsonContentHeaders,
85
- method: "PATCH",
86
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
87
- },
88
- unmarshalVPC
89
- );
90
- /**
91
- * Delete a VPC. Delete a VPC specified by its VPC ID.
92
- *
93
- * @param request - The request {@link DeleteVPCRequest}
94
- */
95
- deleteVPC = (request) => this.client.fetch(
96
- {
97
- method: "DELETE",
98
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
99
- }
100
- );
101
- pageOfListPrivateNetworks = (request = {}) => this.client.fetch(
102
- {
103
- method: "GET",
104
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
105
- urlParams: urlParams(
106
- ["dhcp_enabled", request.dhcpEnabled],
107
- ["name", request.name],
108
- ["order_by", request.orderBy],
109
- ["organization_id", request.organizationId],
110
- ["page", request.page],
111
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
112
- ["private_network_ids", request.privateNetworkIds],
113
- ["project_id", request.projectId],
114
- ["tags", request.tags],
115
- ["vpc_id", request.vpcId]
116
- )
117
- },
118
- unmarshalListPrivateNetworksResponse
119
- );
120
- /**
121
- * List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
122
- *
123
- * @param request - The request {@link ListPrivateNetworksRequest}
124
- * @returns A Promise of ListPrivateNetworksResponse
125
- */
126
- listPrivateNetworks = (request = {}) => enrichForPagination("privateNetworks", this.pageOfListPrivateNetworks, request);
127
- /**
128
- * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
129
- *
130
- * @param request - The request {@link CreatePrivateNetworkRequest}
131
- * @returns A Promise of PrivateNetwork
132
- */
133
- createPrivateNetwork = (request) => this.client.fetch(
134
- {
135
- body: JSON.stringify(
136
- marshalCreatePrivateNetworkRequest(request, this.client.settings)
137
- ),
138
- headers: jsonContentHeaders,
139
- method: "POST",
140
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
141
- },
142
- unmarshalPrivateNetwork
143
- );
144
- /**
145
- * Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object.
146
- *
147
- * @param request - The request {@link GetPrivateNetworkRequest}
148
- * @returns A Promise of PrivateNetwork
149
- */
150
- getPrivateNetwork = (request) => this.client.fetch(
151
- {
152
- method: "GET",
153
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
154
- },
155
- unmarshalPrivateNetwork
156
- );
157
- /**
158
- * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
159
- *
160
- * @param request - The request {@link UpdatePrivateNetworkRequest}
161
- * @returns A Promise of PrivateNetwork
162
- */
163
- updatePrivateNetwork = (request) => this.client.fetch(
164
- {
165
- body: JSON.stringify(
166
- marshalUpdatePrivateNetworkRequest(request, this.client.settings)
167
- ),
168
- headers: jsonContentHeaders,
169
- method: "PATCH",
170
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
171
- },
172
- unmarshalPrivateNetwork
173
- );
174
- /**
175
- * Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it.
176
- *
177
- * @param request - The request {@link DeletePrivateNetworkRequest}
178
- */
179
- deletePrivateNetwork = (request) => this.client.fetch(
180
- {
181
- method: "DELETE",
182
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
183
- }
184
- );
185
- /**
186
- * Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards.
187
- *
188
- * @param request - The request {@link EnableDHCPRequest}
189
- * @returns A Promise of PrivateNetwork
190
- */
191
- enableDHCP = (request) => this.client.fetch(
192
- {
193
- body: "{}",
194
- headers: jsonContentHeaders,
195
- method: "POST",
196
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
197
- },
198
- unmarshalPrivateNetwork
199
- );
200
- /**
201
- * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
202
- *
203
- * @param request - The request {@link EnableRoutingRequest}
204
- * @returns A Promise of VPC
205
- */
206
- enableRouting = (request) => this.client.fetch(
207
- {
208
- body: "{}",
209
- headers: jsonContentHeaders,
210
- method: "POST",
211
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
212
- },
213
- unmarshalVPC
214
- );
215
- /**
216
- * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
217
- *
218
- * @param request - The request {@link EnableCustomRoutesPropagationRequest}
219
- * @returns A Promise of VPC
220
- */
221
- enableCustomRoutesPropagation = (request) => this.client.fetch(
222
- {
223
- body: "{}",
224
- headers: jsonContentHeaders,
225
- method: "POST",
226
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
227
- },
228
- unmarshalVPC
229
- );
230
- pageOfListSubnets = (request = {}) => this.client.fetch(
231
- {
232
- method: "GET",
233
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
234
- urlParams: urlParams(
235
- ["order_by", request.orderBy],
236
- ["organization_id", request.organizationId],
237
- ["page", request.page],
238
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
239
- ["project_id", request.projectId],
240
- ["subnet_ids", request.subnetIds],
241
- ["vpc_id", request.vpcId]
242
- )
243
- },
244
- unmarshalListSubnetsResponse
245
- );
246
- /**
247
- * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
248
- *
249
- * @param request - The request {@link ListSubnetsRequest}
250
- * @returns A Promise of ListSubnetsResponse
251
- */
252
- listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
253
- /**
254
- * Add subnets to a Private Network. Add new subnets to an existing Private Network.
255
- *
256
- * @param request - The request {@link AddSubnetsRequest}
257
- * @returns A Promise of AddSubnetsResponse
258
- */
259
- addSubnets = (request) => this.client.fetch(
260
- {
261
- body: JSON.stringify(
262
- marshalAddSubnetsRequest(request, this.client.settings)
263
- ),
264
- headers: jsonContentHeaders,
265
- method: "POST",
266
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
267
- },
268
- unmarshalAddSubnetsResponse
269
- );
270
- /**
271
- * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
272
- *
273
- * @param request - The request {@link DeleteSubnetsRequest}
274
- * @returns A Promise of DeleteSubnetsResponse
275
- */
276
- deleteSubnets = (request) => this.client.fetch(
277
- {
278
- body: JSON.stringify(
279
- marshalDeleteSubnetsRequest(request, this.client.settings)
280
- ),
281
- headers: jsonContentHeaders,
282
- method: "DELETE",
283
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
284
- },
285
- unmarshalDeleteSubnetsResponse
286
- );
287
- /**
288
- * Create a Route. Create a new custom Route.
289
- *
290
- * @param request - The request {@link CreateRouteRequest}
291
- * @returns A Promise of Route
292
- */
293
- createRoute = (request) => this.client.fetch(
294
- {
295
- body: JSON.stringify(
296
- marshalCreateRouteRequest(request, this.client.settings)
297
- ),
298
- headers: jsonContentHeaders,
299
- method: "POST",
300
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
301
- },
302
- unmarshalRoute
303
- );
304
- /**
305
- * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
306
- *
307
- * @param request - The request {@link GetRouteRequest}
308
- * @returns A Promise of Route
309
- */
310
- getRoute = (request) => this.client.fetch(
311
- {
312
- method: "GET",
313
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
314
- },
315
- unmarshalRoute
316
- );
317
- /**
318
- * Update Route. Update parameters of the specified Route.
319
- *
320
- * @param request - The request {@link UpdateRouteRequest}
321
- * @returns A Promise of Route
322
- */
323
- updateRoute = (request) => this.client.fetch(
324
- {
325
- body: JSON.stringify(
326
- marshalUpdateRouteRequest(request, this.client.settings)
327
- ),
328
- headers: jsonContentHeaders,
329
- method: "PATCH",
330
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
331
- },
332
- unmarshalRoute
333
- );
334
- /**
335
- * Delete a Route. Delete a Route specified by its Route ID.
336
- *
337
- * @param request - The request {@link DeleteRouteRequest}
338
- */
339
- deleteRoute = (request) => this.client.fetch(
340
- {
341
- method: "DELETE",
342
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
343
- }
344
- );
345
- /**
346
- * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
347
- *
348
- * @param request - The request {@link GetAclRequest}
349
- * @returns A Promise of GetAclResponse
350
- */
351
- getAcl = (request) => this.client.fetch(
352
- {
353
- method: "GET",
354
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
355
- urlParams: urlParams(
356
- ["is_ipv6", request.isIpv6]
357
- )
358
- },
359
- unmarshalGetAclResponse
360
- );
361
- /**
362
- * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
363
- *
364
- * @param request - The request {@link SetAclRequest}
365
- * @returns A Promise of SetAclResponse
366
- */
367
- setAcl = (request) => this.client.fetch(
368
- {
369
- body: JSON.stringify(
370
- marshalSetAclRequest(request, this.client.settings)
371
- ),
372
- headers: jsonContentHeaders,
373
- method: "PUT",
374
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
375
- },
376
- unmarshalSetAclResponse
377
- );
378
- pageOfListVPCConnectors = (request = {}) => this.client.fetch(
379
- {
380
- method: "GET",
381
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors`,
382
- urlParams: urlParams(
383
- ["name", request.name],
384
- ["order_by", request.orderBy],
385
- ["organization_id", request.organizationId],
386
- ["page", request.page],
387
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
388
- ["project_id", request.projectId],
389
- ["status", request.status],
390
- ["tags", request.tags],
391
- ["target_vpc_id", request.targetVpcId],
392
- ["vpc_id", request.vpcId]
393
- )
394
- },
395
- unmarshalListVPCConnectorsResponse
396
- );
397
- /**
398
- * List VPC connectors. List existing VPC connectors in the specified region.
399
- *
400
- * @param request - The request {@link ListVPCConnectorsRequest}
401
- * @returns A Promise of ListVPCConnectorsResponse
402
- */
403
- listVPCConnectors = (request = {}) => enrichForPagination("vpcConnectors", this.pageOfListVPCConnectors, request);
404
- /**
405
- * Create a VPC connector. Create a new VPC connector in the specified region.
406
- *
407
- * @param request - The request {@link CreateVPCConnectorRequest}
408
- * @returns A Promise of VPCConnector
409
- */
410
- createVPCConnector = (request) => this.client.fetch(
411
- {
412
- body: JSON.stringify(
413
- marshalCreateVPCConnectorRequest(request, this.client.settings)
414
- ),
415
- headers: jsonContentHeaders,
416
- method: "POST",
417
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors`
418
- },
419
- unmarshalVPCConnector
420
- );
421
- /**
422
- * Get a VPC connector. Retrieve details of an existing VPC connector, specified by its VPC connector ID.
423
- *
424
- * @param request - The request {@link GetVPCConnectorRequest}
425
- * @returns A Promise of VPCConnector
426
- */
427
- getVPCConnector = (request) => this.client.fetch(
428
- {
429
- method: "GET",
430
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
431
- },
432
- unmarshalVPCConnector
433
- );
434
- /**
435
- * Update VPC connector. Update parameters including name and tags of the specified VPC connector.
436
- *
437
- * @param request - The request {@link UpdateVPCConnectorRequest}
438
- * @returns A Promise of VPCConnector
439
- */
440
- updateVPCConnector = (request) => this.client.fetch(
441
- {
442
- body: JSON.stringify(
443
- marshalUpdateVPCConnectorRequest(request, this.client.settings)
444
- ),
445
- headers: jsonContentHeaders,
446
- method: "PATCH",
447
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
448
- },
449
- unmarshalVPCConnector
450
- );
451
- /**
452
- * Delete a VPC connector. Delete a VPC connector specified by its VPC connector ID.
453
- *
454
- * @param request - The request {@link DeleteVPCConnectorRequest}
455
- */
456
- deleteVPCConnector = (request) => this.client.fetch(
457
- {
458
- method: "DELETE",
459
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
460
- }
461
- );
462
- }
463
- export {
464
- API
1
+ import { marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * VPC API.
6
+
7
+ This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.
8
+ */
9
+ var API$1 = class extends API {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = toApiLocality({ regions: [
15
+ "fr-par",
16
+ "nl-ams",
17
+ "pl-waw"
18
+ ] });
19
+ pageOfListVPCs = (request = {}) => this.client.fetch({
20
+ method: "GET",
21
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
22
+ urlParams: urlParams(["is_default", request.isDefault], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["routing_enabled", request.routingEnabled], ["tags", request.tags])
23
+ }, unmarshalListVPCsResponse);
24
+ /**
25
+ * List VPCs. List existing VPCs in the specified region.
26
+ *
27
+ * @param request - The request {@link ListVPCsRequest}
28
+ * @returns A Promise of ListVPCsResponse
29
+ */
30
+ listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
31
+ /**
32
+ * Create a VPC. Create a new VPC in the specified region.
33
+ *
34
+ * @param request - The request {@link CreateVPCRequest}
35
+ * @returns A Promise of VPC
36
+ */
37
+ createVPC = (request) => this.client.fetch({
38
+ body: JSON.stringify(marshalCreateVPCRequest(request, this.client.settings)),
39
+ headers: jsonContentHeaders,
40
+ method: "POST",
41
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
42
+ }, unmarshalVPC);
43
+ /**
44
+ * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
45
+ *
46
+ * @param request - The request {@link GetVPCRequest}
47
+ * @returns A Promise of VPC
48
+ */
49
+ getVPC = (request) => this.client.fetch({
50
+ method: "GET",
51
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
52
+ }, unmarshalVPC);
53
+ /**
54
+ * Update VPC. Update parameters including name and tags of the specified VPC.
55
+ *
56
+ * @param request - The request {@link UpdateVPCRequest}
57
+ * @returns A Promise of VPC
58
+ */
59
+ updateVPC = (request) => this.client.fetch({
60
+ body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: "PATCH",
63
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
64
+ }, unmarshalVPC);
65
+ /**
66
+ * Delete a VPC. Delete a VPC specified by its VPC ID.
67
+ *
68
+ * @param request - The request {@link DeleteVPCRequest}
69
+ */
70
+ deleteVPC = (request) => this.client.fetch({
71
+ method: "DELETE",
72
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
73
+ });
74
+ pageOfListPrivateNetworks = (request = {}) => this.client.fetch({
75
+ method: "GET",
76
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
77
+ urlParams: urlParams(["dhcp_enabled", request.dhcpEnabled], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["tags", request.tags], ["vpc_id", request.vpcId])
78
+ }, unmarshalListPrivateNetworksResponse);
79
+ /**
80
+ * List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
81
+ *
82
+ * @param request - The request {@link ListPrivateNetworksRequest}
83
+ * @returns A Promise of ListPrivateNetworksResponse
84
+ */
85
+ listPrivateNetworks = (request = {}) => enrichForPagination("privateNetworks", this.pageOfListPrivateNetworks, request);
86
+ /**
87
+ * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
88
+ *
89
+ * @param request - The request {@link CreatePrivateNetworkRequest}
90
+ * @returns A Promise of PrivateNetwork
91
+ */
92
+ createPrivateNetwork = (request) => this.client.fetch({
93
+ body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, this.client.settings)),
94
+ headers: jsonContentHeaders,
95
+ method: "POST",
96
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
97
+ }, unmarshalPrivateNetwork);
98
+ /**
99
+ * Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object.
100
+ *
101
+ * @param request - The request {@link GetPrivateNetworkRequest}
102
+ * @returns A Promise of PrivateNetwork
103
+ */
104
+ getPrivateNetwork = (request) => this.client.fetch({
105
+ method: "GET",
106
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
107
+ }, unmarshalPrivateNetwork);
108
+ /**
109
+ * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
110
+ *
111
+ * @param request - The request {@link UpdatePrivateNetworkRequest}
112
+ * @returns A Promise of PrivateNetwork
113
+ */
114
+ updatePrivateNetwork = (request) => this.client.fetch({
115
+ body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
116
+ headers: jsonContentHeaders,
117
+ method: "PATCH",
118
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
119
+ }, unmarshalPrivateNetwork);
120
+ /**
121
+ * Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it.
122
+ *
123
+ * @param request - The request {@link DeletePrivateNetworkRequest}
124
+ */
125
+ deletePrivateNetwork = (request) => this.client.fetch({
126
+ method: "DELETE",
127
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
128
+ });
129
+ /**
130
+ * Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards.
131
+ *
132
+ * @param request - The request {@link EnableDHCPRequest}
133
+ * @returns A Promise of PrivateNetwork
134
+ */
135
+ enableDHCP = (request) => this.client.fetch({
136
+ body: "{}",
137
+ headers: jsonContentHeaders,
138
+ method: "POST",
139
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
140
+ }, unmarshalPrivateNetwork);
141
+ /**
142
+ * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
143
+ *
144
+ * @param request - The request {@link EnableRoutingRequest}
145
+ * @returns A Promise of VPC
146
+ */
147
+ enableRouting = (request) => this.client.fetch({
148
+ body: "{}",
149
+ headers: jsonContentHeaders,
150
+ method: "POST",
151
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
152
+ }, unmarshalVPC);
153
+ /**
154
+ * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
155
+ *
156
+ * @param request - The request {@link EnableCustomRoutesPropagationRequest}
157
+ * @returns A Promise of VPC
158
+ */
159
+ enableCustomRoutesPropagation = (request) => this.client.fetch({
160
+ body: "{}",
161
+ headers: jsonContentHeaders,
162
+ method: "POST",
163
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
164
+ }, unmarshalVPC);
165
+ pageOfListSubnets = (request = {}) => this.client.fetch({
166
+ method: "GET",
167
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
168
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["subnet_ids", request.subnetIds], ["vpc_id", request.vpcId])
169
+ }, unmarshalListSubnetsResponse);
170
+ /**
171
+ * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
172
+ *
173
+ * @param request - The request {@link ListSubnetsRequest}
174
+ * @returns A Promise of ListSubnetsResponse
175
+ */
176
+ listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
177
+ /**
178
+ * Add subnets to a Private Network. Add new subnets to an existing Private Network.
179
+ *
180
+ * @param request - The request {@link AddSubnetsRequest}
181
+ * @returns A Promise of AddSubnetsResponse
182
+ */
183
+ addSubnets = (request) => this.client.fetch({
184
+ body: JSON.stringify(marshalAddSubnetsRequest(request, this.client.settings)),
185
+ headers: jsonContentHeaders,
186
+ method: "POST",
187
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
188
+ }, unmarshalAddSubnetsResponse);
189
+ /**
190
+ * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
191
+ *
192
+ * @param request - The request {@link DeleteSubnetsRequest}
193
+ * @returns A Promise of DeleteSubnetsResponse
194
+ */
195
+ deleteSubnets = (request) => this.client.fetch({
196
+ body: JSON.stringify(marshalDeleteSubnetsRequest(request, this.client.settings)),
197
+ headers: jsonContentHeaders,
198
+ method: "DELETE",
199
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
200
+ }, unmarshalDeleteSubnetsResponse);
201
+ /**
202
+ * Create a Route. Create a new custom Route.
203
+ *
204
+ * @param request - The request {@link CreateRouteRequest}
205
+ * @returns A Promise of Route
206
+ */
207
+ createRoute = (request) => this.client.fetch({
208
+ body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
209
+ headers: jsonContentHeaders,
210
+ method: "POST",
211
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
212
+ }, unmarshalRoute);
213
+ /**
214
+ * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
215
+ *
216
+ * @param request - The request {@link GetRouteRequest}
217
+ * @returns A Promise of Route
218
+ */
219
+ getRoute = (request) => this.client.fetch({
220
+ method: "GET",
221
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
222
+ }, unmarshalRoute);
223
+ /**
224
+ * Update Route. Update parameters of the specified Route.
225
+ *
226
+ * @param request - The request {@link UpdateRouteRequest}
227
+ * @returns A Promise of Route
228
+ */
229
+ updateRoute = (request) => this.client.fetch({
230
+ body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
231
+ headers: jsonContentHeaders,
232
+ method: "PATCH",
233
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
234
+ }, unmarshalRoute);
235
+ /**
236
+ * Delete a Route. Delete a Route specified by its Route ID.
237
+ *
238
+ * @param request - The request {@link DeleteRouteRequest}
239
+ */
240
+ deleteRoute = (request) => this.client.fetch({
241
+ method: "DELETE",
242
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
243
+ });
244
+ /**
245
+ * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
246
+ *
247
+ * @param request - The request {@link GetAclRequest}
248
+ * @returns A Promise of GetAclResponse
249
+ */
250
+ getAcl = (request) => this.client.fetch({
251
+ method: "GET",
252
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
253
+ urlParams: urlParams(["is_ipv6", request.isIpv6])
254
+ }, unmarshalGetAclResponse);
255
+ /**
256
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
257
+ *
258
+ * @param request - The request {@link SetAclRequest}
259
+ * @returns A Promise of SetAclResponse
260
+ */
261
+ setAcl = (request) => this.client.fetch({
262
+ body: JSON.stringify(marshalSetAclRequest(request, this.client.settings)),
263
+ headers: jsonContentHeaders,
264
+ method: "PUT",
265
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
266
+ }, unmarshalSetAclResponse);
465
267
  };
268
+ export { API$1 as API };