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

package v1alpha1

import (
	operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1"
)

// ClusterAPIStatusApplyConfiguration represents a declarative configuration of the ClusterAPIStatus type for use
// with apply.
//
// ClusterAPIStatus describes the current state of the capi-operator.
type ClusterAPIStatusApplyConfiguration struct {
	// currentRevision is the name of the most recently fully applied revision.
	// It is written by the installer controller. If it is absent, it indicates
	// that no revision has been fully applied yet.
	// If set, currentRevision must correspond to an entry in the revisions list.
	CurrentRevision *operatorv1alpha1.RevisionName `json:"currentRevision,omitempty"`
	// desiredRevision is the name of the desired revision. It is written by the
	// revision controller. It must be set to the name of the entry in the
	// revisions list with the highest revision number.
	DesiredRevision *operatorv1alpha1.RevisionName `json:"desiredRevision,omitempty"`
	// revisions is a list of all currently active revisions. A revision is
	// active until the installer controller updates currentRevision to a later
	// revision. It is written by the revision controller.
	//
	// The maximum number of revisions is 16.
	// All revisions must have a unique name.
	// All revisions must have a unique revision number.
	// When adding a revision, the revision number must be greater than the highest revision number in the list.
	// Revisions are immutable, although they can be deleted.
	Revisions []ClusterAPIInstallerRevisionApplyConfiguration `json:"revisions,omitempty"`
	// observedRevisionGeneration is the generation of the ClusterAPI object that was last observed by the revision controller.
	// If specified it must be greater than or equal to 1, and less than 2^53. It may not decrease or be unset once set.
	ObservedRevisionGeneration *int64 `json:"observedRevisionGeneration,omitempty"`
}

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

// WithCurrentRevision sets the CurrentRevision 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 CurrentRevision field is set to the value of the last call.
func (b *ClusterAPIStatusApplyConfiguration) WithCurrentRevision(value operatorv1alpha1.RevisionName) *ClusterAPIStatusApplyConfiguration {
	b.CurrentRevision = &value
	return b
}

// WithDesiredRevision sets the DesiredRevision 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 DesiredRevision field is set to the value of the last call.
func (b *ClusterAPIStatusApplyConfiguration) WithDesiredRevision(value operatorv1alpha1.RevisionName) *ClusterAPIStatusApplyConfiguration {
	b.DesiredRevision = &value
	return b
}

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

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