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

package v1

import (
	corev1 "k8s.io/api/core/v1"
)

// BuildDefaultsApplyConfiguration represents a declarative configuration of the BuildDefaults type for use
// with apply.
type BuildDefaultsApplyConfiguration struct {
	// defaultProxy contains the default proxy settings for all build operations, including image pull/push
	// and source download.
	//
	// Values can be overrode by setting the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables
	// in the build config's strategy.
	DefaultProxy *ProxySpecApplyConfiguration `json:"defaultProxy,omitempty"`
	// gitProxy contains the proxy settings for git operations only. If set, this will override
	// any Proxy settings for all git commands, such as git clone.
	//
	// Values that are not set here will be inherited from DefaultProxy.
	GitProxy *ProxySpecApplyConfiguration `json:"gitProxy,omitempty"`
	// env is a set of default environment variables that will be applied to the
	// build if the specified variables do not exist on the build
	Env []corev1.EnvVar `json:"env,omitempty"`
	// imageLabels is a list of docker labels that are applied to the resulting image.
	// User can override a default label by providing a label with the same name in their
	// Build/BuildConfig.
	ImageLabels []ImageLabelApplyConfiguration `json:"imageLabels,omitempty"`
	// resources defines resource requirements to execute the build.
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}

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

// WithDefaultProxy sets the DefaultProxy 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 DefaultProxy field is set to the value of the last call.
func (b *BuildDefaultsApplyConfiguration) WithDefaultProxy(value *ProxySpecApplyConfiguration) *BuildDefaultsApplyConfiguration {
	b.DefaultProxy = value
	return b
}

// WithGitProxy sets the GitProxy 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 GitProxy field is set to the value of the last call.
func (b *BuildDefaultsApplyConfiguration) WithGitProxy(value *ProxySpecApplyConfiguration) *BuildDefaultsApplyConfiguration {
	b.GitProxy = value
	return b
}

// WithEnv adds the given value to the Env 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 Env field.
func (b *BuildDefaultsApplyConfiguration) WithEnv(values ...corev1.EnvVar) *BuildDefaultsApplyConfiguration {
	for i := range values {
		b.Env = append(b.Env, values[i])
	}
	return b
}

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

// WithResources sets the Resources 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 Resources field is set to the value of the last call.
func (b *BuildDefaultsApplyConfiguration) WithResources(value corev1.ResourceRequirements) *BuildDefaultsApplyConfiguration {
	b.Resources = &value
	return b
}
