/*
Copyright The Clusternet Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1beta1

import (
	clustersv1beta1 "github.com/clusternet/clusternet/pkg/apis/clusters/v1beta1"
	v1 "k8s.io/api/core/v1"
	types "k8s.io/apimachinery/pkg/types"
)

// ManagedClusterSpecApplyConfiguration represents a declarative configuration of the ManagedClusterSpec type for use
// with apply.
type ManagedClusterSpecApplyConfiguration struct {
	ClusterID           *types.UID                       `json:"clusterId,omitempty"`
	ClusterType         *clustersv1beta1.ClusterType     `json:"clusterType,omitempty"`
	ClusterInitBaseName *string                          `json:"clusterInitBaseName,omitempty"`
	SyncMode            *clustersv1beta1.ClusterSyncMode `json:"syncMode,omitempty"`
	Taints              []v1.Taint                       `json:"taints,omitempty"`
}

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

// 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 *ManagedClusterSpecApplyConfiguration) WithClusterID(value types.UID) *ManagedClusterSpecApplyConfiguration {
	b.ClusterID = &value
	return b
}

// WithClusterType sets the ClusterType 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 ClusterType field is set to the value of the last call.
func (b *ManagedClusterSpecApplyConfiguration) WithClusterType(value clustersv1beta1.ClusterType) *ManagedClusterSpecApplyConfiguration {
	b.ClusterType = &value
	return b
}

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

// WithSyncMode sets the SyncMode 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 SyncMode field is set to the value of the last call.
func (b *ManagedClusterSpecApplyConfiguration) WithSyncMode(value clustersv1beta1.ClusterSyncMode) *ManagedClusterSpecApplyConfiguration {
	b.SyncMode = &value
	return b
}

// WithTaints adds the given value to the Taints 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 Taints field.
func (b *ManagedClusterSpecApplyConfiguration) WithTaints(values ...v1.Taint) *ManagedClusterSpecApplyConfiguration {
	for i := range values {
		b.Taints = append(b.Taints, values[i])
	}
	return b
}
