@scaleway/sdk-vpc 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Vpc.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v2/index.gen.js";
2
- export {
3
- index_gen as Vpcv2
4
- };
1
+ import { index_gen_exports } from "./v2/index.gen.js";
2
+ export { index_gen_exports as Vpcv2 };
@@ -1,382 +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 } 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: ["fr-par", "nl-ams", "pl-waw"]
13
- });
14
- pageOfListVPCs = (request = {}) => this.client.fetch(
15
- {
16
- method: "GET",
17
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
18
- urlParams: urlParams(
19
- ["is_default", request.isDefault],
20
- ["name", request.name],
21
- ["order_by", request.orderBy],
22
- ["organization_id", request.organizationId],
23
- ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ],
28
- ["project_id", request.projectId],
29
- ["routing_enabled", request.routingEnabled],
30
- ["tags", request.tags]
31
- )
32
- },
33
- unmarshalListVPCsResponse
34
- );
35
- /**
36
- * List VPCs. List existing VPCs in the specified region.
37
- *
38
- * @param request - The request {@link ListVPCsRequest}
39
- * @returns A Promise of ListVPCsResponse
40
- */
41
- listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
42
- /**
43
- * Create a VPC. Create a new VPC in the specified region.
44
- *
45
- * @param request - The request {@link CreateVPCRequest}
46
- * @returns A Promise of VPC
47
- */
48
- createVPC = (request) => this.client.fetch(
49
- {
50
- body: JSON.stringify(
51
- marshalCreateVPCRequest(request, this.client.settings)
52
- ),
53
- headers: jsonContentHeaders,
54
- method: "POST",
55
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
56
- },
57
- unmarshalVPC
58
- );
59
- /**
60
- * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
61
- *
62
- * @param request - The request {@link GetVPCRequest}
63
- * @returns A Promise of VPC
64
- */
65
- getVPC = (request) => this.client.fetch(
66
- {
67
- method: "GET",
68
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
69
- },
70
- unmarshalVPC
71
- );
72
- /**
73
- * Update VPC. Update parameters including name and tags of the specified VPC.
74
- *
75
- * @param request - The request {@link UpdateVPCRequest}
76
- * @returns A Promise of VPC
77
- */
78
- updateVPC = (request) => this.client.fetch(
79
- {
80
- body: JSON.stringify(
81
- marshalUpdateVPCRequest(request, this.client.settings)
82
- ),
83
- headers: jsonContentHeaders,
84
- method: "PATCH",
85
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
86
- },
87
- unmarshalVPC
88
- );
89
- /**
90
- * Delete a VPC. Delete a VPC specified by its VPC ID.
91
- *
92
- * @param request - The request {@link DeleteVPCRequest}
93
- */
94
- deleteVPC = (request) => this.client.fetch({
95
- method: "DELETE",
96
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
97
- });
98
- pageOfListPrivateNetworks = (request = {}) => this.client.fetch(
99
- {
100
- method: "GET",
101
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
102
- urlParams: urlParams(
103
- ["dhcp_enabled", request.dhcpEnabled],
104
- ["name", request.name],
105
- ["order_by", request.orderBy],
106
- ["organization_id", request.organizationId],
107
- ["page", request.page],
108
- [
109
- "page_size",
110
- request.pageSize ?? this.client.settings.defaultPageSize
111
- ],
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(
127
- "privateNetworks",
128
- this.pageOfListPrivateNetworks,
129
- request
130
- );
131
- /**
132
- * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
133
- *
134
- * @param request - The request {@link CreatePrivateNetworkRequest}
135
- * @returns A Promise of PrivateNetwork
136
- */
137
- createPrivateNetwork = (request) => this.client.fetch(
138
- {
139
- body: JSON.stringify(
140
- marshalCreatePrivateNetworkRequest(request, this.client.settings)
141
- ),
142
- headers: jsonContentHeaders,
143
- method: "POST",
144
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
145
- },
146
- unmarshalPrivateNetwork
147
- );
148
- /**
149
- * 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.
150
- *
151
- * @param request - The request {@link GetPrivateNetworkRequest}
152
- * @returns A Promise of PrivateNetwork
153
- */
154
- getPrivateNetwork = (request) => this.client.fetch(
155
- {
156
- method: "GET",
157
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
158
- },
159
- unmarshalPrivateNetwork
160
- );
161
- /**
162
- * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
163
- *
164
- * @param request - The request {@link UpdatePrivateNetworkRequest}
165
- * @returns A Promise of PrivateNetwork
166
- */
167
- updatePrivateNetwork = (request) => this.client.fetch(
168
- {
169
- body: JSON.stringify(
170
- marshalUpdatePrivateNetworkRequest(request, this.client.settings)
171
- ),
172
- headers: jsonContentHeaders,
173
- method: "PATCH",
174
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
175
- },
176
- unmarshalPrivateNetwork
177
- );
178
- /**
179
- * 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.
180
- *
181
- * @param request - The request {@link DeletePrivateNetworkRequest}
182
- */
183
- deletePrivateNetwork = (request) => this.client.fetch({
184
- method: "DELETE",
185
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
186
- });
187
- /**
188
- * 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.
189
- *
190
- * @param request - The request {@link EnableDHCPRequest}
191
- * @returns A Promise of PrivateNetwork
192
- */
193
- enableDHCP = (request) => this.client.fetch(
194
- {
195
- body: "{}",
196
- headers: jsonContentHeaders,
197
- method: "POST",
198
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
199
- },
200
- unmarshalPrivateNetwork
201
- );
202
- /**
203
- * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
204
- *
205
- * @param request - The request {@link EnableRoutingRequest}
206
- * @returns A Promise of VPC
207
- */
208
- enableRouting = (request) => this.client.fetch(
209
- {
210
- body: "{}",
211
- headers: jsonContentHeaders,
212
- method: "POST",
213
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
214
- },
215
- unmarshalVPC
216
- );
217
- /**
218
- * 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.
219
- *
220
- * @param request - The request {@link EnableCustomRoutesPropagationRequest}
221
- * @returns A Promise of VPC
222
- */
223
- enableCustomRoutesPropagation = (request) => this.client.fetch(
224
- {
225
- body: "{}",
226
- headers: jsonContentHeaders,
227
- method: "POST",
228
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
229
- },
230
- unmarshalVPC
231
- );
232
- pageOfListSubnets = (request = {}) => this.client.fetch(
233
- {
234
- method: "GET",
235
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
236
- urlParams: urlParams(
237
- ["order_by", request.orderBy],
238
- ["organization_id", request.organizationId],
239
- ["page", request.page],
240
- [
241
- "page_size",
242
- request.pageSize ?? this.client.settings.defaultPageSize
243
- ],
244
- ["project_id", request.projectId],
245
- ["subnet_ids", request.subnetIds],
246
- ["vpc_id", request.vpcId]
247
- )
248
- },
249
- unmarshalListSubnetsResponse
250
- );
251
- /**
252
- * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
253
- *
254
- * @param request - The request {@link ListSubnetsRequest}
255
- * @returns A Promise of ListSubnetsResponse
256
- */
257
- listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
258
- /**
259
- * Add subnets to a Private Network. Add new subnets to an existing Private Network.
260
- *
261
- * @param request - The request {@link AddSubnetsRequest}
262
- * @returns A Promise of AddSubnetsResponse
263
- */
264
- addSubnets = (request) => this.client.fetch(
265
- {
266
- body: JSON.stringify(
267
- marshalAddSubnetsRequest(request, this.client.settings)
268
- ),
269
- headers: jsonContentHeaders,
270
- method: "POST",
271
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
272
- },
273
- unmarshalAddSubnetsResponse
274
- );
275
- /**
276
- * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
277
- *
278
- * @param request - The request {@link DeleteSubnetsRequest}
279
- * @returns A Promise of DeleteSubnetsResponse
280
- */
281
- deleteSubnets = (request) => this.client.fetch(
282
- {
283
- body: JSON.stringify(
284
- marshalDeleteSubnetsRequest(request, this.client.settings)
285
- ),
286
- headers: jsonContentHeaders,
287
- method: "DELETE",
288
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
289
- },
290
- unmarshalDeleteSubnetsResponse
291
- );
292
- /**
293
- * Create a Route. Create a new custom Route.
294
- *
295
- * @param request - The request {@link CreateRouteRequest}
296
- * @returns A Promise of Route
297
- */
298
- createRoute = (request) => this.client.fetch(
299
- {
300
- body: JSON.stringify(
301
- marshalCreateRouteRequest(request, this.client.settings)
302
- ),
303
- headers: jsonContentHeaders,
304
- method: "POST",
305
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
306
- },
307
- unmarshalRoute
308
- );
309
- /**
310
- * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
311
- *
312
- * @param request - The request {@link GetRouteRequest}
313
- * @returns A Promise of Route
314
- */
315
- getRoute = (request) => this.client.fetch(
316
- {
317
- method: "GET",
318
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
319
- },
320
- unmarshalRoute
321
- );
322
- /**
323
- * Update Route. Update parameters of the specified Route.
324
- *
325
- * @param request - The request {@link UpdateRouteRequest}
326
- * @returns A Promise of Route
327
- */
328
- updateRoute = (request) => this.client.fetch(
329
- {
330
- body: JSON.stringify(
331
- marshalUpdateRouteRequest(request, this.client.settings)
332
- ),
333
- headers: jsonContentHeaders,
334
- method: "PATCH",
335
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
336
- },
337
- unmarshalRoute
338
- );
339
- /**
340
- * Delete a Route. Delete a Route specified by its Route ID.
341
- *
342
- * @param request - The request {@link DeleteRouteRequest}
343
- */
344
- deleteRoute = (request) => this.client.fetch({
345
- method: "DELETE",
346
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
347
- });
348
- /**
349
- * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
350
- *
351
- * @param request - The request {@link GetAclRequest}
352
- * @returns A Promise of GetAclResponse
353
- */
354
- getAcl = (request) => this.client.fetch(
355
- {
356
- method: "GET",
357
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
358
- urlParams: urlParams(["is_ipv6", request.isIpv6])
359
- },
360
- unmarshalGetAclResponse
361
- );
362
- /**
363
- * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
364
- *
365
- * @param request - The request {@link SetAclRequest}
366
- * @returns A Promise of SetAclResponse
367
- */
368
- setAcl = (request) => this.client.fetch(
369
- {
370
- body: JSON.stringify(
371
- marshalSetAclRequest(request, this.client.settings)
372
- ),
373
- headers: jsonContentHeaders,
374
- method: "PUT",
375
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
376
- },
377
- unmarshalSetAclResponse
378
- );
379
- }
380
- export {
381
- 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);
382
267
  };
268
+ export { API$1 as API };
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
3
  export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, RouteType, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen.js';
4
4
  export * as ValidationRules from './validation-rules.gen.js';
@@ -1,28 +1,30 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, 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
- marshalAclRule,
8
- marshalAddSubnetsRequest,
9
- marshalCreatePrivateNetworkRequest,
10
- marshalCreateRouteRequest,
11
- marshalCreateVPCRequest,
12
- marshalDeleteSubnetsRequest,
13
- marshalSetAclRequest,
14
- marshalUpdatePrivateNetworkRequest,
15
- marshalUpdateRouteRequest,
16
- marshalUpdateVPCRequest,
17
- unmarshalAclRule,
18
- unmarshalAddSubnetsResponse,
19
- unmarshalDeleteSubnetsResponse,
20
- unmarshalGetAclResponse,
21
- unmarshalListPrivateNetworksResponse,
22
- unmarshalListSubnetsResponse,
23
- unmarshalListVPCsResponse,
24
- unmarshalPrivateNetwork,
25
- unmarshalRoute,
26
- unmarshalSetAclResponse,
27
- unmarshalVPC
28
- };
3
+ import { API } from "./api.gen.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ API: () => API,
7
+ ValidationRules: () => validation_rules_gen_exports,
8
+ marshalAclRule: () => marshalAclRule,
9
+ marshalAddSubnetsRequest: () => marshalAddSubnetsRequest,
10
+ marshalCreatePrivateNetworkRequest: () => marshalCreatePrivateNetworkRequest,
11
+ marshalCreateRouteRequest: () => marshalCreateRouteRequest,
12
+ marshalCreateVPCRequest: () => marshalCreateVPCRequest,
13
+ marshalDeleteSubnetsRequest: () => marshalDeleteSubnetsRequest,
14
+ marshalSetAclRequest: () => marshalSetAclRequest,
15
+ marshalUpdatePrivateNetworkRequest: () => marshalUpdatePrivateNetworkRequest,
16
+ marshalUpdateRouteRequest: () => marshalUpdateRouteRequest,
17
+ marshalUpdateVPCRequest: () => marshalUpdateVPCRequest,
18
+ unmarshalAclRule: () => unmarshalAclRule,
19
+ unmarshalAddSubnetsResponse: () => unmarshalAddSubnetsResponse,
20
+ unmarshalDeleteSubnetsResponse: () => unmarshalDeleteSubnetsResponse,
21
+ unmarshalGetAclResponse: () => unmarshalGetAclResponse,
22
+ unmarshalListPrivateNetworksResponse: () => unmarshalListPrivateNetworksResponse,
23
+ unmarshalListSubnetsResponse: () => unmarshalListSubnetsResponse,
24
+ unmarshalListVPCsResponse: () => unmarshalListVPCsResponse,
25
+ unmarshalPrivateNetwork: () => unmarshalPrivateNetwork,
26
+ unmarshalRoute: () => unmarshalRoute,
27
+ unmarshalSetAclResponse: () => unmarshalSetAclResponse,
28
+ unmarshalVPC: () => unmarshalVPC
29
+ });
30
+ export { index_gen_exports };
@@ -1,260 +1,182 @@
1
- import randomName from "@scaleway/random-name";
2
1
  import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
