diff --git a/packages/clients/src/api/vpcgw/v1/index.gen.ts b/packages/clients/src/api/vpcgw/v1/index.gen.ts index 1fd9a1913..a89dd9c83 100644 --- a/packages/clients/src/api/vpcgw/v1/index.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/index.gen.ts @@ -30,6 +30,7 @@ export type { GetIPRequest, GetPATRuleRequest, IP, + IpamConfig, ListDHCPEntriesRequest, ListDHCPEntriesRequestOrderBy, ListDHCPEntriesResponse, diff --git a/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts b/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts index 77d6fc703..4925d9659 100644 --- a/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/marshalling.gen.ts @@ -21,6 +21,7 @@ import type { GatewayNetwork, GatewayType, IP, + IpamConfig, ListDHCPEntriesResponse, ListDHCPsResponse, ListGatewayNetworksResponse, @@ -340,6 +341,13 @@ export const marshalCreateDHCPRequest = ( valid_lifetime: request.validLifetime, }) +const marshalIpamConfig = ( + request: IpamConfig, + defaults: DefaultValues, +): Record => ({ + push_default_route: request.pushDefaultRoute, +}) + const marshalSetDHCPEntriesRequestEntry = ( request: SetDHCPEntriesRequestEntry, defaults: DefaultValues, @@ -390,6 +398,12 @@ export const marshalCreateGatewayNetworkRequest = ( param: 'address', value: request.address, }, + { + param: 'ipam_config', + value: request.ipamConfig + ? marshalIpamConfig(request.ipamConfig, defaults) + : undefined, + }, ]), }) @@ -481,7 +495,7 @@ export const marshalUpdateGatewayNetworkRequest = ( ): Record => ({ enable_dhcp: request.enableDhcp, enable_masquerade: request.enableMasquerade, - ...resolveOneOf([ + ...resolveOneOf([ { param: 'dhcp_id', value: request.dhcpId, @@ -490,6 +504,12 @@ export const marshalUpdateGatewayNetworkRequest = ( param: 'address', value: request.address, }, + { + param: 'ipam_config', + value: request.ipamConfig + ? marshalIpamConfig(request.ipamConfig, defaults) + : undefined, + }, ]), }) diff --git a/packages/clients/src/api/vpcgw/v1/types.gen.ts b/packages/clients/src/api/vpcgw/v1/types.gen.ts index 3ef62a126..46fcc8637 100644 --- a/packages/clients/src/api/vpcgw/v1/types.gen.ts +++ b/packages/clients/src/api/vpcgw/v1/types.gen.ts @@ -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. */ @@ -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 = { @@ -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 = {