Skip to content

Commit a8334bc

Browse files
authored
feat(vpc_gw): add field to help clients known which pwg is legacy xor ipam (#936)
1 parent 75461bb commit a8334bc

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/clients/src/api/vpcgw/v1/marshalling.gen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ export const unmarshalDHCP = (data: unknown) => {
7474
} as DHCP
7575
}
7676

77+
const unmarshalIpamConfig = (data: unknown) => {
78+
if (!isJSONObject(data)) {
79+
throw new TypeError(
80+
`Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`,
81+
)
82+
}
83+
84+
return { pushDefaultRoute: data.push_default_route } as IpamConfig
85+
}
86+
7787
export const unmarshalGatewayNetwork = (data: unknown) => {
7888
if (!isJSONObject(data)) {
7989
throw new TypeError(
@@ -89,6 +99,9 @@ export const unmarshalGatewayNetwork = (data: unknown) => {
8999
enableMasquerade: data.enable_masquerade,
90100
gatewayId: data.gateway_id,
91101
id: data.id,
102+
ipamConfig: data.ipam_config
103+
? unmarshalIpamConfig(data.ipam_config)
104+
: undefined,
92105
macAddress: data.mac_address,
93106
privateNetworkId: data.private_network_id,
94107
status: data.status,
@@ -170,6 +183,7 @@ export const unmarshalGateway = (data: unknown) => {
170183
),
171184
id: data.id,
172185
ip: data.ip ? unmarshalIP(data.ip) : undefined,
186+
isLegacy: data.is_legacy,
173187
name: data.name,
174188
organizationId: data.organization_id,
175189
projectId: data.project_id,

packages/clients/src/api/vpcgw/v1/types.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ export interface Gateway {
208208
bastionPort: number
209209
/** Defines whether SMTP traffic is allowed to pass through the gateway. */
210210
smtpEnabled: boolean
211+
/** Whether this uses non-IPAM IP configurations. */
212+
isLegacy: boolean
211213
/** Zone of the gateway. */
212214
zone: Zone
213215
}
@@ -242,6 +244,8 @@ export interface GatewayNetwork {
242244
enableDhcp: boolean
243245
/** Address of the Gateway (in CIDR form) to use when DHCP is not used. */
244246
address?: string
247+
/** IPAM IP configuration used. */
248+
ipamConfig?: IpamConfig
245249
/** Zone of the GatewayNetwork connection. */
246250
zone: Zone
247251
}

0 commit comments

Comments
 (0)