- const unmarshalSubnet = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- createdAt: unmarshalDate(data.created_at),
11
- id: data.id,
12
- privateNetworkId: data.private_network_id,
13
- projectId: data.project_id,
14
- subnet: data.subnet,
15
- updatedAt: unmarshalDate(data.updated_at),
16
- vpcId: data.vpc_id
17
- };
2
+ import randomName from "@scaleway/random-name";
3
+ var unmarshalSubnet = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);
5
+ return {
6
+ createdAt: unmarshalDate(data.created_at),
7
+ id: data.id,
8
+ privateNetworkId: data.private_network_id,
9
+ projectId: data.project_id,
10
+ subnet: data.subnet,
11
+ updatedAt: unmarshalDate(data.updated_at),
12
+ vpcId: data.vpc_id
13
+ };
18
14
  };
19
15
  const unmarshalPrivateNetwork = (data) => {
20
- if (!isJSONObject(data)) {
21
- throw new TypeError(
22
- `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`
23
- );
24
- }
25
- return {
26
- createdAt: unmarshalDate(data.created_at),
27
- defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
28
- dhcpEnabled: data.dhcp_enabled,
29
- id: data.id,
30
- name: data.name,
31
- organizationId: data.organization_id,
32
- projectId: data.project_id,
33
- region: data.region,
34
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
35
- tags: data.tags,
36
- updatedAt: unmarshalDate(data.updated_at),
37
- vpcId: data.vpc_id
38
- };
16
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
17
+ return {
18
+ createdAt: unmarshalDate(data.created_at),
19
+ defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
20
+ dhcpEnabled: data.dhcp_enabled,
21
+ id: data.id,
22
+ name: data.name,
23
+ organizationId: data.organization_id,
24
+ projectId: data.project_id,
25
+ region: data.region,
26
+ subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
27
+ tags: data.tags,
28
+ updatedAt: unmarshalDate(data.updated_at),
29
+ vpcId: data.vpc_id
30
+ };
39
31
  };
