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

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
)

// NetworkSpecApplyConfiguration represents a declarative configuration of the NetworkSpec type for use
// with apply.
type NetworkSpecApplyConfiguration struct {
	OperatorSpecApplyConfiguration `json:",inline"`
	ClusterNetwork                 []ClusterNetworkEntryApplyConfiguration          `json:"clusterNetwork,omitempty"`
	ServiceNetwork                 []string                                         `json:"serviceNetwork,omitempty"`
	DefaultNetwork                 *DefaultNetworkDefinitionApplyConfiguration      `json:"defaultNetwork,omitempty"`
	AdditionalNetworks             []AdditionalNetworkDefinitionApplyConfiguration  `json:"additionalNetworks,omitempty"`
	DisableMultiNetwork            *bool                                            `json:"disableMultiNetwork,omitempty"`
	UseMultiNetworkPolicy          *bool                                            `json:"useMultiNetworkPolicy,omitempty"`
	DeployKubeProxy                *bool                                            `json:"deployKubeProxy,omitempty"`
	DisableNetworkDiagnostics      *bool                                            `json:"disableNetworkDiagnostics,omitempty"`
	KubeProxyConfig                *ProxyConfigApplyConfiguration                   `json:"kubeProxyConfig,omitempty"`
	ExportNetworkFlows             *ExportNetworkFlowsApplyConfiguration            `json:"exportNetworkFlows,omitempty"`
	Migration                      *NetworkMigrationApplyConfiguration              `json:"migration,omitempty"`
	AdditionalRoutingCapabilities  *AdditionalRoutingCapabilitiesApplyConfiguration `json:"additionalRoutingCapabilities,omitempty"`
}

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

// WithManagementState sets the ManagementState 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 ManagementState field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *NetworkSpecApplyConfiguration {
	b.OperatorSpecApplyConfiguration.ManagementState = &value
	return b
}

// WithLogLevel sets the LogLevel 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 LogLevel field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *NetworkSpecApplyConfiguration {
	b.OperatorSpecApplyConfiguration.LogLevel = &value
	return b
}

// WithOperatorLogLevel sets the OperatorLogLevel 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 OperatorLogLevel field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *NetworkSpecApplyConfiguration {
	b.OperatorSpecApplyConfiguration.OperatorLogLevel = &value
	return b
}

// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides 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 UnsupportedConfigOverrides field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *NetworkSpecApplyConfiguration {
	b.OperatorSpecApplyConfiguration.UnsupportedConfigOverrides = &value
	return b
}

// WithObservedConfig sets the ObservedConfig 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 ObservedConfig field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *NetworkSpecApplyConfiguration {
	b.OperatorSpecApplyConfiguration.ObservedConfig = &value
	return b
}

// WithClusterNetwork adds the given value to the ClusterNetwork 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 ClusterNetwork field.
func (b *NetworkSpecApplyConfiguration) WithClusterNetwork(values ...*ClusterNetworkEntryApplyConfiguration) *NetworkSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithClusterNetwork")
		}
		b.ClusterNetwork = append(b.ClusterNetwork, *values[i])
	}
	return b
}

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

// WithDefaultNetwork sets the DefaultNetwork 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 DefaultNetwork field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithDefaultNetwork(value *DefaultNetworkDefinitionApplyConfiguration) *NetworkSpecApplyConfiguration {
	b.DefaultNetwork = value
	return b
}

// WithAdditionalNetworks adds the given value to the AdditionalNetworks 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 AdditionalNetworks field.
func (b *NetworkSpecApplyConfiguration) WithAdditionalNetworks(values ...*AdditionalNetworkDefinitionApplyConfiguration) *NetworkSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithAdditionalNetworks")
		}
		b.AdditionalNetworks = append(b.AdditionalNetworks, *values[i])
	}
	return b
}

// WithDisableMultiNetwork sets the DisableMultiNetwork 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 DisableMultiNetwork field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithDisableMultiNetwork(value bool) *NetworkSpecApplyConfiguration {
	b.DisableMultiNetwork = &value
	return b
}

// WithUseMultiNetworkPolicy sets the UseMultiNetworkPolicy 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 UseMultiNetworkPolicy field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithUseMultiNetworkPolicy(value bool) *NetworkSpecApplyConfiguration {
	b.UseMultiNetworkPolicy = &value
	return b
}

// WithDeployKubeProxy sets the DeployKubeProxy 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 DeployKubeProxy field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithDeployKubeProxy(value bool) *NetworkSpecApplyConfiguration {
	b.DeployKubeProxy = &value
	return b
}

// WithDisableNetworkDiagnostics sets the DisableNetworkDiagnostics 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 DisableNetworkDiagnostics field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithDisableNetworkDiagnostics(value bool) *NetworkSpecApplyConfiguration {
	b.DisableNetworkDiagnostics = &value
	return b
}

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

// WithExportNetworkFlows sets the ExportNetworkFlows 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 ExportNetworkFlows field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithExportNetworkFlows(value *ExportNetworkFlowsApplyConfiguration) *NetworkSpecApplyConfiguration {
	b.ExportNetworkFlows = value
	return b
}

// WithMigration sets the Migration 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 Migration field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithMigration(value *NetworkMigrationApplyConfiguration) *NetworkSpecApplyConfiguration {
	b.Migration = value
	return b
}

// WithAdditionalRoutingCapabilities sets the AdditionalRoutingCapabilities 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 AdditionalRoutingCapabilities field is set to the value of the last call.
func (b *NetworkSpecApplyConfiguration) WithAdditionalRoutingCapabilities(value *AdditionalRoutingCapabilitiesApplyConfiguration) *NetworkSpecApplyConfiguration {
	b.AdditionalRoutingCapabilities = value
	return b
}
