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

// WorkloadPodGroupDisruptionModeApplyConfiguration represents a declarative configuration of the WorkloadPodGroupDisruptionMode type for use
// with apply.
//
// WorkloadPodGroupDisruptionMode defines how individual pods within a
// group can be disrupted. Exactly one mode 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 freeze the field after creation
// (+k8s:immutable), since the selected mode is immutable in the compiled
// Workload. For example,
//
// type JobSchedulingConfiguration struct {
// // DisruptionMode defines the mode in which the Job's pods can be disrupted.
// // One of Single, All.
// // This field is immutable after creation: it may not be added or removed,
// // and the selected mode may not be changed.
// // +optional
// // +k8s:optional
// // +k8s:immutable
// DisruptionMode *schedulingv1alpha3.WorkloadPodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"`
//
// // other scheduling fields
// }
type WorkloadPodGroupDisruptionModeApplyConfiguration struct {
	// single specifies that pods can be disrupted independently from each other.
	Single *schedulingv1alpha3.WorkloadPodGroupSingleDisruptionMode `json:"single,omitempty"`
	// all specifies that all pods in the group must be disrupted together.
	All *schedulingv1alpha3.WorkloadPodGroupAllDisruptionMode `json:"all,omitempty"`
}

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

// WithSingle sets the Single 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 Single field is set to the value of the last call.
func (b *WorkloadPodGroupDisruptionModeApplyConfiguration) WithSingle(value schedulingv1alpha3.WorkloadPodGroupSingleDisruptionMode) *WorkloadPodGroupDisruptionModeApplyConfiguration {
	b.Single = &value
	return b
}

// WithAll sets the All 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 All field is set to the value of the last call.
func (b *WorkloadPodGroupDisruptionModeApplyConfiguration) WithAll(value schedulingv1alpha3.WorkloadPodGroupAllDisruptionMode) *WorkloadPodGroupDisruptionModeApplyConfiguration {
	b.All = &value
	return b
}
