Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/clients/src/api/vpcgw/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
marshalUpdateGatewayRequest,
marshalUpdateIPRequest,
marshalUpdatePATRuleRequest,
marshalUpgradeGatewayRequest,
unmarshalDHCP,
unmarshalDHCPEntry,
unmarshalGateway,
Expand Down Expand Up @@ -249,18 +250,21 @@ 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
*/
upgradeGateway = (request: Readonly<UpgradeGatewayRequest>) =>
this.client.fetch<Gateway>(
{
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`,
Expand Down
8 changes: 8 additions & 0 deletions packages/clients/src/api/vpcgw/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import type {
UpdateGatewayRequest,
UpdateIPRequest,
UpdatePATRuleRequest,
UpgradeGatewayRequest,
} from './types.gen'

export const unmarshalDHCP = (data: unknown): DHCP => {
Expand Down Expand Up @@ -586,3 +587,10 @@ export const marshalUpdatePATRuleRequest = (
protocol: request.protocol,
public_port: request.publicPort,
})

export const marshalUpgradeGatewayRequest = (
request: UpgradeGatewayRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
type: request.type,
})
2 changes: 2 additions & 0 deletions packages/clients/src/api/vpcgw/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,4 +1016,6 @@ export type UpgradeGatewayRequest = {
zone?: Zone
/** ID of the gateway to upgrade. */
gatewayId: string
/** Gateway type (commercial offer). */
type?: string
}