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

package v1

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

// BuildDefaultsApplyConfiguration represents an declarative configuration of the BuildDefaults type for use
// with apply.
type BuildDefaultsApplyConfiguration struct {
	DefaultProxy *ProxySpecApplyConfiguration   `json:"defaultProxy,omitempty"`
	GitProxy     *ProxySpecApplyConfiguration   `json:"gitProxy,omitempty"`
	Env          []corev1.EnvVar                `json:"env,omitempty"`
	ImageLabels  []ImageLabelApplyConfiguration `json:"imageLabels,omitempty"`
	Resources    *corev1.ResourceRequirements   `json:"resources,omitempty"`
}

// BuildDefaultsApplyConfiguration constructs an 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
}
