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

package v1alpha1

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

// ClusterAPIInstallerRevisionApplyConfiguration represents a declarative configuration of the ClusterAPIInstallerRevision type for use
// with apply.
type ClusterAPIInstallerRevisionApplyConfiguration struct {
	// name is the name of a revision.
	Name *operatorv1alpha1.RevisionName `json:"name,omitempty"`
	// revision is a monotonically increasing number that is assigned to a revision.
	Revision *int64 `json:"revision,omitempty"`
	// contentID uniquely identifies the content of this revision.
	// The contentID must be between 1 and 255 characters long.
	ContentID *string `json:"contentID,omitempty"`
	// unmanagedCustomResourceDefinitions is a list of the names of
	// ClusterResourceDefinition (CRD) objects which are included in this
	// revision, but which should not be installed or updated. If not set, all
	// CRDs in the revision will be managed by the CAPI operator.
	UnmanagedCustomResourceDefinitions []string `json:"unmanagedCustomResourceDefinitions,omitempty"`
	// manifestSubstitutions is a list of envsubst style substitutions which
	// will be applied to manifests in the revision during rendering. If
	// defined it must not be empty, and may not contain more than 32 items.
	// Each manifest substitution must have a unique key.
	ManifestSubstitutions []ClusterAPIInstallerRevisionManifestSubstitutionApplyConfiguration `json:"manifestSubstitutions,omitempty"`
	// components is a list of components which will be installed by this
	// revision. Components will be installed in the order they are listed. If
	// omitted no components will be installed.
	//
	// The maximum number of components is 32.
	Components []ClusterAPIInstallerComponentApplyConfiguration `json:"components,omitempty"`
}

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

// 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 *ClusterAPIInstallerRevisionApplyConfiguration) WithName(value operatorv1alpha1.RevisionName) *ClusterAPIInstallerRevisionApplyConfiguration {
	b.Name = &value
	return b
}

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

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

// WithUnmanagedCustomResourceDefinitions adds the given value to the UnmanagedCustomResourceDefinitions 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 UnmanagedCustomResourceDefinitions field.
func (b *ClusterAPIInstallerRevisionApplyConfiguration) WithUnmanagedCustomResourceDefinitions(values ...string) *ClusterAPIInstallerRevisionApplyConfiguration {
	for i := range values {
		b.UnmanagedCustomResourceDefinitions = append(b.UnmanagedCustomResourceDefinitions, values[i])
	}
	return b
}

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

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