40
32
  const unmarshalRoute = (data) => {
41
- if (!isJSONObject(data)) {
42
- throw new TypeError(
43
- `Unmarshalling the type 'Route' failed as data isn't a dictionary.`
44
- );
45
- }
46
- return {
47
- createdAt: unmarshalDate(data.created_at),
48
- description: data.description,
49
- destination: data.destination,
50
- id: data.id,
51
- isReadOnly: data.is_read_only,
52
- nexthopPrivateNetworkId: data.nexthop_private_network_id,
53
- nexthopResourceId: data.nexthop_resource_id,
54
- region: data.region,
55
- tags: data.tags,
56
- type: data.type ? data.type : void 0,
57
- updatedAt: unmarshalDate(data.updated_at),
58
- vpcId: data.vpc_id
59
- };
33
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
34
+ return {
35
+ createdAt: unmarshalDate(data.created_at),
36
+ description: data.description,
37
+ destination: data.destination,
38
+ id: data.id,
39
+ isReadOnly: data.is_read_only,
40
+ nexthopPrivateNetworkId: data.nexthop_private_network_id,
41
+ nexthopResourceId: data.nexthop_resource_id,
42
+ nexthopVpcConnectorId: data.nexthop_vpc_connector_id,
43
+ region: data.region,
44
+ tags: data.tags,
45
+ type: data.type ? data.type : void 0,
46
+ updatedAt: unmarshalDate(data.updated_at),
47
+ vpcId: data.vpc_id
48
+ };
60
49
  };
