diff --git a/packages/clients/src/api/vpcgw/v1/api.gen.ts b/packages/clients/src/api/vpcgw/v1/api.gen.ts index 5bbcc4adb..0885a4d91 100644 --- a/packages/clients/src/api/vpcgw/v1/api.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/api.gen.ts @@ -27,6 +27,7 @@ import { marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePATRuleRequest, + marshalUpgradeGatewayRequest, unmarshalDHCP, unmarshalDHCPEntry, unmarshalGateway, @@ -249,10 +250,11 @@ export class API extends ParentAPI { }) /** - * Upgrade a Public Gateway to the latest version. Upgrade a given Public - * Gateway to the newest software version. This applies the latest bugfixes - * and features to your Public Gateway, but its service will be interrupted - * during the update. + * Upgrade a Public Gateway to the latest version and/or to a different + * commercial offer type. Upgrade a given Public Gateway to the newest + * software version or to a different commercial offer type. This applies the + * latest bugfixes and features to your Public Gateway. Note that gateway + * service will be interrupted during the update. * * @param request - The request {@link UpgradeGatewayRequest} * @returns A Promise of Gateway @@ -260,7 +262,9 @@ export class API extends ParentAPI { upgradeGateway = (request: Readonly) => this.client.fetch( { - body: '{}', + body: JSON.stringify( + marshalUpgradeGatewayRequest(request, this.client.settings), + ), headers: jsonContentHeaders, method: 'POST', path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`, diff --git a/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts b/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts index 076cab4ec..b83fd5c66 100644 --- a/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts @@ -44,6 +44,7 @@ import type { UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, + UpgradeGatewayRequest, } from './types.gen' export const unmarshalDHCP = (data: unknown): DHCP => { @@ -586,3 +587,10 @@ export const marshalUpdatePATRuleRequest = ( protocol: request.protocol, public_port: request.publicPort, }) + +export const marshalUpgradeGatewayRequest = ( + request: UpgradeGatewayRequest, + defaults: DefaultValues, +): Record => ({ + type: request.type, +}) diff --git a/packages/clients/src/api/vpcgw/v1/types.gen.ts b/packages/clients/src/api/vpcgw/v1/types.gen.ts index 82828ade3..08af4af42 100644 --- a/packages/clients/src/api/vpcgw/v1/types.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/types.gen.ts @@ -1016,4 +1016,6 @@ export type UpgradeGatewayRequest = { zone?: Zone /** ID of the gateway to upgrade. */ gatewayId: string + /** Gateway type (commercial offer). */ + type?: string }