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

package v1

import (
	machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1"
	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)

// MachineOSConfigStatusApplyConfiguration represents a declarative configuration of the MachineOSConfigStatus type for use
// with apply.
//
// MachineOSConfigStatus describes the status this config object and relates it to the builds associated with this MachineOSConfig
type MachineOSConfigStatusApplyConfiguration struct {
	// conditions are state related conditions for the object.
	// TODO(jerzhang): add godoc after conditions are finalized. Also consider adding printer columns.
	Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
	// observedGeneration represents the generation of the MachineOSConfig object observed by the Machine Config Operator's build controller.
	ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
	// currentImagePullSpec is the fully qualified image pull spec used by the MCO to pull down the new OSImage. This includes the sha256 image digest.
	// This is generated when the Machine Config Operator's build controller successfully completes the build, and is populated from the corresponding
	// MachineOSBuild object's FinalImagePushSpec. This may change after completion in reaction to spec changes that would cause a new image build,
	// but will not be removed.
	// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
	// where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
	// The length of the whole spec must be between 1 to 447 characters.
	CurrentImagePullSpec *machineconfigurationv1.ImageDigestFormat `json:"currentImagePullSpec,omitempty"`
	// machineOSBuild is a reference to the MachineOSBuild object for this MachineOSConfig, which contains the status for the image build.
	MachineOSBuild *ObjectReferenceApplyConfiguration `json:"machineOSBuild,omitempty"`
}

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

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

// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *MachineOSConfigStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineOSConfigStatusApplyConfiguration {
	b.ObservedGeneration = &value
	return b
}

// WithCurrentImagePullSpec sets the CurrentImagePullSpec 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 CurrentImagePullSpec field is set to the value of the last call.
func (b *MachineOSConfigStatusApplyConfiguration) WithCurrentImagePullSpec(value machineconfigurationv1.ImageDigestFormat) *MachineOSConfigStatusApplyConfiguration {
	b.CurrentImagePullSpec = &value
	return b
}

// WithMachineOSBuild sets the MachineOSBuild 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 MachineOSBuild field is set to the value of the last call.
func (b *MachineOSConfigStatusApplyConfiguration) WithMachineOSBuild(value *ObjectReferenceApplyConfiguration) *MachineOSConfigStatusApplyConfiguration {
	b.MachineOSBuild = value
	return b
}