61
50
  const unmarshalVPC = (data) => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'VPC' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- createdAt: unmarshalDate(data.created_at),
69
- customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
70
- id: data.id,
71
- isDefault: data.is_default,
72
- name: data.name,
73
- organizationId: data.organization_id,
74
- privateNetworkCount: data.private_network_count,
75
- projectId: data.project_id,
76
- region: data.region,
77
- routingEnabled: data.routing_enabled,
78
- tags: data.tags,
79
- updatedAt: unmarshalDate(data.updated_at)
80
- };
51
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);
52
+ return {
53
+ createdAt: unmarshalDate(data.created_at),
54
+ customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
55
+ id: data.id,
56
+ isDefault: data.is_default,
57
+ name: data.name,
58
+ organizationId: data.organization_id,
59
+ privateNetworkCount: data.private_network_count,
60
+ projectId: data.project_id,
61
+ region: data.region,
62
+ routingEnabled: data.routing_enabled,
63
+ tags: data.tags,
64
+ updatedAt: unmarshalDate(data.updated_at)
65
+ };
81
66
  };
82
67
  const unmarshalAddSubnetsResponse = (data) => {
83
- if (!isJSONObject(data)) {
84
- throw new TypeError(
85
- `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`
86
- );
87
- }
88
- return {
89
- subnets: data.subnets
90
- };
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`);
69
+ return { subnets: data.subnets };
91
70
  };
92
71
  const unmarshalDeleteSubnetsResponse = (data) => {
93
- if (!isJSONObject(data)) {
94
- throw new TypeError(
95
- `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`
96
- );
97
- }
98
- return {
99
- subnets: data.subnets
100
- };
72
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`);
73
+ return { subnets: data.subnets };
101
74
  };
