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

package v1

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

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

// ClusterVersionSpecApplyConfiguration constructs an 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 v1.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 v1.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
}

// 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
}
