/*
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"
	types "k8s.io/apimachinery/pkg/types"
)

// ClusterRegistrationRequestSpecApplyConfiguration represents a declarative configuration of the ClusterRegistrationRequestSpec type for use
// with apply.
type ClusterRegistrationRequestSpecApplyConfiguration struct {
	ClusterID        *types.UID                       `json:"clusterId,omitempty"`
	ClusterType      *clustersv1beta1.ClusterType     `json:"clusterType,omitempty"`
	ClusterName      *string                          `json:"clusterName,omitempty"`
	ClusterNamespace *string                          `json:"clusterNamespace,omitempty"`
	ClusterLabels    map[string]string                `json:"clusterLabels,omitempty"`
	SyncMode         *clustersv1beta1.ClusterSyncMode `json:"syncMode,omitempty"`
}

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

// 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 *ClusterRegistrationRequestSpecApplyConfiguration) WithClusterID(value types.UID) *ClusterRegistrationRequestSpecApplyConfiguration {
	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 *ClusterRegistrationRequestSpecApplyConfiguration) WithClusterType(value clustersv1beta1.ClusterType) *ClusterRegistrationRequestSpecApplyConfiguration {
	b.ClusterType = &value
	return b
}

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

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

// WithClusterLabels puts the entries into the ClusterLabels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the ClusterLabels field,
// overwriting an existing map entries in ClusterLabels field with the same key.
func (b *ClusterRegistrationRequestSpecApplyConfiguration) WithClusterLabels(entries map[string]string) *ClusterRegistrationRequestSpecApplyConfiguration {
	if b.ClusterLabels == nil && len(entries) > 0 {
		b.ClusterLabels = make(map[string]string, len(entries))
	}
	for k, v := range entries {
		b.ClusterLabels[k] = v
	}
	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 *ClusterRegistrationRequestSpecApplyConfiguration) WithSyncMode(value clustersv1beta1.ClusterSyncMode) *ClusterRegistrationRequestSpecApplyConfiguration {
	b.SyncMode = &value
	return b
}