102
75
  const unmarshalAclRule = (data) => {
103
- if (!isJSONObject(data)) {
104
- throw new TypeError(
105
- `Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`
106
- );
107
- }
108
- return {
109
- action: data.action,
110
- description: data.description,
111
- destination: data.destination,
112
- dstPortHigh: data.dst_port_high,
113
- dstPortLow: data.dst_port_low,
114
- protocol: data.protocol,
115
- source: data.source,
116
- srcPortHigh: data.src_port_high,
117
- srcPortLow: data.src_port_low
118
- };
76
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`);
77
+ return {
78
+ action: data.action,
79
+ description: data.description,
80
+ destination: data.destination,
81
+ dstPortHigh: data.dst_port_high,
82
+ dstPortLow: data.dst_port_low,
83
+ protocol: data.protocol,
84
+ source: data.source,
85
+ srcPortHigh: data.src_port_high,
86
+ srcPortLow: data.src_port_low
87
+ };
119
88
  };
120
89
  const unmarshalGetAclResponse = (data) => {
121
- if (!isJSONObject(data)) {
122
- throw new TypeError(
123
- `Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`
124
- );
125
- }
126
- return {
127
- defaultPolicy: data.default_policy,
128
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
129
- };
90
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`);
91
+ return {
92
+ defaultPolicy: data.default_policy,
93
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
94
+ };
130
95
  };
131
96
  const unmarshalListPrivateNetworksResponse = (data) => {
132
- if (!isJSONObject(data)) {
133
- throw new TypeError(
134
- `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`
135
- );
136
- }
137
- return {
138
- privateNetworks: unmarshalArrayOfObject(
139
- data.private_networks,
140
- unmarshalPrivateNetwork
141
- ),
142
- totalCount: data.total_count
143
- };
97
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
98
+ return {
99
+ privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
100
+ totalCount: data.total_count
101
+ };
144
102
  };
