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

package v1

// ExternalIPConfigApplyConfiguration represents a declarative configuration of the ExternalIPConfig type for use
// with apply.
//
// ExternalIPConfig specifies some IP blocks relevant for the ExternalIP field
// of a Service resource.
type ExternalIPConfigApplyConfiguration struct {
	// policy is a set of restrictions applied to the ExternalIP field.
	// If nil or empty, then ExternalIP is not allowed to be set.
	Policy *ExternalIPPolicyApplyConfiguration `json:"policy,omitempty"`
	// autoAssignCIDRs is a list of CIDRs from which to automatically assign
	// Service.ExternalIP. These are assigned when the service is of type
	// LoadBalancer. In general, this is only useful for bare-metal clusters.
	// In Openshift 3.x, this was misleadingly called "IngressIPs".
	// Automatically assigned External IPs are not affected by any
	// ExternalIPPolicy rules.
	// Currently, only one entry may be provided.
	AutoAssignCIDRs []string `json:"autoAssignCIDRs,omitempty"`
}

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

// WithPolicy sets the Policy 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 Policy field is set to the value of the last call.
func (b *ExternalIPConfigApplyConfiguration) WithPolicy(value *ExternalIPPolicyApplyConfiguration) *ExternalIPConfigApplyConfiguration {
	b.Policy = value
	return b
}

// WithAutoAssignCIDRs adds the given value to the AutoAssignCIDRs 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 AutoAssignCIDRs field.
func (b *ExternalIPConfigApplyConfiguration) WithAutoAssignCIDRs(values ...string) *ExternalIPConfigApplyConfiguration {
	for i := range values {
		b.AutoAssignCIDRs = append(b.AutoAssignCIDRs, values[i])
	}
	return b
}
