@scaleway/sdk-vpc 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,168 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Region as ScwRegion } from '@scaleway/sdk-client';
3
+ import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
4
+ /**
5
+ * VPC API.
6
+
7
+ This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available regions of the API. */
11
+ static readonly LOCALITIES: ScwRegion[];
12
+ protected pageOfListVPCs: (request?: Readonly<ListVPCsRequest>) => Promise<ListVPCsResponse>;
13
+ /**
14
+ * List VPCs. List existing VPCs in the specified region.
15
+ *
16
+ * @param request - The request {@link ListVPCsRequest}
17
+ * @returns A Promise of ListVPCsResponse
18
+ */
19
+ listVPCs: (request?: Readonly<ListVPCsRequest>) => Promise<ListVPCsResponse> & {
20
+ all: () => Promise<VPC[]>;
21
+ [Symbol.asyncIterator]: () => AsyncGenerator<VPC[], void, void>;
22
+ };
23
+ /**
24
+ * Create a VPC. Create a new VPC in the specified region.
25
+ *
26
+ * @param request - The request {@link CreateVPCRequest}
27
+ * @returns A Promise of VPC
28
+ */
29
+ createVPC: (request: Readonly<CreateVPCRequest>) => Promise<VPC>;
30
+ /**
31
+ * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
32
+ *
33
+ * @param request - The request {@link GetVPCRequest}
34
+ * @returns A Promise of VPC
35
+ */
36
+ getVPC: (request: Readonly<GetVPCRequest>) => Promise<VPC>;
37
+ /**
38
+ * Update VPC. Update parameters including name and tags of the specified VPC.
39
+ *
40
+ * @param request - The request {@link UpdateVPCRequest}
41
+ * @returns A Promise of VPC
42
+ */
43
+ updateVPC: (request: Readonly<UpdateVPCRequest>) => Promise<VPC>;
44
+ /**
45
+ * Delete a VPC. Delete a VPC specified by its VPC ID.
46
+ *
47
+ * @param request - The request {@link DeleteVPCRequest}
48
+ */
49
+ deleteVPC: (request: Readonly<DeleteVPCRequest>) => Promise<void>;
50
+ protected pageOfListPrivateNetworks: (request?: Readonly<ListPrivateNetworksRequest>) => Promise<ListPrivateNetworksResponse>;
51
+ /**
52
+ * 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.
53
+ *
54
+ * @param request - The request {@link ListPrivateNetworksRequest}
55
+ * @returns A Promise of ListPrivateNetworksResponse
56
+ */
57
+ listPrivateNetworks: (request?: Readonly<ListPrivateNetworksRequest>) => Promise<ListPrivateNetworksResponse> & {
58
+ all: () => Promise<PrivateNetwork[]>;
59
+ [Symbol.asyncIterator]: () => AsyncGenerator<PrivateNetwork[], void, void>;
60
+ };
61
+ /**
62
+ * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
63
+ *
64
+ * @param request - The request {@link CreatePrivateNetworkRequest}
65
+ * @returns A Promise of PrivateNetwork
66
+ */
67
+ createPrivateNetwork: (request?: Readonly<CreatePrivateNetworkRequest>) => Promise<PrivateNetwork>;
68
+ /**
69
+ * 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.
70
+ *
71
+ * @param request - The request {@link GetPrivateNetworkRequest}
72
+ * @returns A Promise of PrivateNetwork
73
+ */
74
+ getPrivateNetwork: (request: Readonly<GetPrivateNetworkRequest>) => Promise<PrivateNetwork>;
75
+ /**
76
+ * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
77
+ *
78
+ * @param request - The request {@link UpdatePrivateNetworkRequest}
79
+ * @returns A Promise of PrivateNetwork
80
+ */
81
+ updatePrivateNetwork: (request: Readonly<UpdatePrivateNetworkRequest>) => Promise<PrivateNetwork>;
82
+ /**
83
+ * 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.
84
+ *
85
+ * @param request - The request {@link DeletePrivateNetworkRequest}
86
+ */
87
+ deletePrivateNetwork: (request: Readonly<DeletePrivateNetworkRequest>) => Promise<void>;
88
+ /**
89
+ * 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.
90
+ *
91
+ * @param request - The request {@link EnableDHCPRequest}
92
+ * @returns A Promise of PrivateNetwork
93
+ */
94
+ enableDHCP: (request: Readonly<EnableDHCPRequest>) => Promise<PrivateNetwork>;
95
+ /**
96
+ * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
97
+ *
98
+ * @param request - The request {@link EnableRoutingRequest}
99
+ * @returns A Promise of VPC
100
+ */
101
+ enableRouting: (request: Readonly<EnableRoutingRequest>) => Promise<VPC>;
102
+ protected pageOfListSubnets: (request?: Readonly<ListSubnetsRequest>) => Promise<ListSubnetsResponse>;
103
+ /**
104
+ * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
105
+ *
106
+ * @param request - The request {@link ListSubnetsRequest}
107
+ * @returns A Promise of ListSubnetsResponse
108
+ */
109
+ listSubnets: (request?: Readonly<ListSubnetsRequest>) => Promise<ListSubnetsResponse> & {
110
+ all: () => Promise<import("./types.gen").Subnet[]>;
111
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").Subnet[], void, void>;
112
+ };
113
+ /**
114
+ * Add subnets to a Private Network. Add new subnets to an existing Private Network.
115
+ *
116
+ * @param request - The request {@link AddSubnetsRequest}
117
+ * @returns A Promise of AddSubnetsResponse
118
+ */
119
+ addSubnets: (request: Readonly<AddSubnetsRequest>) => Promise<AddSubnetsResponse>;
120
+ /**
121
+ * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
122
+ *
123
+ * @param request - The request {@link DeleteSubnetsRequest}
124
+ * @returns A Promise of DeleteSubnetsResponse
125
+ */
126
+ deleteSubnets: (request: Readonly<DeleteSubnetsRequest>) => Promise<DeleteSubnetsResponse>;
127
+ /**
128
+ * Create a Route. Create a new custom Route.
129
+ *
130
+ * @param request - The request {@link CreateRouteRequest}
131
+ * @returns A Promise of Route
132
+ */
133
+ createRoute: (request: Readonly<CreateRouteRequest>) => Promise<Route>;
134
+ /**
135
+ * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
136
+ *
137
+ * @param request - The request {@link GetRouteRequest}
138
+ * @returns A Promise of Route
139
+ */
140
+ getRoute: (request: Readonly<GetRouteRequest>) => Promise<Route>;
141
+ /**
142
+ * Update Route. Update parameters of the specified Route.
143
+ *
144
+ * @param request - The request {@link UpdateRouteRequest}
145
+ * @returns A Promise of Route
146
+ */
147
+ updateRoute: (request: Readonly<UpdateRouteRequest>) => Promise<Route>;
148
+ /**
149
+ * Delete a Route. Delete a Route specified by its Route ID.
150
+ *
151
+ * @param request - The request {@link DeleteRouteRequest}
152
+ */
153
+ deleteRoute: (request: Readonly<DeleteRouteRequest>) => Promise<void>;
154
+ /**
155
+ * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
156
+ *
157
+ * @param request - The request {@link GetAclRequest}
158
+ * @returns A Promise of GetAclResponse
159
+ */
160
+ getAcl: (request: Readonly<GetAclRequest>) => Promise<GetAclResponse>;
161
+ /**
162
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
163
+ *
164
+ * @param request - The request {@link SetAclRequest}
165
+ * @returns A Promise of SetAclResponse
166
+ */
167
+ setAcl: (request: Readonly<SetAclRequest>) => Promise<SetAclResponse>;
168
+ }
@@ -0,0 +1,366 @@
1
+ import { API as API$1, 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 } from "./marshalling.gen.js";
3
+ const jsonContentHeaders = {
4
+ "Content-Type": "application/json; charset=utf-8"
5
+ };
6
+ class API extends API$1 {
7
+ /** Lists the available regions of the API. */
8
+ static LOCALITIES = [
9
+ "fr-par",
10
+ "nl-ams",
11
+ "pl-waw"
12
+ ];
13
+ pageOfListVPCs = (request = {}) => this.client.fetch(
14
+ {
15
+ method: "GET",
16
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
17
+ urlParams: urlParams(
18
+ ["is_default", request.isDefault],
19
+ ["name", request.name],
20
+ ["order_by", request.orderBy],
21
+ ["organization_id", request.organizationId],
22
+ ["page", request.page],
23
+ [
24
+ "page_size",
25
+ request.pageSize ?? this.client.settings.defaultPageSize
26
+ ],
27
+ ["project_id", request.projectId],
28
+ ["routing_enabled", request.routingEnabled],
29
+ ["tags", request.tags]
30
+ )
31
+ },
32
+ unmarshalListVPCsResponse
33
+ );
34
+ /**
35
+ * List VPCs. List existing VPCs in the specified region.
36
+ *
37
+ * @param request - The request {@link ListVPCsRequest}
38
+ * @returns A Promise of ListVPCsResponse
39
+ */
40
+ listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
41
+ /**
42
+ * Create a VPC. Create a new VPC in the specified region.
43
+ *
44
+ * @param request - The request {@link CreateVPCRequest}
45
+ * @returns A Promise of VPC
46
+ */
47
+ createVPC = (request) => this.client.fetch(
48
+ {
49
+ body: JSON.stringify(
50
+ marshalCreateVPCRequest(request, this.client.settings)
51
+ ),
52
+ headers: jsonContentHeaders,
53
+ method: "POST",
54
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
55
+ },
56
+ unmarshalVPC
57
+ );
58
+ /**
59
+ * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
60
+ *
61
+ * @param request - The request {@link GetVPCRequest}
62
+ * @returns A Promise of VPC
63
+ */
64
+ getVPC = (request) => this.client.fetch(
65
+ {
66
+ method: "GET",
67
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
68
+ },
69
+ unmarshalVPC
70
+ );
71
+ /**
72
+ * Update VPC. Update parameters including name and tags of the specified VPC.
73
+ *
74
+ * @param request - The request {@link UpdateVPCRequest}
75
+ * @returns A Promise of VPC
76
+ */
77
+ updateVPC = (request) => this.client.fetch(
78
+ {
79
+ body: JSON.stringify(
80
+ marshalUpdateVPCRequest(request, this.client.settings)
81
+ ),
82
+ headers: jsonContentHeaders,
83
+ method: "PATCH",
84
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
85
+ },
86
+ unmarshalVPC
87
+ );
88
+ /**
89
+ * Delete a VPC. Delete a VPC specified by its VPC ID.
90
+ *
91
+ * @param request - The request {@link DeleteVPCRequest}
92
+ */
93
+ deleteVPC = (request) => this.client.fetch({
94
+ method: "DELETE",
95
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
96
+ });
97
+ pageOfListPrivateNetworks = (request = {}) => this.client.fetch(
98
+ {
99
+ method: "GET",
100
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
101
+ urlParams: urlParams(
102
+ ["dhcp_enabled", request.dhcpEnabled],
103
+ ["name", request.name],
104
+ ["order_by", request.orderBy],
105
+ ["organization_id", request.organizationId],
106
+ ["page", request.page],
107
+ [
108
+ "page_size",
109
+ request.pageSize ?? this.client.settings.defaultPageSize
110
+ ],
111
+ ["private_network_ids", request.privateNetworkIds],
112
+ ["project_id", request.projectId],
113
+ ["tags", request.tags],
114
+ ["vpc_id", request.vpcId]
115
+ )
116
+ },
117
+ unmarshalListPrivateNetworksResponse
118
+ );
119
+ /**
120
+ * 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.
121
+ *
122
+ * @param request - The request {@link ListPrivateNetworksRequest}
123
+ * @returns A Promise of ListPrivateNetworksResponse
124
+ */
125
+ listPrivateNetworks = (request = {}) => enrichForPagination(
126
+ "privateNetworks",
127
+ this.pageOfListPrivateNetworks,
128
+ request
129
+ );
130
+ /**
131
+ * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
132
+ *
133
+ * @param request - The request {@link CreatePrivateNetworkRequest}
134
+ * @returns A Promise of PrivateNetwork
135
+ */
136
+ createPrivateNetwork = (request = {}) => this.client.fetch(
137
+ {
138
+ body: JSON.stringify(
139
+ marshalCreatePrivateNetworkRequest(request, this.client.settings)
140
+ ),
141
+ headers: jsonContentHeaders,
142
+ method: "POST",
143
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
144
+ },
145
+ unmarshalPrivateNetwork
146
+ );
147
+ /**
148
+ * 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.
149
+ *
150
+ * @param request - The request {@link GetPrivateNetworkRequest}
151
+ * @returns A Promise of PrivateNetwork
152
+ */
153
+ getPrivateNetwork = (request) => this.client.fetch(
154
+ {
155
+ method: "GET",
156
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
157
+ },
158
+ unmarshalPrivateNetwork
159
+ );
160
+ /**
161
+ * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
162
+ *
163
+ * @param request - The request {@link UpdatePrivateNetworkRequest}
164
+ * @returns A Promise of PrivateNetwork
165
+ */
166
+ updatePrivateNetwork = (request) => this.client.fetch(
167
+ {
168
+ body: JSON.stringify(
169
+ marshalUpdatePrivateNetworkRequest(request, this.client.settings)
170
+ ),
171
+ headers: jsonContentHeaders,
172
+ method: "PATCH",
173
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
174
+ },
175
+ unmarshalPrivateNetwork
176
+ );
177
+ /**
178
+ * 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.
179
+ *
180
+ * @param request - The request {@link DeletePrivateNetworkRequest}
181
+ */
182
+ deletePrivateNetwork = (request) => this.client.fetch({
183
+ method: "DELETE",
184
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
185
+ });
186
+ /**
187
+ * 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.
188
+ *
189
+ * @param request - The request {@link EnableDHCPRequest}
190
+ * @returns A Promise of PrivateNetwork
191
+ */
192
+ enableDHCP = (request) => this.client.fetch(
193
+ {
194
+ body: "{}",
195
+ headers: jsonContentHeaders,
196
+ method: "POST",
197
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
198
+ },
199
+ unmarshalPrivateNetwork
200
+ );
201
+ /**
202
+ * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
203
+ *
204
+ * @param request - The request {@link EnableRoutingRequest}
205
+ * @returns A Promise of VPC
206
+ */
207
+ enableRouting = (request) => this.client.fetch(
208
+ {
209
+ body: "{}",
210
+ headers: jsonContentHeaders,
211
+ method: "POST",
212
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
213
+ },
214
+ unmarshalVPC
215
+ );
216
+ pageOfListSubnets = (request = {}) => this.client.fetch(
217
+ {
218
+ method: "GET",
219
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
220
+ urlParams: urlParams(
221
+ ["order_by", request.orderBy],
222
+ ["organization_id", request.organizationId],
223
+ ["page", request.page],
224
+ [
225
+ "page_size",
226
+ request.pageSize ?? this.client.settings.defaultPageSize
227
+ ],
228
+ ["project_id", request.projectId],
229
+ ["subnet_ids", request.subnetIds],
230
+ ["vpc_id", request.vpcId]
231
+ )
232
+ },
233
+ unmarshalListSubnetsResponse
234
+ );
235
+ /**
236
+ * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
237
+ *
238
+ * @param request - The request {@link ListSubnetsRequest}
239
+ * @returns A Promise of ListSubnetsResponse
240
+ */
241
+ listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
242
+ /**
243
+ * Add subnets to a Private Network. Add new subnets to an existing Private Network.
244
+ *
245
+ * @param request - The request {@link AddSubnetsRequest}
246
+ * @returns A Promise of AddSubnetsResponse
247
+ */
248
+ addSubnets = (request) => this.client.fetch(
249
+ {
250
+ body: JSON.stringify(
251
+ marshalAddSubnetsRequest(request, this.client.settings)
252
+ ),
253
+ headers: jsonContentHeaders,
254
+ method: "POST",
255
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
256
+ },
257
+ unmarshalAddSubnetsResponse
258
+ );
259
+ /**
260
+ * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
261
+ *
262
+ * @param request - The request {@link DeleteSubnetsRequest}
263
+ * @returns A Promise of DeleteSubnetsResponse
264
+ */
265
+ deleteSubnets = (request) => this.client.fetch(
266
+ {
267
+ body: JSON.stringify(
268
+ marshalDeleteSubnetsRequest(request, this.client.settings)
269
+ ),
270
+ headers: jsonContentHeaders,
271
+ method: "DELETE",
272
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
273
+ },
274
+ unmarshalDeleteSubnetsResponse
275
+ );
276
+ /**
277
+ * Create a Route. Create a new custom Route.
278
+ *
279
+ * @param request - The request {@link CreateRouteRequest}
280
+ * @returns A Promise of Route
281
+ */
282
+ createRoute = (request) => this.client.fetch(
283
+ {
284
+ body: JSON.stringify(
285
+ marshalCreateRouteRequest(request, this.client.settings)
286
+ ),
287
+ headers: jsonContentHeaders,
288
+ method: "POST",
289
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
290
+ },
291
+ unmarshalRoute
292
+ );
293
+ /**
294
+ * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
295
+ *
296
+ * @param request - The request {@link GetRouteRequest}
297
+ * @returns A Promise of Route
298
+ */
299
+ getRoute = (request) => this.client.fetch(
300
+ {
301
+ method: "GET",
302
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
303
+ },
304
+ unmarshalRoute
305
+ );
306
+ /**
307
+ * Update Route. Update parameters of the specified Route.
308
+ *
309
+ * @param request - The request {@link UpdateRouteRequest}
310
+ * @returns A Promise of Route
311
+ */
312
+ updateRoute = (request) => this.client.fetch(
313
+ {
314
+ body: JSON.stringify(
315
+ marshalUpdateRouteRequest(request, this.client.settings)
316
+ ),
317
+ headers: jsonContentHeaders,
318
+ method: "PATCH",
319
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
320
+ },
321
+ unmarshalRoute
322
+ );
323
+ /**
324
+ * Delete a Route. Delete a Route specified by its Route ID.
325
+ *
326
+ * @param request - The request {@link DeleteRouteRequest}
327
+ */
328
+ deleteRoute = (request) => this.client.fetch({
329
+ method: "DELETE",
330
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
331
+ });
332
+ /**
333
+ * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
334
+ *
335
+ * @param request - The request {@link GetAclRequest}
336
+ * @returns A Promise of GetAclResponse
337
+ */
338
+ getAcl = (request) => this.client.fetch(
339
+ {
340
+ method: "GET",
341
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
342
+ urlParams: urlParams(["is_ipv6", request.isIpv6])
343
+ },
344
+ unmarshalGetAclResponse
345
+ );
346
+ /**
347
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
348
+ *
349
+ * @param request - The request {@link SetAclRequest}
350
+ * @returns A Promise of SetAclResponse
351
+ */
352
+ setAcl = (request) => this.client.fetch(
353
+ {
354
+ body: JSON.stringify(
355
+ marshalSetAclRequest(request, this.client.settings)
356
+ ),
357
+ headers: jsonContentHeaders,
358
+ method: "PUT",
359
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
360
+ },
361
+ unmarshalSetAclResponse
362
+ );
363
+ }
364
+ export {
365
+ API
366
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const marshalling_gen = require("./marshalling.gen.cjs");
5
+ const validationRules_gen = require("./validation-rules.gen.cjs");
6
+ exports.API = api_gen.API;
7
+ exports.marshalAddSubnetsRequest = marshalling_gen.marshalAddSubnetsRequest;
8
+ exports.marshalCreatePrivateNetworkRequest = marshalling_gen.marshalCreatePrivateNetworkRequest;
9
+ exports.marshalCreateRouteRequest = marshalling_gen.marshalCreateRouteRequest;
10
+ exports.marshalCreateVPCRequest = marshalling_gen.marshalCreateVPCRequest;
11
+ exports.marshalDeleteSubnetsRequest = marshalling_gen.marshalDeleteSubnetsRequest;
12
+ exports.marshalSetAclRequest = marshalling_gen.marshalSetAclRequest;
13
+ exports.marshalUpdatePrivateNetworkRequest = marshalling_gen.marshalUpdatePrivateNetworkRequest;
14
+ exports.marshalUpdateRouteRequest = marshalling_gen.marshalUpdateRouteRequest;
15
+ exports.marshalUpdateVPCRequest = marshalling_gen.marshalUpdateVPCRequest;
16
+ exports.unmarshalAddSubnetsResponse = marshalling_gen.unmarshalAddSubnetsResponse;
17
+ exports.unmarshalDeleteSubnetsResponse = marshalling_gen.unmarshalDeleteSubnetsResponse;
18
+ exports.unmarshalGetAclResponse = marshalling_gen.unmarshalGetAclResponse;
19
+ exports.unmarshalListPrivateNetworksResponse = marshalling_gen.unmarshalListPrivateNetworksResponse;
20
+ exports.unmarshalListSubnetsResponse = marshalling_gen.unmarshalListSubnetsResponse;
21
+ exports.unmarshalListVPCsResponse = marshalling_gen.unmarshalListVPCsResponse;
22
+ exports.unmarshalPrivateNetwork = marshalling_gen.unmarshalPrivateNetwork;
23
+ exports.unmarshalRoute = marshalling_gen.unmarshalRoute;
24
+ exports.unmarshalSetAclResponse = marshalling_gen.unmarshalSetAclResponse;
25
+ exports.unmarshalVPC = marshalling_gen.unmarshalVPC;
26
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,4 @@
1
+ export { API } from './api.gen';
2
+ export * from './marshalling.gen';
3
+ export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen';
4
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,26 @@
1
+ import { API } from "./api.gen.js";
2
+ import { marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC } from "./marshalling.gen.js";
3
+ import * as validationRules_gen from "./validation-rules.gen.js";
4
+ export {
5
+ API,
6
+ validationRules_gen as ValidationRules,
7
+ marshalAddSubnetsRequest,
8
+ marshalCreatePrivateNetworkRequest,
9
+ marshalCreateRouteRequest,
10
+ marshalCreateVPCRequest,
11
+ marshalDeleteSubnetsRequest,
12
+ marshalSetAclRequest,
13
+ marshalUpdatePrivateNetworkRequest,
14
+ marshalUpdateRouteRequest,
15
+ marshalUpdateVPCRequest,
16
+ unmarshalAddSubnetsResponse,
17
+ unmarshalDeleteSubnetsResponse,
18
+ unmarshalGetAclResponse,
19
+ unmarshalListPrivateNetworksResponse,
20
+ unmarshalListSubnetsResponse,
21
+ unmarshalListVPCsResponse,
22
+ unmarshalPrivateNetwork,
23
+ unmarshalRoute,
24
+ unmarshalSetAclResponse,
25
+ unmarshalVPC
26
+ };