145
103
  const unmarshalListSubnetsResponse = (data) => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
153
- totalCount: data.total_count
154
- };
104
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`);
105
+ return {
106
+ subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
107
+ totalCount: data.total_count
108
+ };
155
109
  };
156
110
  const unmarshalListVPCsResponse = (data) => {
157
- if (!isJSONObject(data)) {
158
- throw new TypeError(
159
- `Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`
160
- );
161
- }
162
- return {
163
- totalCount: data.total_count,
164
- vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
165
- };
111
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);
112
+ return {
113
+ totalCount: data.total_count,
114
+ vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
115
+ };
166
116
  };
167
117
  const unmarshalSetAclResponse = (data) => {
168
- if (!isJSONObject(data)) {
169
- throw new TypeError(
170
- `Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`
171
- );
172
- }
173
- return {
174
- defaultPolicy: data.default_policy,
175
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
176
- };
118
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`);
119
+ return {
120
+ defaultPolicy: data.default_policy,
121
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
122
+ };
177
123
  };
178
- const marshalAddSubnetsRequest = (request, defaults) => ({
179
- subnets: request.subnets
180
- });
124
+ const marshalAddSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
181
125
  const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
182
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
183
- name: request.name || randomName("pn"),
184
- project_id: request.projectId ?? defaults.defaultProjectId,
185
- subnets: request.subnets,
186
- tags: request.tags,
187
- vpc_id: request.vpcId
126
+ default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
127
+ name: request.name || randomName("pn"),
128
+ project_id: request.projectId ?? defaults.defaultProjectId,
129
+ subnets: request.subnets,
130
+ tags: request.tags,
131
+ vpc_id: request.vpcId
188
132
  });
189
133
  const marshalCreateRouteRequest = (request, defaults) => ({
190
- description: request.description,
191
- destination: request.destination,
192
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
193
- nexthop_resource_id: request.nexthopResourceId,
194
- tags: request.tags,
195
- vpc_id: request.vpcId
134
+ description: request.description,
135
+ destination: request.destination,
136
+ nexthop_private_network_id: request.nexthopPrivateNetworkId,
137
+ nexthop_resource_id: request.nexthopResourceId,
138
+ nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
139
+ tags: request.tags,
140
+ vpc_id: request.vpcId
196
141
  });
197
142
  const marshalCreateVPCRequest = (request, defaults) => ({
198
- enable_routing: request.enableRouting,
199
- name: request.name || randomName("vpc"),
200
- project_id: request.projectId ?? defaults.defaultProjectId,
201
- tags: request.tags
202
- });
203
- const marshalDeleteSubnetsRequest = (request, defaults) => ({
204
- subnets: request.subnets
143
+ enable_routing: request.enableRouting,
144
+ name: request.name || randomName("vpc"),
145
+ project_id: request.projectId ?? defaults.defaultProjectId,
146
+ tags: request.tags
205
147
  });
148
+ const marshalDeleteSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
206
149
  const marshalAclRule = (request, defaults) => ({
207
- action: request.action,
208
- description: request.description,
209
- destination: request.destination,
210
- dst_port_high: request.dstPortHigh,
211
- dst_port_low: request.dstPortLow,
212
- protocol: request.protocol,
213
- source: request.source,
214
- src_port_high: request.srcPortHigh,
215
- src_port_low: request.srcPortLow
150
+ action: request.action,
151
+ description: request.description,
152
+ destination: request.destination,
153
+ dst_port_high: request.dstPortHigh,
154
+ dst_port_low: request.dstPortLow,
155
+ protocol: request.protocol,
156
+ source: request.source,
157
+ src_port_high: request.srcPortHigh,
158
+ src_port_low: request.srcPortLow
216
159
  });
217
160
  const marshalSetAclRequest = (request, defaults) => ({
218
- default_policy: request.defaultPolicy,
219
- is_ipv6: request.isIpv6,
220
- rules: request.rules.map((elt) => marshalAclRule(elt))
161
+ default_policy: request.defaultPolicy,
162
+ is_ipv6: request.isIpv6,
163
+ rules: request.rules.map((elt) => marshalAclRule(elt, defaults))
221
164
  });
222
165
  const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
