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
1 change: 1 addition & 0 deletions packages/clients/src/api/vpcgw/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type {
GetIPRequest,
GetPATRuleRequest,
IP,
IpamConfig,
ListDHCPEntriesRequest,
ListDHCPEntriesRequestOrderBy,
ListDHCPEntriesResponse,
Expand Down
22 changes: 21 additions & 1 deletion packages/clients/src/api/vpcgw/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
GatewayNetwork,
GatewayType,
IP,
IpamConfig,
ListDHCPEntriesResponse,
ListDHCPsResponse,
ListGatewayNetworksResponse,
Expand Down Expand Up @@ -340,6 +341,13 @@ export const marshalCreateDHCPRequest = (
valid_lifetime: request.validLifetime,
})

const marshalIpamConfig = (
request: IpamConfig,
defaults: DefaultValues,
): Record<string, unknown> => ({
push_default_route: request.pushDefaultRoute,
})

const marshalSetDHCPEntriesRequestEntry = (
request: SetDHCPEntriesRequestEntry,
defaults: DefaultValues,
Expand Down Expand Up @@ -390,6 +398,12 @@ export const marshalCreateGatewayNetworkRequest = (
param: 'address',
value: request.address,
},
{
param: 'ipam_config',
value: request.ipamConfig
? marshalIpamConfig(request.ipamConfig, defaults)
: undefined,
},
]),
})

Expand Down Expand Up @@ -481,7 +495,7 @@ export const marshalUpdateGatewayNetworkRequest = (
): Record<string, unknown> => ({
enable_dhcp: request.enableDhcp,
enable_masquerade: request.enableMasquerade,
...resolveOneOf([
...resolveOneOf<unknown>([
{
param: 'dhcp_id',
value: request.dhcpId,
Expand All @@ -490,6 +504,12 @@ export const marshalUpdateGatewayNetworkRequest = (
param: 'address',
value: request.address,
},
{
param: 'ipam_config',
value: request.ipamConfig
? marshalIpamConfig(request.ipamConfig, defaults)
: undefined,
},
]),
})

Expand Down
54 changes: 40 additions & 14 deletions packages/clients/src/api/vpcgw/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ export interface IP {
zone: Zone
}

/** Ipam config. */
export interface IpamConfig {
/** Defines whether the default route is enabled on that Gateway Network. */
pushDefaultRoute: boolean
}

/** List dhcp entries response. */
export interface ListDHCPEntriesResponse {
/** DHCP entries in this page. */
Expand Down Expand Up @@ -541,33 +547,44 @@ export type CreateGatewayNetworkRequest = {
privateNetworkId: string
/** Defines whether to enable masquerade (dynamic NAT) on this network. */
enableMasquerade: boolean
/**
* Defines whether to enable DHCP on this Private Network. Defaults to `true`
* if either `dhcp_id` or `dhcp` are present. If set to `true`, either
* `dhcp_id` or `dhcp` must be present.
*/
enableDhcp?: boolean
/**
* ID of an existing DHCP configuration object to use for this GatewayNetwork.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address' could be
* set.
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address',
* 'ipamConfig' could be set.
*/
dhcpId?: string
/**
* New DHCP configuration object to use for this GatewayNetwork.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address' could be
* set.
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address',
* 'ipamConfig' could be set.
*/
dhcp?: CreateDHCPRequest
/**
* Static IP address in CIDR format to to use without DHCP.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address' could be
* set.
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address',
* 'ipamConfig' could be set.
*/
address?: string
/**
* Defines whether to enable DHCP on this Private Network. Defaults to `true`
* if either `dhcp_id` or `dhcp` are present. If set to `true`, either
* `dhcp_id` or `dhcp` must be present.
* Auto-configure the GatewayNetwork using Scaleway's IPAM (IP address
* management service). Note: all or none of the GatewayNetworks for a single
* gateway can use the IPAM. DHCP and IPAM configurations cannot be mixed.
* Some products may require that the Public Gateway uses the IPAM, to ensure
* correct functionality.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'dhcp', 'address',
* 'ipamConfig' could be set.
*/
enableDhcp?: boolean
ipamConfig?: IpamConfig
}

export type UpdateGatewayNetworkRequest = {
Expand All @@ -577,20 +594,29 @@ export type UpdateGatewayNetworkRequest = {
gatewayNetworkId: string
/** Defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork. */
enableMasquerade?: boolean
/** Defines whether to enable DHCP on the connected Private Network. */
enableDhcp?: boolean
/**
* ID of the new DHCP configuration object to use with this GatewayNetwork.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'address' could be set.
* One-of ('ipConfig'): at most one of 'dhcpId', 'address', 'ipamConfig' could
* be set.
*/
dhcpId?: string
/** Defines whether to enable DHCP on the connected Private Network. */
enableDhcp?: boolean
/**
* New static IP address.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'address' could be set.
* One-of ('ipConfig'): at most one of 'dhcpId', 'address', 'ipamConfig' could
* be set.
*/
address?: string
/**
* New IPAM configuration to use for this GatewayNetwork.
*
* One-of ('ipConfig'): at most one of 'dhcpId', 'address', 'ipamConfig' could
* be set.
*/
ipamConfig?: IpamConfig
}

export type DeleteGatewayNetworkRequest = {
Expand Down