33import {
44 API as ParentAPI ,
55 enrichForPagination ,
6- toApiLocality ,
76 urlParams ,
87 validatePathParam ,
8+ toApiLocality ,
99} from '@scaleway/sdk-client'
10- import type { ApiLocality } from '@scaleway/sdk-client'
10+ import type { ApiLocality , } from '@scaleway/sdk-client'
1111import {
1212 marshalAddSubnetsRequest ,
13+ unmarshalAddSubnetsResponse ,
1314 marshalCreatePrivateNetworkRequest ,
1415 marshalCreateRouteRequest ,
1516 marshalCreateVPCRequest ,
1617 marshalDeleteSubnetsRequest ,
17- marshalSetAclRequest ,
18- marshalUpdatePrivateNetworkRequest ,
19- marshalUpdateRouteRequest ,
20- marshalUpdateVPCRequest ,
21- unmarshalAddSubnetsResponse ,
2218 unmarshalDeleteSubnetsResponse ,
2319 unmarshalGetAclResponse ,
2420 unmarshalListPrivateNetworksResponse ,
2521 unmarshalListSubnetsResponse ,
2622 unmarshalListVPCsResponse ,
2723 unmarshalPrivateNetwork ,
2824 unmarshalRoute ,
25+ marshalSetAclRequest ,
2926 unmarshalSetAclResponse ,
27+ marshalUpdatePrivateNetworkRequest ,
28+ marshalUpdateRouteRequest ,
29+ marshalUpdateVPCRequest ,
3030 unmarshalVPC ,
3131} from './marshalling.gen.js'
3232import type {
@@ -78,10 +78,15 @@ export class API extends ParentAPI {
7878 * Locality of this API.
7979 * type ∈ {'zone','region','global','unspecified'}
8080 */
81- public static readonly LOCALITY : ApiLocality = toApiLocality ( {
82- regions : [ 'fr-par' , 'nl-ams' , 'pl-waw' ] ,
83- } )
84-
81+ public static readonly LOCALITY : ApiLocality =
82+ toApiLocality ( {
83+ regions : [
84+ 'fr-par' ,
85+ 'nl-ams' ,
86+ 'pl-waw' ,
87+ ] ,
88+ } )
89+
8590 protected pageOfListVPCs = ( request : Readonly < ListVPCsRequest > = { } ) =>
8691 this . client . fetch < ListVPCsResponse > (
8792 {
@@ -93,18 +98,15 @@ export class API extends ParentAPI {
9398 [ 'order_by' , request . orderBy ] ,
9499 [ 'organization_id' , request . organizationId ] ,
95100 [ 'page' , request . page ] ,
96- [
97- 'page_size' ,
98- request . pageSize ?? this . client . settings . defaultPageSize ,
99- ] ,
101+ [ 'page_size' , request . pageSize ?? this . client . settings . defaultPageSize ] ,
100102 [ 'project_id' , request . projectId ] ,
101103 [ 'routing_enabled' , request . routingEnabled ] ,
102104 [ 'tags' , request . tags ] ,
103105 ) ,
104106 } ,
105107 unmarshalListVPCsResponse ,
106108 )
107-
109+
108110 /**
109111 * List VPCs. List existing VPCs in the specified region.
110112 *
@@ -114,6 +116,7 @@ export class API extends ParentAPI {
114116 listVPCs = ( request : Readonly < ListVPCsRequest > = { } ) =>
115117 enrichForPagination ( 'vpcs' , this . pageOfListVPCs , request )
116118
119+
117120 /**
118121 * Create a VPC. Create a new VPC in the specified region.
119122 *
@@ -133,6 +136,7 @@ export class API extends ParentAPI {
133136 unmarshalVPC ,
134137 )
135138
139+
136140 /**
137141 * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
138142 *
@@ -148,6 +152,7 @@ export class API extends ParentAPI {
148152 unmarshalVPC ,
149153 )
150154
155+
151156 /**
152157 * Update VPC. Update parameters including name and tags of the specified VPC.
153158 *
@@ -167,20 +172,22 @@ export class API extends ParentAPI {
167172 unmarshalVPC ,
168173 )
169174
175+
170176 /**
171177 * Delete a VPC. Delete a VPC specified by its VPC ID.
172178 *
173179 * @param request - The request {@link DeleteVPCRequest}
174180 */
175181 deleteVPC = ( request : Readonly < DeleteVPCRequest > ) =>
176- this . client . fetch < void > ( {
177- method : 'DELETE' ,
178- path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /vpcs/${ validatePathParam ( 'vpcId' , request . vpcId ) } ` ,
179- } )
182+ this . client . fetch < void > (
183+ {
184+ method : 'DELETE' ,
185+ path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /vpcs/${ validatePathParam ( 'vpcId' , request . vpcId ) } ` ,
186+ } ,
187+ )
180188
181- protected pageOfListPrivateNetworks = (
182- request : Readonly < ListPrivateNetworksRequest > = { } ,
183- ) =>
189+
190+ protected pageOfListPrivateNetworks = ( request : Readonly < ListPrivateNetworksRequest > = { } ) =>
184191 this . client . fetch < ListPrivateNetworksResponse > (
185192 {
186193 method : 'GET' ,
@@ -191,10 +198,7 @@ export class API extends ParentAPI {
191198 [ 'order_by' , request . orderBy ] ,
192199 [ 'organization_id' , request . organizationId ] ,
193200 [ 'page' , request . page ] ,
194- [
195- 'page_size' ,
196- request . pageSize ?? this . client . settings . defaultPageSize ,
197- ] ,
201+ [ 'page_size' , request . pageSize ?? this . client . settings . defaultPageSize ] ,
198202 [ 'private_network_ids' , request . privateNetworkIds ] ,
199203 [ 'project_id' , request . projectId ] ,
200204 [ 'tags' , request . tags ] ,
@@ -203,20 +207,17 @@ export class API extends ParentAPI {
203207 } ,
204208 unmarshalListPrivateNetworksResponse ,
205209 )
206-
210+
207211 /**
208212 * 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.
209213 *
210214 * @param request - The request {@link ListPrivateNetworksRequest}
211215 * @returns A Promise of ListPrivateNetworksResponse
212216 */
213217 listPrivateNetworks = ( request : Readonly < ListPrivateNetworksRequest > = { } ) =>
214- enrichForPagination (
215- 'privateNetworks' ,
216- this . pageOfListPrivateNetworks ,
217- request ,
218- )
218+ enrichForPagination ( 'privateNetworks' , this . pageOfListPrivateNetworks , request )
219219
220+
220221 /**
221222 * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
222223 *
@@ -236,6 +237,7 @@ export class API extends ParentAPI {
236237 unmarshalPrivateNetwork ,
237238 )
238239
240+
239241 /**
240242 * 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.
241243 *
@@ -251,6 +253,7 @@ export class API extends ParentAPI {
251253 unmarshalPrivateNetwork ,
252254 )
253255
256+
254257 /**
255258 * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
256259 *
@@ -270,17 +273,21 @@ export class API extends ParentAPI {
270273 unmarshalPrivateNetwork ,
271274 )
272275
276+
273277 /**
274278 * 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.
275279 *
276280 * @param request - The request {@link DeletePrivateNetworkRequest}
277281 */
278282 deletePrivateNetwork = ( request : Readonly < DeletePrivateNetworkRequest > ) =>
279- this . client . fetch < void > ( {
280- method : 'DELETE' ,
281- path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /private-networks/${ validatePathParam ( 'privateNetworkId' , request . privateNetworkId ) } ` ,
282- } )
283+ this . client . fetch < void > (
284+ {
285+ method : 'DELETE' ,
286+ path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /private-networks/${ validatePathParam ( 'privateNetworkId' , request . privateNetworkId ) } ` ,
287+ } ,
288+ )
283289
290+
284291 /**
285292 * 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.
286293 *
@@ -298,6 +305,7 @@ export class API extends ParentAPI {
298305 unmarshalPrivateNetwork ,
299306 )
300307
308+
301309 /**
302310 * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
303311 *
@@ -315,15 +323,14 @@ export class API extends ParentAPI {
315323 unmarshalVPC ,
316324 )
317325
326+
318327 /**
319328 * 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.
320329 *
321330 * @param request - The request {@link EnableCustomRoutesPropagationRequest}
322331 * @returns A Promise of VPC
323332 */
324- enableCustomRoutesPropagation = (
325- request : Readonly < EnableCustomRoutesPropagationRequest > ,
326- ) =>
333+ enableCustomRoutesPropagation = ( request : Readonly < EnableCustomRoutesPropagationRequest > ) =>
327334 this . client . fetch < VPC > (
328335 {
329336 body : '{}' ,
@@ -334,6 +341,7 @@ export class API extends ParentAPI {
334341 unmarshalVPC ,
335342 )
336343
344+
337345 protected pageOfListSubnets = ( request : Readonly < ListSubnetsRequest > = { } ) =>
338346 this . client . fetch < ListSubnetsResponse > (
339347 {
@@ -343,18 +351,15 @@ export class API extends ParentAPI {
343351 [ 'order_by' , request . orderBy ] ,
344352 [ 'organization_id' , request . organizationId ] ,
345353 [ 'page' , request . page ] ,
346- [
347- 'page_size' ,
348- request . pageSize ?? this . client . settings . defaultPageSize ,
349- ] ,
354+ [ 'page_size' , request . pageSize ?? this . client . settings . defaultPageSize ] ,
350355 [ 'project_id' , request . projectId ] ,
351356 [ 'subnet_ids' , request . subnetIds ] ,
352357 [ 'vpc_id' , request . vpcId ] ,
353358 ) ,
354359 } ,
355360 unmarshalListSubnetsResponse ,
356361 )
357-
362+
358363 /**
359364 * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
360365 *
@@ -364,6 +369,7 @@ export class API extends ParentAPI {
364369 listSubnets = ( request : Readonly < ListSubnetsRequest > = { } ) =>
365370 enrichForPagination ( 'subnets' , this . pageOfListSubnets , request )
366371
372+
367373 /**
368374 * Add subnets to a Private Network. Add new subnets to an existing Private Network.
369375 *
@@ -383,6 +389,7 @@ export class API extends ParentAPI {
383389 unmarshalAddSubnetsResponse ,
384390 )
385391
392+
386393 /**
387394 * Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
388395 *
@@ -402,6 +409,7 @@ export class API extends ParentAPI {
402409 unmarshalDeleteSubnetsResponse ,
403410 )
404411
412+
405413 /**
406414 * Create a Route. Create a new custom Route.
407415 *
@@ -421,6 +429,7 @@ export class API extends ParentAPI {
421429 unmarshalRoute ,
422430 )
423431
432+
424433 /**
425434 * Get a Route. Retrieve details of an existing Route, specified by its Route ID.
426435 *
@@ -436,6 +445,7 @@ export class API extends ParentAPI {
436445 unmarshalRoute ,
437446 )
438447
448+
439449 /**
440450 * Update Route. Update parameters of the specified Route.
441451 *
@@ -455,17 +465,21 @@ export class API extends ParentAPI {
455465 unmarshalRoute ,
456466 )
457467
468+
458469 /**
459470 * Delete a Route. Delete a Route specified by its Route ID.
460471 *
461472 * @param request - The request {@link DeleteRouteRequest}
462473 */
463474 deleteRoute = ( request : Readonly < DeleteRouteRequest > ) =>
464- this . client . fetch < void > ( {
465- method : 'DELETE' ,
466- path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /routes/${ validatePathParam ( 'routeId' , request . routeId ) } ` ,
467- } )
475+ this . client . fetch < void > (
476+ {
477+ method : 'DELETE' ,
478+ path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /routes/${ validatePathParam ( 'routeId' , request . routeId ) } ` ,
479+ } ,
480+ )
468481
482+
469483 /**
470484 * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
471485 *
@@ -477,11 +491,14 @@ export class API extends ParentAPI {
477491 {
478492 method : 'GET' ,
479493 path : `/vpc/v2/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /vpcs/${ validatePathParam ( 'vpcId' , request . vpcId ) } /acl-rules` ,
480- urlParams : urlParams ( [ 'is_ipv6' , request . isIpv6 ] ) ,
494+ urlParams : urlParams (
495+ [ 'is_ipv6' , request . isIpv6 ] ,
496+ ) ,
481497 } ,
482498 unmarshalGetAclResponse ,
483499 )
484500
501+
485502 /**
486503 * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
487504 *
@@ -500,4 +517,7 @@ export class API extends ParentAPI {
500517 } ,
501518 unmarshalSetAclResponse ,
502519 )
520+
521+
503522}
523+
0 commit comments