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

package v1

// BuildVolumeApplyConfiguration represents a declarative configuration of the BuildVolume type for use
// with apply.
//
// BuildVolume describes a volume that is made available to build pods,
// such that it can be mounted into buildah's runtime environment.
// Only a subset of Kubernetes Volume sources are supported.
type BuildVolumeApplyConfiguration struct {
	// name is a unique identifier for this BuildVolume.
	// It must conform to the Kubernetes DNS label standard and be unique within the pod.
	// Names that collide with those added by the build controller will result in a
	// failed build with an error message detailing which name caused the error.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	Name *string `json:"name,omitempty"`
	// source represents the location and type of the mounted volume.
	Source *BuildVolumeSourceApplyConfiguration `json:"source,omitempty"`
	// mounts represents the location of the volume in the image build container
	Mounts []BuildVolumeMountApplyConfiguration `json:"mounts,omitempty"`
}

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

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

// WithSource sets the Source 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 Source field is set to the value of the last call.
func (b *BuildVolumeApplyConfiguration) WithSource(value *BuildVolumeSourceApplyConfiguration) *BuildVolumeApplyConfiguration {
	b.Source = value
	return b
}

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