From 3e1d2fb6d0ec25a9852057436acb88b4b9e9de6f Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 19 Nov 2025 09:44:24 +0000 Subject: [PATCH] feat: update generated APIs --- packages_generated/vpc/src/v2/api.gen.ts | 120 ++++++++++-------- packages_generated/vpc/src/v2/index.gen.ts | 5 +- .../vpc/src/v2/marshalling.gen.ts | 52 +++----- packages_generated/vpc/src/v2/types.gen.ts | 65 +++++++++- 4 files changed, 154 insertions(+), 88 deletions(-) diff --git a/packages_generated/vpc/src/v2/api.gen.ts b/packages_generated/vpc/src/v2/api.gen.ts index 84dfb3c96..d2a478f79 100644 --- a/packages_generated/vpc/src/v2/api.gen.ts +++ b/packages_generated/vpc/src/v2/api.gen.ts @@ -3,22 +3,18 @@ import { API as ParentAPI, enrichForPagination, - toApiLocality, urlParams, validatePathParam, + toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality } from '@scaleway/sdk-client' +import type { ApiLocality,} from '@scaleway/sdk-client' import { marshalAddSubnetsRequest, + unmarshalAddSubnetsResponse, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, - marshalSetAclRequest, - marshalUpdatePrivateNetworkRequest, - marshalUpdateRouteRequest, - marshalUpdateVPCRequest, - unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, @@ -26,7 +22,11 @@ import { unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, + marshalSetAclRequest, unmarshalSetAclResponse, + marshalUpdatePrivateNetworkRequest, + marshalUpdateRouteRequest, + marshalUpdateVPCRequest, unmarshalVPC, } from './marshalling.gen.js' import type { @@ -78,10 +78,15 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = toApiLocality({ - regions: ['fr-par', 'nl-ams', 'pl-waw'], - }) - + public static readonly LOCALITY: ApiLocality = + toApiLocality({ + regions: [ + 'fr-par', + 'nl-ams', + 'pl-waw', + ], + }) + protected pageOfListVPCs = (request: Readonly = {}) => this.client.fetch( { @@ -93,10 +98,7 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['routing_enabled', request.routingEnabled], ['tags', request.tags], @@ -104,7 +106,7 @@ export class API extends ParentAPI { }, unmarshalListVPCsResponse, ) - + /** * List VPCs. List existing VPCs in the specified region. * @@ -114,6 +116,7 @@ export class API extends ParentAPI { listVPCs = (request: Readonly = {}) => enrichForPagination('vpcs', this.pageOfListVPCs, request) + /** * Create a VPC. Create a new VPC in the specified region. * @@ -133,6 +136,7 @@ export class API extends ParentAPI { unmarshalVPC, ) + /** * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. * @@ -148,6 +152,7 @@ export class API extends ParentAPI { unmarshalVPC, ) + /** * Update VPC. Update parameters including name and tags of the specified VPC. * @@ -167,20 +172,22 @@ export class API extends ParentAPI { unmarshalVPC, ) + /** * Delete a VPC. Delete a VPC specified by its VPC ID. * * @param request - The request {@link DeleteVPCRequest} */ deleteVPC = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`, + }, + ) - protected pageOfListPrivateNetworks = ( - request: Readonly = {}, - ) => + + protected pageOfListPrivateNetworks = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -191,10 +198,7 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], @@ -203,7 +207,7 @@ export class API extends ParentAPI { }, unmarshalListPrivateNetworksResponse, ) - + /** * 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. * @@ -211,12 +215,9 @@ export class API extends ParentAPI { * @returns A Promise of ListPrivateNetworksResponse */ listPrivateNetworks = (request: Readonly = {}) => - enrichForPagination( - 'privateNetworks', - this.pageOfListPrivateNetworks, - request, - ) + enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request) + /** * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region. * @@ -236,6 +237,7 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) + /** * 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. * @@ -251,6 +253,7 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) + /** * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. * @@ -270,17 +273,21 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) + /** * 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. * * @param request - The request {@link DeletePrivateNetworkRequest} */ deletePrivateNetwork = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }, + ) + /** * 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. * @@ -298,6 +305,7 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) + /** * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards. * @@ -315,15 +323,14 @@ export class API extends ParentAPI { unmarshalVPC, ) + /** * 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. * * @param request - The request {@link EnableCustomRoutesPropagationRequest} * @returns A Promise of VPC */ - enableCustomRoutesPropagation = ( - request: Readonly, - ) => + enableCustomRoutesPropagation = (request: Readonly) => this.client.fetch( { body: '{}', @@ -334,6 +341,7 @@ export class API extends ParentAPI { unmarshalVPC, ) + protected pageOfListSubnets = (request: Readonly = {}) => this.client.fetch( { @@ -343,10 +351,7 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['subnet_ids', request.subnetIds], ['vpc_id', request.vpcId], @@ -354,7 +359,7 @@ export class API extends ParentAPI { }, unmarshalListSubnetsResponse, ) - + /** * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets. * @@ -364,6 +369,7 @@ export class API extends ParentAPI { listSubnets = (request: Readonly = {}) => enrichForPagination('subnets', this.pageOfListSubnets, request) + /** * Add subnets to a Private Network. Add new subnets to an existing Private Network. * @@ -383,6 +389,7 @@ export class API extends ParentAPI { unmarshalAddSubnetsResponse, ) + /** * Delete subnets from a Private Network. Delete the specified subnets from a Private Network. * @@ -402,6 +409,7 @@ export class API extends ParentAPI { unmarshalDeleteSubnetsResponse, ) + /** * Create a Route. Create a new custom Route. * @@ -421,6 +429,7 @@ export class API extends ParentAPI { unmarshalRoute, ) + /** * Get a Route. Retrieve details of an existing Route, specified by its Route ID. * @@ -436,6 +445,7 @@ export class API extends ParentAPI { unmarshalRoute, ) + /** * Update Route. Update parameters of the specified Route. * @@ -455,17 +465,21 @@ export class API extends ParentAPI { unmarshalRoute, ) + /** * Delete a Route. Delete a Route specified by its Route ID. * * @param request - The request {@link DeleteRouteRequest} */ deleteRoute = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, + }, + ) + /** * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID. * @@ -477,11 +491,14 @@ export class API extends ParentAPI { { method: 'GET', path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}/acl-rules`, - urlParams: urlParams(['is_ipv6', request.isIpv6]), + urlParams: urlParams( + ['is_ipv6', request.isIpv6], + ), }, unmarshalGetAclResponse, ) + /** * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC. * @@ -500,4 +517,7 @@ export class API extends ParentAPI { }, unmarshalSetAclResponse, ) + + } + diff --git a/packages_generated/vpc/src/v2/index.gen.ts b/packages_generated/vpc/src/v2/index.gen.ts index 153493590..ac14d3f04 100644 --- a/packages_generated/vpc/src/v2/index.gen.ts +++ b/packages_generated/vpc/src/v2/index.gen.ts @@ -1,6 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { API } from './api.gen.js' +export { + API, +} from './api.gen.js' export * from './marshalling.gen.js' export type { AclRule, @@ -35,6 +37,7 @@ export type { ListVPCsResponse, PrivateNetwork, Route, + RouteType, SetAclRequest, SetAclResponse, Subnet, diff --git a/packages_generated/vpc/src/v2/marshalling.gen.ts b/packages_generated/vpc/src/v2/marshalling.gen.ts index f437cc8ae..3d9b2b4c4 100644 --- a/packages_generated/vpc/src/v2/marshalling.gen.ts +++ b/packages_generated/vpc/src/v2/marshalling.gen.ts @@ -1,34 +1,30 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { - isJSONObject, - unmarshalArrayOfObject, - unmarshalDate, -} from '@scaleway/sdk-client' +import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { - AclRule, - AddSubnetsRequest, + Subnet, + PrivateNetwork, + Route, + VPC, AddSubnetsResponse, - CreatePrivateNetworkRequest, - CreateRouteRequest, - CreateVPCRequest, - DeleteSubnetsRequest, DeleteSubnetsResponse, + AclRule, GetAclResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, - PrivateNetwork, - Route, - SetAclRequest, SetAclResponse, - Subnet, + AddSubnetsRequest, + CreatePrivateNetworkRequest, + CreateRouteRequest, + CreateVPCRequest, + DeleteSubnetsRequest, + SetAclRequest, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, - VPC, } from './types.gen.js' const unmarshalSubnet = (data: unknown): Subnet => { @@ -89,6 +85,7 @@ export const unmarshalRoute = (data: unknown): Route => { nexthopResourceId: data.nexthop_resource_id, region: data.region, tags: data.tags, + type: data.type ? data.type : undefined, updatedAt: unmarshalDate(data.updated_at), vpcId: data.vpc_id, } as Route @@ -117,9 +114,7 @@ export const unmarshalVPC = (data: unknown): VPC => { } as VPC } -export const unmarshalAddSubnetsResponse = ( - data: unknown, -): AddSubnetsResponse => { +export const unmarshalAddSubnetsResponse = (data: unknown): AddSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`, @@ -131,9 +126,7 @@ export const unmarshalAddSubnetsResponse = ( } as AddSubnetsResponse } -export const unmarshalDeleteSubnetsResponse = ( - data: unknown, -): DeleteSubnetsResponse => { +export const unmarshalDeleteSubnetsResponse = (data: unknown): DeleteSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`, @@ -178,9 +171,7 @@ export const unmarshalGetAclResponse = (data: unknown): GetAclResponse => { } as GetAclResponse } -export const unmarshalListPrivateNetworksResponse = ( - data: unknown, -): ListPrivateNetworksResponse => { +export const unmarshalListPrivateNetworksResponse = (data: unknown): ListPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -188,17 +179,12 @@ export const unmarshalListPrivateNetworksResponse = ( } return { - privateNetworks: unmarshalArrayOfObject( - data.private_networks, - unmarshalPrivateNetwork, - ), + privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork), totalCount: data.total_count, } as ListPrivateNetworksResponse } -export const unmarshalListSubnetsResponse = ( - data: unknown, -): ListSubnetsResponse => { +export const unmarshalListSubnetsResponse = (data: unknown): ListSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`, @@ -306,7 +292,7 @@ export const marshalSetAclRequest = ( ): Record => ({ default_policy: request.defaultPolicy, is_ipv6: request.isIpv6, - rules: request.rules.map(elt => marshalAclRule(elt, defaults)), + rules: request.rules.map(elt => marshalAclRule(elt, defaults)), }) export const marshalUpdatePrivateNetworkRequest = ( diff --git a/packages_generated/vpc/src/v2/types.gen.ts b/packages_generated/vpc/src/v2/types.gen.ts index e898316b2..06305997f 100644 --- a/packages_generated/vpc/src/v2/types.gen.ts +++ b/packages_generated/vpc/src/v2/types.gen.ts @@ -1,10 +1,18 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion } from '@scaleway/sdk-client' +import type { Region as ScwRegion, } from '@scaleway/sdk-client' -export type AclRuleProtocol = 'ANY' | 'TCP' | 'UDP' | 'ICMP' -export type Action = 'unknown_action' | 'accept' | 'drop' +export type AclRuleProtocol = + | 'ANY' + | 'TCP' + | 'UDP' + | 'ICMP' + +export type Action = + | 'unknown_action' + | 'accept' + | 'drop' export type ListPrivateNetworksRequestOrderBy = | 'created_at_asc' @@ -12,7 +20,9 @@ export type ListPrivateNetworksRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListSubnetsRequestOrderBy = 'created_at_asc' | 'created_at_desc' +export type ListSubnetsRequestOrderBy = + | 'created_at_asc' + | 'created_at_desc' export type ListVPCsRequestOrderBy = | 'created_at_asc' @@ -20,6 +30,14 @@ export type ListVPCsRequestOrderBy = | 'name_asc' | 'name_desc' +export type RouteType = + | 'unknown_route_type' + | 'subnet' + | 'default' + | 'custom' + | 'interlink' + | 's2s_vpn' + export interface Subnet { /** * ID of the subnet. @@ -51,6 +69,7 @@ export interface Subnet { vpcId: string } + export interface PrivateNetwork { /** * Private Network ID. @@ -102,6 +121,7 @@ export interface PrivateNetwork { defaultRoutePropagationEnabled: boolean } + export interface Route { /** * Route ID. @@ -143,12 +163,17 @@ export interface Route { * Defines whether the route can be modified or deleted by the user. */ isReadOnly: boolean + /** + * Type of the Route. + */ + type?: RouteType /** * Region of the Route. */ region: ScwRegion } + export interface AclRule { /** * Protocol to which this rule applies. @@ -188,6 +213,7 @@ export interface AclRule { description?: string } + export interface VPC { /** * VPC ID. @@ -239,6 +265,7 @@ export interface VPC { customRoutesPropagationEnabled: boolean } + export type AddSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -254,10 +281,12 @@ export type AddSubnetsRequest = { subnets?: string[] } + export interface AddSubnetsResponse { subnets: string[] } + export type CreatePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -289,6 +318,7 @@ export type CreatePrivateNetworkRequest = { defaultRoutePropagationEnabled: boolean } + export type CreateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -320,6 +350,7 @@ export type CreateRouteRequest = { nexthopPrivateNetworkId?: string } + export type CreateVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -343,6 +374,7 @@ export type CreateVPCRequest = { enableRouting: boolean } + export type DeletePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -354,6 +386,7 @@ export type DeletePrivateNetworkRequest = { privateNetworkId: string } + export type DeleteRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -365,6 +398,7 @@ export type DeleteRouteRequest = { routeId: string } + export type DeleteSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -380,10 +414,12 @@ export type DeleteSubnetsRequest = { subnets?: string[] } + export interface DeleteSubnetsResponse { subnets: string[] } + export type DeleteVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -395,6 +431,7 @@ export type DeleteVPCRequest = { vpcId: string } + export type EnableCustomRoutesPropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -406,6 +443,7 @@ export type EnableCustomRoutesPropagationRequest = { vpcId: string } + export type EnableDHCPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -417,6 +455,7 @@ export type EnableDHCPRequest = { privateNetworkId: string } + export type EnableRoutingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -428,6 +467,7 @@ export type EnableRoutingRequest = { vpcId: string } + export type GetAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -443,11 +483,13 @@ export type GetAclRequest = { isIpv6: boolean } + export interface GetAclResponse { rules: AclRule[] defaultPolicy: Action } + export type GetPrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -459,6 +501,7 @@ export type GetPrivateNetworkRequest = { privateNetworkId: string } + export type GetRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -470,6 +513,7 @@ export type GetRouteRequest = { routeId: string } + export type GetVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -481,6 +525,7 @@ export type GetVPCRequest = { vpcId: string } + export type ListPrivateNetworksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -528,11 +573,13 @@ export type ListPrivateNetworksRequest = { dhcpEnabled?: boolean } + export interface ListPrivateNetworksResponse { privateNetworks: PrivateNetwork[] totalCount: number } + export type ListSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -568,11 +615,13 @@ export type ListSubnetsRequest = { vpcId?: string } + export interface ListSubnetsResponse { subnets: Subnet[] totalCount: number } + export type ListVPCsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -616,11 +665,13 @@ export type ListVPCsRequest = { routingEnabled?: boolean } + export interface ListVPCsResponse { vpcs: VPC[] totalCount: number } + export type SetAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -644,11 +695,13 @@ export type SetAclRequest = { defaultPolicy: Action } + export interface SetAclResponse { rules: AclRule[] defaultPolicy: Action } + export type UpdatePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -672,6 +725,7 @@ export type UpdatePrivateNetworkRequest = { defaultRoutePropagationEnabled?: boolean } + export type UpdateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -703,6 +757,7 @@ export type UpdateRouteRequest = { nexthopPrivateNetworkId?: string } + export type UpdateVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -721,3 +776,5 @@ export type UpdateVPCRequest = { */ tags?: string[] } + +