// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
)

// AWSNetworkLoadBalancerParametersApplyConfiguration represents a declarative configuration of the AWSNetworkLoadBalancerParameters type for use
// with apply.
//
// AWSNetworkLoadBalancerParameters holds configuration parameters for an
// AWS Network load balancer. For Example: Setting AWS EIPs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
type AWSNetworkLoadBalancerParametersApplyConfiguration struct {
	// subnets specifies the subnets to which the load balancer will
	// attach. The subnets may be specified by either their
	// ID or name. The total number of subnets is limited to 10.
	//
	// In order for the load balancer to be provisioned with subnets,
	// each subnet must exist, each subnet must be from a different
	// availability zone, and the load balancer service must be
	// recreated to pick up new values.
	//
	// When omitted from the spec, the subnets will be auto-discovered
	// for each availability zone. Auto-discovered subnets are not reported
	// in the status of the IngressController object.
	Subnets *AWSSubnetsApplyConfiguration `json:"subnets,omitempty"`
	// eipAllocations is a list of IDs for Elastic IP (EIP) addresses that
	// are assigned to the Network Load Balancer.
	// The following restrictions apply:
	//
	// eipAllocations can only be used with external scope, not internal.
	// An EIP can be allocated to only a single IngressController.
	// The number of EIP allocations must match the number of subnets that are used for the load balancer.
	// Each EIP allocation must be unique.
	// A maximum of 10 EIP allocations are permitted.
	//
	// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html for general
	// information about configuration, characteristics, and limitations of Elastic IP addresses.
	EIPAllocations []operatorv1.EIPAllocation `json:"eipAllocations,omitempty"`
	// protocol specifies whether the Network Load Balancer uses PROXY
	// protocol to forward connections to the IngressController.
	//
	// When set to "TCP", the NLB uses AWS's native client IP preservation.
	// This may cause hairpin connection failures for internal load
	// balancers when connections are made from pods to router pods on
	// the same node.
	//
	// When set to "PROXY", the NLB disables native client IP preservation
	// and uses PROXY protocol v2. The IngressController enables PROXY
	// protocol on HAProxy so that it can parse PROXY protocol headers to
	// obtain the original client IP. This avoids hairpin connection
	// failures.
	//
	// The following values are valid for this field:
	//
	// * "TCP".
	// * "PROXY".
	//
	// When omitted, this means the user has no opinion and the value is
	// left to the platform to choose a reasonable default, which is subject to
	// change over time. The current default is "PROXY".
	//
	// Note that changing this field may cause brief connection failures
	// during the transition as the NLB attribute change and router rollout
	// occur independently.
	Protocol *operatorv1.NLBProtocol `json:"protocol,omitempty"`
}

// AWSNetworkLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the AWSNetworkLoadBalancerParameters type for use with
// apply.
func AWSNetworkLoadBalancerParameters() *AWSNetworkLoadBalancerParametersApplyConfiguration {
	return &AWSNetworkLoadBalancerParametersApplyConfiguration{}
}

// WithSubnets sets the Subnets field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Subnets field is set to the value of the last call.
func (b *AWSNetworkLoadBalancerParametersApplyConfiguration) WithSubnets(value *AWSSubnetsApplyConfiguration) *AWSNetworkLoadBalancerParametersApplyConfiguration {
	b.Subnets = value
	return b
}

// WithEIPAllocations adds the given value to the EIPAllocations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the EIPAllocations field.
func (b *AWSNetworkLoadBalancerParametersApplyConfiguration) WithEIPAllocations(values ...operatorv1.EIPAllocation) *AWSNetworkLoadBalancerParametersApplyConfiguration {
	for i := range values {
		b.EIPAllocations = append(b.EIPAllocations, values[i])
	}
	return b
}

// WithProtocol sets the Protocol field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Protocol field is set to the value of the last call.
func (b *AWSNetworkLoadBalancerParametersApplyConfiguration) WithProtocol(value operatorv1.NLBProtocol) *AWSNetworkLoadBalancerParametersApplyConfiguration {
	b.Protocol = &value
	return b
}
