/*
Copyright The Kubernetes 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 v1alpha3

// WorkloadPodGroupResourceClaimApplyConfiguration represents a declarative configuration of the WorkloadPodGroupResourceClaim type for use
// with apply.
//
// WorkloadPodGroupResourceClaim references a dynamic resource claim
// that is shared across pods in the group.
//
// ---
//
// This is a reusable building block meant to be embedded in a controller's own
// API as a list, next to its other scheduling fields (for example, in a Job's
// spec.scheduling). It's recommended to freeze the whole list after creation
// (+k8s:immutable), since the list is immutable in the compiled Workload. For
// example,
//
// type JobSchedulingConfiguration struct {
// // ResourceClaims lists the ResourceClaims shared among the group's pods.
// // At most 4 claims may be set, matching the limit on the resulting PodGroup.
// // This list is immutable after creation: entries may neither be added,
// // removed, nor modified.
// // +optional
// // +patchMergeKey=name
// // +patchStrategy=merge
// // +listType=map
// // +listMapKey=name
// // +k8s:optional
// // +k8s:listType=map
// // +k8s:listMapKey=name
// // +k8s:maxItems=4
// // +k8s:immutable
// ResourceClaims []schedulingv1alpha3.WorkloadPodGroupResourceClaim `json:"resourceClaims,omitempty" protobuf:"bytes,N,rep,name=resourceClaims"`
//
// // other scheduling fields
// }
type WorkloadPodGroupResourceClaimApplyConfiguration struct {
	// name uniquely identifies this resource claim inside the group.
	// This field is required. It must be a DNS_LABEL.
	Name *string `json:"name,omitempty"`
	// resourceClaimName is the name of a ResourceClaim object in the same
	// namespace.
	// This field is optional. If it is not specified, no resource claim
	// is used. If set, it must be a DNS subdomain.
	ResourceClaimName *string `json:"resourceClaimName,omitempty"`
	// resourceClaimTemplateName is the name of a ResourceClaimTemplate
	// object in the same namespace.
	// This field is optional. If it is not specified, no resource claim
	// template is used. If set, it must be a DNS subdomain.
	ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"`
}

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

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

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

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