223
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
224
- name: request.name,
225
- tags: request.tags
166
+ default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
167
+ name: request.name,
168
+ tags: request.tags
226
169
  });
227
170
  const marshalUpdateRouteRequest = (request, defaults) => ({
228
- description: request.description,
229
- destination: request.destination,
230
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
231
- nexthop_resource_id: request.nexthopResourceId,
232
- tags: request.tags
171
+ description: request.description,
172
+ destination: request.destination,
173
+ nexthop_private_network_id: request.nexthopPrivateNetworkId,
174
+ nexthop_resource_id: request.nexthopResourceId,
175
+ nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
176
+ tags: request.tags
233
177
  });
234
178
  const marshalUpdateVPCRequest = (request, defaults) => ({
235
- name: request.name,
236
- tags: request.tags
179
+ name: request.name,
180
+ tags: request.tags
237
181
  });
238
- export {
239
- marshalAclRule,
240
- marshalAddSubnetsRequest,
241
- marshalCreatePrivateNetworkRequest,
242
- marshalCreateRouteRequest,
243
- marshalCreateVPCRequest,
244
- marshalDeleteSubnetsRequest,
245
- marshalSetAclRequest,
246
- marshalUpdatePrivateNetworkRequest,
247
- marshalUpdateRouteRequest,
248
- marshalUpdateVPCRequest,
249
- unmarshalAclRule,
250
- unmarshalAddSubnetsResponse,
251
- unmarshalDeleteSubnetsResponse,
252
- unmarshalGetAclResponse,
253
- unmarshalListPrivateNetworksResponse,
254
- unmarshalListSubnetsResponse,
255
- unmarshalListVPCsResponse,
256
- unmarshalPrivateNetwork,
257
- unmarshalRoute,
258
- unmarshalSetAclResponse,
259
- unmarshalVPC
260
- };
182
+ export { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC };
@@ -114,6 +114,10 @@ export interface Route {
114
114
  * ID of the nexthop private network.
115
115
  */
116
116
  nexthopPrivateNetworkId?: string;
117
+ /**
118
+ * ID of the nexthop VPC connector.
119
+ */
120
+ nexthopVpcConnectorId?: string;
117
121
  /**
118
122
  * Date the Route was created.
119
123
  */
@@ -299,6 +303,10 @@ export type CreateRouteRequest = {
299
303
  * ID of the nexthop private network.
300
304
  */
301
305
  nexthopPrivateNetworkId?: string;
306
+ /**
307
+ * ID of the nexthop VPC Connector.
308
+ */
309
+ nexthopVpcConnectorId?: string;
302
310
  };
303
311
  export type CreateVPCRequest = {
304
312
  /**
@@ -658,6 +666,10 @@ export type UpdateRouteRequest = {
658
666
  * ID of the nexthop private network.
659
667
  */
660
668
  nexthopPrivateNetworkId?: string;
669
+ /**
670
+ * ID of the nexthop VPC connector.
671
+ */
672
+ nexthopVpcConnectorId?: string;
661
673
  };
662
674
  export type UpdateVPCRequest = {
663
675
  /**
@@ -1,26 +1,14 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ AclRule: () => AclRule,
4
+ Route: () => Route
5
+ });
1
6
  const AclRule = {
2
- description: {
3
- maxLength: 200
4
- },
5
- dstPortHigh: {
6
- lessThanOrEqual: 65536
7
- },
8
- dstPortLow: {
9
- lessThanOrEqual: 65536
10
- },
11
- srcPortHigh: {
12
- lessThanOrEqual: 65536
13
- },
14
- srcPortLow: {
15
- lessThanOrEqual: 65536
16
- }
17
- };
18
- const Route = {
19
- description: {
20
- maxLength: 200
21
- }
22
- };
23
- export {
24
- AclRule,
25
- Route
7
+ description: { maxLength: 200 },
8
+ dstPortHigh: { lessThanOrEqual: 65536 },
9
+ dstPortLow: { lessThanOrEqual: 65536 },
10
+ srcPortHigh: { lessThanOrEqual: 65536 },
11
+ srcPortLow: { lessThanOrEqual: 65536 }
26
12
  };
13
+ const Route = { description: { maxLength: 200 } };
14
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-vpc",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK vpc",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",