From 2382ff79e4419a0ad5d45c67cc8bbe4653a165c4 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 30 Jan 2025 09:32:18 +0000 Subject: [PATCH] feat: update generated APIs --- .../clients/src/api/iam/v1alpha1/index.gen.ts | 2 + packages/clients/src/api/vpc/v2/api.gen.ts | 34 ++------- packages/clients/src/api/vpc/v2/index.gen.ts | 1 - .../clients/src/api/vpc/v2/marshalling.gen.ts | 21 ------ packages/clients/src/api/vpc/v2/types.gen.ts | 74 ++++++------------- 5 files changed, 32 insertions(+), 100 deletions(-) diff --git a/packages/clients/src/api/iam/v1alpha1/index.gen.ts b/packages/clients/src/api/iam/v1alpha1/index.gen.ts index 0e1b20a7f..80d869148 100644 --- a/packages/clients/src/api/iam/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/index.gen.ts @@ -74,6 +74,7 @@ export type { ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, + LocalityType, LockUserRequest, Log, LogAction, @@ -84,6 +85,7 @@ export type { PermissionSetScopeType, Policy, Quotum, + QuotumLimit, RemoveGroupMemberRequest, Rule, RuleSpecs, diff --git a/packages/clients/src/api/vpc/v2/api.gen.ts b/packages/clients/src/api/vpc/v2/api.gen.ts index 5e4fa293f..54f37022c 100644 --- a/packages/clients/src/api/vpc/v2/api.gen.ts +++ b/packages/clients/src/api/vpc/v2/api.gen.ts @@ -6,14 +6,13 @@ import { urlParams, validatePathParam, } from '../../../bridge' -import type { Region } from '../../../bridge' +import type { Region as ScwRegion } from '../../../bridge' import { marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, - marshalMigrateZonalPrivateNetworksRequest, marshalSetSubnetsRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, @@ -50,7 +49,6 @@ import type { ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, - MigrateZonalPrivateNetworksRequest, PrivateNetwork, Route, SetSubnetsRequest, @@ -73,7 +71,11 @@ const jsonContentHeaders = { */ export class API extends ParentAPI { /** Lists the available regions of the API. */ - public static readonly LOCALITIES: Region[] = ['fr-par', 'nl-ams', 'pl-waw'] + public static readonly LOCALITIES: ScwRegion[] = [ + 'fr-par', + 'nl-ams', + 'pl-waw', + ] protected pageOfListVPCs = (request: Readonly = {}) => this.client.fetch( @@ -284,30 +286,6 @@ export class API extends ParentAPI { path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, }) - /** - * Migrate Private Networks from zoned to regional. Transform multiple - * existing zoned Private Networks (scoped to a single Availability Zone) into - * regional Private Networks, scoped to an entire region. You can transform - * one or many Private Networks (specified by their Private Network IDs) - * within a single Scaleway Organization or Project, with the same call. - * - * @param request - The request {@link MigrateZonalPrivateNetworksRequest} - */ - migrateZonalPrivateNetworks = ( - request: Readonly = {}, - ) => - this.client.fetch({ - body: JSON.stringify( - marshalMigrateZonalPrivateNetworksRequest( - request, - this.client.settings, - ), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/migrate-zonal`, - }) - /** * Enable DHCP on a Private Network. Enable DHCP managed on an existing * Private Network. Note that you will not be able to deactivate it diff --git a/packages/clients/src/api/vpc/v2/index.gen.ts b/packages/clients/src/api/vpc/v2/index.gen.ts index 2a0001ca7..000a8628c 100644 --- a/packages/clients/src/api/vpc/v2/index.gen.ts +++ b/packages/clients/src/api/vpc/v2/index.gen.ts @@ -26,7 +26,6 @@ export type { ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, - MigrateZonalPrivateNetworksRequest, PrivateNetwork, Route, SetSubnetsRequest, diff --git a/packages/clients/src/api/vpc/v2/marshalling.gen.ts b/packages/clients/src/api/vpc/v2/marshalling.gen.ts index 8e7e2723c..daa154cb9 100644 --- a/packages/clients/src/api/vpc/v2/marshalling.gen.ts +++ b/packages/clients/src/api/vpc/v2/marshalling.gen.ts @@ -3,7 +3,6 @@ import randomName from '@scaleway/random-name' import { isJSONObject, - resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '../../../bridge' @@ -19,7 +18,6 @@ import type { ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, - MigrateZonalPrivateNetworksRequest, PrivateNetwork, Route, SetSubnetsRequest, @@ -250,25 +248,6 @@ export const marshalDeleteSubnetsRequest = ( subnets: request.subnets, }) -export const marshalMigrateZonalPrivateNetworksRequest = ( - request: MigrateZonalPrivateNetworksRequest, - defaults: DefaultValues, -): Record => ({ - private_network_ids: request.privateNetworkIds, - ...resolveOneOf([ - { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId, - }, - { - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId, - }, - ]), -}) - export const marshalSetSubnetsRequest = ( request: SetSubnetsRequest, defaults: DefaultValues, diff --git a/packages/clients/src/api/vpc/v2/types.gen.ts b/packages/clients/src/api/vpc/v2/types.gen.ts index 635aa30f1..e33d426d8 100644 --- a/packages/clients/src/api/vpc/v2/types.gen.ts +++ b/packages/clients/src/api/vpc/v2/types.gen.ts @@ -1,6 +1,6 @@ // 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 } from '../../../bridge' +import type { Region as ScwRegion } from '../../../bridge' export type ListPrivateNetworksRequestOrderBy = | 'created_at_asc' @@ -43,7 +43,7 @@ export interface PrivateNetwork { /** Scaleway Project the Private Network belongs to. */ projectId: string /** Region in which the Private Network is available. */ - region: Region + region: ScwRegion /** Tags of the Private Network. */ tags: string[] /** Date the Private Network was created. */ @@ -80,7 +80,7 @@ export interface Route { /** Defines whether the route can be modified or deleted by the user. */ isReadOnly: boolean /** Region of the Route. */ - region: Region + region: ScwRegion } export interface VPC { @@ -93,7 +93,7 @@ export interface VPC { /** Scaleway Project the VPC belongs to. */ projectId: string /** Region of the VPC. */ - region: Region + region: ScwRegion /** Tags for the VPC. */ tags: string[] /** Defines whether the VPC is the default one for its Project. */ @@ -113,7 +113,7 @@ export type AddSubnetsRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string /** Private Network subnets CIDR. */ @@ -129,7 +129,7 @@ export type CreatePrivateNetworkRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Name for the Private Network. */ name?: string /** Scaleway Project in which to create the Private Network. */ @@ -147,7 +147,7 @@ export type CreateRouteRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Route description. */ description: string /** Tags of the Route. */ @@ -167,7 +167,7 @@ export type CreateVPCRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Name for the VPC. */ name?: string /** Scaleway Project in which to create the VPC. */ @@ -183,7 +183,7 @@ export type DeletePrivateNetworkRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string } @@ -193,7 +193,7 @@ export type DeleteRouteRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Route ID. */ routeId: string } @@ -203,7 +203,7 @@ export type DeleteSubnetsRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string /** Private Network subnets CIDR. */ @@ -219,7 +219,7 @@ export type DeleteVPCRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** VPC ID. */ vpcId: string } @@ -229,7 +229,7 @@ export type EnableDHCPRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string } @@ -239,7 +239,7 @@ export type EnableRoutingRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** VPC ID. */ vpcId: string } @@ -249,7 +249,7 @@ export type GetPrivateNetworkRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string } @@ -259,7 +259,7 @@ export type GetRouteRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Route ID. */ routeId: string } @@ -269,7 +269,7 @@ export type GetVPCRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** VPC ID. */ vpcId: string } @@ -279,7 +279,7 @@ export type ListPrivateNetworksRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Sort order of the returned Private Networks. */ orderBy?: ListPrivateNetworksRequestOrderBy /** Page number to return, from the paginated results. */ @@ -333,7 +333,7 @@ export type ListSubnetsRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Sort order of the returned subnets. */ orderBy?: ListSubnetsRequestOrderBy /** Page number to return, from the paginated results. */ @@ -369,7 +369,7 @@ export type ListVPCsRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Sort order of the returned VPCs. */ orderBy?: ListVPCsRequestOrderBy /** Page number to return, from the paginated results. */ @@ -413,38 +413,12 @@ export interface ListVPCsResponse { totalCount: number } -export type MigrateZonalPrivateNetworksRequest = { - /** - * Region to target. If none is passed will use default region from the - * config. - */ - region?: Region - /** - * Organization ID to target. The specified zoned Private Networks within this - * Organization will be migrated to regional. - * - * One-of ('scope'): at most one of 'organizationId', 'projectId' could be - * set. - */ - organizationId?: string - /** - * Project to target. The specified zoned Private Networks within this Project - * will be migrated to regional. - * - * One-of ('scope'): at most one of 'organizationId', 'projectId' could be - * set. - */ - projectId?: string - /** IDs of the Private Networks to migrate. */ - privateNetworkIds?: string[] -} - export type SetSubnetsRequest = { /** * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string /** Private Network subnets CIDR. */ @@ -460,7 +434,7 @@ export type UpdatePrivateNetworkRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Private Network ID. */ privateNetworkId: string /** Name for the Private Network. */ @@ -474,7 +448,7 @@ export type UpdateRouteRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** Route ID. */ routeId: string /** Route description. */ @@ -494,7 +468,7 @@ export type UpdateVPCRequest = { * Region to target. If none is passed will use default region from the * config. */ - region?: Region + region?: ScwRegion /** VPC ID. */ vpcId: string /** Name for the VPC. */