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

import (
	lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1"
)

// EvictionRequestSpecApplyConfiguration represents a declarative configuration of the EvictionRequestSpec type for use
// with apply.
//
// EvictionRequestSpec is a specification of an EvictionRequest.
type EvictionRequestSpecApplyConfiguration struct {
	// target contains a reference to an object (e.g. a pod) that should be evicted.
	// This field is required and immutable.
	Target *EvictionRequestTargetApplyConfiguration `json:"target,omitempty"`
	// requester allows you to identify the entity, that requested the eviction of the target.
	//
	// It must be a valid domain-prefixed key (such as "acme.io/foo").
	// Domain names *.k8s.io and *.kubernetes.io are reserved.
	// This field is required and immutable.
	Requester *string `json:"requester,omitempty"`
	// intent specifies the action that should be taken for the specified target.
	//
	// - Eviction means that the requester is interested in the eviction of the target.
	// - Withdrawn means that the requester is no longer interested in the eviction of the target.
	// If all requesters' intents are withdrawn for a common target, the eviction will be canceled.
	// Cancellation consequences:
	// - Inactive responders will never run.
	// - Active responders are expected to cancel the eviction.
	// - Completed or Interrupted responders should not take any action.
	Intent *lifecyclev1alpha1.EvictionRequestIntent `json:"intent,omitempty"`
}

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

// WithTarget sets the Target 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 Target field is set to the value of the last call.
func (b *EvictionRequestSpecApplyConfiguration) WithTarget(value *EvictionRequestTargetApplyConfiguration) *EvictionRequestSpecApplyConfiguration {
	b.Target = value
	return b
}

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

// WithIntent sets the Intent 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 Intent field is set to the value of the last call.
func (b *EvictionRequestSpecApplyConfiguration) WithIntent(value lifecyclev1alpha1.EvictionRequestIntent) *EvictionRequestSpecApplyConfiguration {
	b.Intent = &value
	return b
}
