Skip to content

feat(vpc_gw): add field to help clients known which pwg is legacy xor ipam #936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2023
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: 14 additions & 0 deletions packages/clients/src/api/vpcgw/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ export const unmarshalDHCP = (data: unknown) => {
} as DHCP
}

const unmarshalIpamConfig = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`,
)
}

return { pushDefaultRoute: data.push_default_route } as IpamConfig
}

export const unmarshalGatewayNetwork = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -89,6 +99,9 @@ export const unmarshalGatewayNetwork = (data: unknown) => {
enableMasquerade: data.enable_masquerade,
gatewayId: data.gateway_id,
id: data.id,
ipamConfig: data.ipam_config
? unmarshalIpamConfig(data.ipam_config)
: undefined,
macAddress: data.mac_address,
privateNetworkId: data.private_network_id,
status: data.status,
Expand Down Expand Up @@ -170,6 +183,7 @@ export const unmarshalGateway = (data: unknown) => {
),
id: data.id,
ip: data.ip ? unmarshalIP(data.ip) : undefined,
isLegacy: data.is_legacy,
name: data.name,
organizationId: data.organization_id,
projectId: data.project_id,
Expand Down
4 changes: 4 additions & 0 deletions packages/clients/src/api/vpcgw/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export interface Gateway {
bastionPort: number
/** Defines whether SMTP traffic is allowed to pass through the gateway. */
smtpEnabled: boolean
/** Whether this uses non-IPAM IP configurations. */
isLegacy: boolean
/** Zone of the gateway. */
zone: Zone
}
Expand Down Expand Up @@ -242,6 +244,8 @@ export interface GatewayNetwork {
enableDhcp: boolean
/** Address of the Gateway (in CIDR form) to use when DHCP is not used. */
address?: string
/** IPAM IP configuration used. */
ipamConfig?: IpamConfig
/** Zone of the GatewayNetwork connection. */
zone: Zone
}
Expand Down