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

package v1

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

// ProxyConfigApplyConfiguration represents a declarative configuration of the ProxyConfig type for use
// with apply.
//
// ProxyConfig defines the configuration knobs for kubeproxy
// All of these are optional and have sensible defaults
type ProxyConfigApplyConfiguration struct {
	// An internal kube-proxy parameter. In older releases of OCP, this sometimes needed to be adjusted
	// in large clusters for performance reasons, but this is no longer necessary, and there is no reason
	// to change this from the default value.
	// Default: 30s
	IptablesSyncPeriod *string `json:"iptablesSyncPeriod,omitempty"`
	// The address to "bind" on
	// Defaults to 0.0.0.0
	BindAddress *string `json:"bindAddress,omitempty"`
	// Any additional arguments to pass to the kubeproxy process
	ProxyArguments map[string]operatorv1.ProxyArgumentList `json:"proxyArguments,omitempty"`
}

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

// WithIptablesSyncPeriod sets the IptablesSyncPeriod 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 IptablesSyncPeriod field is set to the value of the last call.
func (b *ProxyConfigApplyConfiguration) WithIptablesSyncPeriod(value string) *ProxyConfigApplyConfiguration {
	b.IptablesSyncPeriod = &value
	return b
}

// WithBindAddress sets the BindAddress 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 BindAddress field is set to the value of the last call.
func (b *ProxyConfigApplyConfiguration) WithBindAddress(value string) *ProxyConfigApplyConfiguration {
	b.BindAddress = &value
	return b
}

// WithProxyArguments puts the entries into the ProxyArguments field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the ProxyArguments field,
// overwriting an existing map entries in ProxyArguments field with the same key.
func (b *ProxyConfigApplyConfiguration) WithProxyArguments(entries map[string]operatorv1.ProxyArgumentList) *ProxyConfigApplyConfiguration {
	if b.ProxyArguments == nil && len(entries) > 0 {
		b.ProxyArguments = make(map[string]operatorv1.ProxyArgumentList, len(entries))
	}
	for k, v := range entries {
		b.ProxyArguments[k] = v
	}
	return b
}
