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

package v1beta1

import (
	machinev1beta1 "github.com/openshift/api/machine/v1beta1"
)

// MachineSetStatusApplyConfiguration represents a declarative configuration of the MachineSetStatus type for use
// with apply.
//
// MachineSetStatus defines the observed state of MachineSet
type MachineSetStatusApplyConfiguration struct {
	// replicas is the most recently observed number of replicas.
	Replicas *int32 `json:"replicas,omitempty"`
	// The number of replicas that have labels matching the labels of the machine template of the MachineSet.
	FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"`
	// The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready".
	ReadyReplicas *int32 `json:"readyReplicas,omitempty"`
	// The number of available replicas (ready for at least minReadySeconds) for this MachineSet.
	AvailableReplicas *int32 `json:"availableReplicas,omitempty"`
	// observedGeneration reflects the generation of the most recently observed MachineSet.
	ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
	// labelSelector is a label selector, in string format, for Machines corresponding to the MachineSet.
	// It is exposed via the scale subresource as status.selector.
	// When omitted, the MachineSet controller has not yet reconciled spec.selector into status.labelSelector.
	// When present, it must not be empty and must not exceed 4096 characters.
	LabelSelector *string `json:"labelSelector,omitempty"`
	// In the event that there is a terminal problem reconciling the
	// replicas, both ErrorReason and ErrorMessage will be set. ErrorReason
	// will be populated with a succinct value suitable for machine
	// interpretation, while ErrorMessage will contain a more verbose
	// string suitable for logging and human consumption.
	//
	// These fields should not be set for transitive errors that a
	// controller faces that are expected to be fixed automatically over
	// time (like service outages), but instead indicate that something is
	// fundamentally wrong with the MachineTemplate's spec or the configuration of
	// the machine controller, and that manual intervention is required. Examples
	// of terminal errors would be invalid combinations of settings in the
	// spec, values that are unsupported by the machine controller, or the
	// responsible machine controller itself being critically misconfigured.
	//
	// Any transient errors that occur during the reconciliation of Machines
	// can be added as events to the MachineSet object and/or logged in the
	// controller's output.
	ErrorReason  *machinev1beta1.MachineSetStatusError `json:"errorReason,omitempty"`
	ErrorMessage *string                               `json:"errorMessage,omitempty"`
	// conditions defines the current state of the MachineSet
	Conditions []ConditionApplyConfiguration `json:"conditions,omitempty"`
	// authoritativeAPI is the API that is authoritative for this resource.
	// Valid values are MachineAPI, ClusterAPI and Migrating.
	// This value is updated by the migration controller to reflect the authoritative API.
	// Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource.
	// When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.
	AuthoritativeAPI *machinev1beta1.MachineAuthority `json:"authoritativeAPI,omitempty"`
	// synchronizedAPI holds the last stable value of authoritativeAPI.
	// It is used to detect migration cancellation requests and to restore the resource to its previous state.
	// Valid values are "MachineAPI" and "ClusterAPI".
	// When omitted, the resource has not yet been reconciled by the migration controller.
	SynchronizedAPI *machinev1beta1.SynchronizedAPI `json:"synchronizedAPI,omitempty"`
	// synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with.
	// This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.
	SynchronizedGeneration *int64 `json:"synchronizedGeneration,omitempty"`
}

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

// WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithReplicas(value int32) *MachineSetStatusApplyConfiguration {
	b.Replicas = &value
	return b
}

// WithFullyLabeledReplicas sets the FullyLabeledReplicas 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 FullyLabeledReplicas field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *MachineSetStatusApplyConfiguration {
	b.FullyLabeledReplicas = &value
	return b
}

// WithReadyReplicas sets the ReadyReplicas 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 ReadyReplicas field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineSetStatusApplyConfiguration {
	b.ReadyReplicas = &value
	return b
}

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

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

// WithErrorReason sets the ErrorReason 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 ErrorReason field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithErrorReason(value machinev1beta1.MachineSetStatusError) *MachineSetStatusApplyConfiguration {
	b.ErrorReason = &value
	return b
}

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

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

// WithAuthoritativeAPI sets the AuthoritativeAPI 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 AuthoritativeAPI field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithAuthoritativeAPI(value machinev1beta1.MachineAuthority) *MachineSetStatusApplyConfiguration {
	b.AuthoritativeAPI = &value
	return b
}

// WithSynchronizedAPI sets the SynchronizedAPI 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 SynchronizedAPI field is set to the value of the last call.
func (b *MachineSetStatusApplyConfiguration) WithSynchronizedAPI(value machinev1beta1.SynchronizedAPI) *MachineSetStatusApplyConfiguration {
	b.SynchronizedAPI = &value
	return b
}

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