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

import (
	schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3"
)

// WorkloadPodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the WorkloadPodGroupSchedulingPolicy type for use
// with apply.
//
// WorkloadPodGroupSchedulingPolicy defines the scheduling policy for a
// group of pods managed by a workload controller.
// Exactly one policy must be set.
//
// ---
//
// This is a reusable building block meant to be embedded in a controller's own
// API, next to its other scheduling fields (for example, in a Job's
// spec.scheduling). It's recommended to block changing the policy
// after creation, while still allowing gang.minCount to change. DV cannot
// express that only gang.minCount is mutable while the basic/gang variant is
// frozen, so the embedder must enforce variant immutability with hand-written
// validation. For example,
//
// type JobSchedulingConfiguration struct {
// // SchedulingPolicy defines the scheduling policy for this Job.
// // Exactly one of Basic or Gang must be set.
// // This field is immutable after creation: the policy may not be added or
// // removed. The policy variant (basic/gang) is frozen by the controller's
// // hand-written validation; only schedulingPolicy.gang.minCount may be changed.
// // +optional
// // +k8s:optional
// // +k8s:update=NoSet
// // +k8s:update=NoUnset
// SchedulingPolicy *schedulingv1alpha3.WorkloadPodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"`
//
// // other scheduling fields
// }
type WorkloadPodGroupSchedulingPolicyApplyConfiguration struct {
	// basic specifies that standard, pod-by-pod Kubernetes scheduling
	// behavior should be used.
	Basic *schedulingv1alpha3.WorkloadPodGroupBasicSchedulingPolicy `json:"basic,omitempty"`
	// gang specifies all-or-nothing scheduling semantics.
	Gang *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"`
}

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

// WithBasic sets the Basic 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 Basic field is set to the value of the last call.
func (b *WorkloadPodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha3.WorkloadPodGroupBasicSchedulingPolicy) *WorkloadPodGroupSchedulingPolicyApplyConfiguration {
	b.Basic = &value
	return b
}

// WithGang sets the Gang 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 Gang field is set to the value of the last call.
func (b *WorkloadPodGroupSchedulingPolicyApplyConfiguration) WithGang(value *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration) *WorkloadPodGroupSchedulingPolicyApplyConfiguration {
	b.Gang = value
	return b
}
