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

// EvictionResponderApplyConfiguration represents a declarative configuration of the EvictionResponder type for use
// with apply.
//
// EvictionResponder allows you to specify the responder reacting to an Eviction.
// Responders should observe and communicate through the Eviction Resource API to help with
// the graceful eviction of a target (e.g. termination of a pod).
type EvictionResponderApplyConfiguration struct {
	// name allows you to identify the responder responding to the Eviction.
	//
	// It must be a valid domain-prefixed key (such as "acme.io/foo").
	// Domain names *.k8s.io and *.kubernetes.io are reserved.
	// This field must be unique for each responder.
	// This field is required.
	Name *string `json:"name,omitempty"`
	// priority for this responder. Higher priorities are selected first by the evictionrequest-controller.
	// If there are responders with the same priority, the responder whose domain name comes first in the
	// alphabetical higher domain order, will be picked. This means that the top domain labels are compared
	// alphabetically first, followed by the lower domain labels. The key is compared last.
	//
	// The responder that is the managing controller of the pod should set the value of
	// this field to 10000 to allow both for preemption or fallback registration by other
	// responders.
	//
	// The minimum value is 0 and the maximum value is 100000.
	// The interval 0-999 is reserved for responders with *.k8s.io suffix.
	// This field is required.
	Priority *int32 `json:"priority,omitempty"`
}

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

// 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 *EvictionResponderApplyConfiguration) WithName(value string) *EvictionResponderApplyConfiguration {
	b.Name = &value
	return b
}

// WithPriority sets the Priority 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 Priority field is set to the value of the last call.
func (b *EvictionResponderApplyConfiguration) WithPriority(value int32) *EvictionResponderApplyConfiguration {
	b.Priority = &value
	return b
}
