/*
Copyright The Volcano 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 v1alpha1

// DataSourceClaimSpecApplyConfiguration represents a declarative configuration of the DataSourceClaimSpec type for use
// with apply.
//
// DataSourceClaimSpec defines the desired state of DataSourceClaim.
type DataSourceClaimSpecApplyConfiguration struct {
	// System is the required underlying data system of the data source.
	System *string `json:"system,omitempty"`
	// DataSourceType is the required category of the data source within the system.
	DataSourceType *string `json:"dataSourceType,omitempty"`
	// DataSourceName specifies the logical name of the cached data source to claim.
	// It will be matched against DataSource's spec.name field.
	DataSourceName *string `json:"dataSourceName,omitempty"`
	// Workload specifies the workload that this claim is associated with.
	// This enables the controller to precisely identify and manage the workload
	// using Dynamic Client without requiring complex selectors or UIDs.
	Workload *WorkloadRefApplyConfiguration `json:"workload,omitempty"`
	// Attributes provides extra, non-identifying metadata.
	Attributes map[string]string `json:"attributes,omitempty"`
}

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

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

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

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

// WithWorkload sets the Workload 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 Workload field is set to the value of the last call.
func (b *DataSourceClaimSpecApplyConfiguration) WithWorkload(value *WorkloadRefApplyConfiguration) *DataSourceClaimSpecApplyConfiguration {
	b.Workload = value
	return b
}

// WithAttributes puts the entries into the Attributes 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 Attributes field,
// overwriting an existing map entries in Attributes field with the same key.
func (b *DataSourceClaimSpecApplyConfiguration) WithAttributes(entries map[string]string) *DataSourceClaimSpecApplyConfiguration {
	if b.Attributes == nil && len(entries) > 0 {
		b.Attributes = make(map[string]string, len(entries))
	}
	for k, v := range entries {
		b.Attributes[k] = v
	}
	return b
}
