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

package v1

import (
	configv1 "github.com/openshift/api/config/v1"
)

// ClusterVersionSpecApplyConfiguration represents a declarative configuration of the ClusterVersionSpec type for use
// with apply.
type ClusterVersionSpecApplyConfiguration struct {
	ClusterID       *configv1.ClusterID                               `json:"clusterID,omitempty"`
	DesiredUpdate   *UpdateApplyConfiguration                         `json:"desiredUpdate,omitempty"`
	Upstream        *configv1.URL                                     `json:"upstream,omitempty"`
	Channel         *string                                           `json:"channel,omitempty"`
	Capabilities    *ClusterVersionCapabilitiesSpecApplyConfiguration `json:"capabilities,omitempty"`
	SignatureStores []SignatureStoreApplyConfiguration                `json:"signatureStores,omitempty"`
	Overrides       []ComponentOverrideApplyConfiguration             `json:"overrides,omitempty"`
}

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

// WithClusterID sets the ClusterID 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 ClusterID field is set to the value of the last call.
func (b *ClusterVersionSpecApplyConfiguration) WithClusterID(value configv1.ClusterID) *ClusterVersionSpecApplyConfiguration {
	b.ClusterID = &value
	return b
}

// WithDesiredUpdate sets the DesiredUpdate 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 DesiredUpdate field is set to the value of the last call.
func (b *ClusterVersionSpecApplyConfiguration) WithDesiredUpdate(value *UpdateApplyConfiguration) *ClusterVersionSpecApplyConfiguration {
	b.DesiredUpdate = value
	return b
}

// WithUpstream sets the Upstream 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 Upstream field is set to the value of the last call.
func (b *ClusterVersionSpecApplyConfiguration) WithUpstream(value configv1.URL) *ClusterVersionSpecApplyConfiguration {
	b.Upstream = &value
	return b
}

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

// WithCapabilities sets the Capabilities 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 Capabilities field is set to the value of the last call.
func (b *ClusterVersionSpecApplyConfiguration) WithCapabilities(value *ClusterVersionCapabilitiesSpecApplyConfiguration) *ClusterVersionSpecApplyConfiguration {
	b.Capabilities = value
	return b
}

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

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