// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

import (
	rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
	v1 "k8s.io/api/core/v1"
)

// AutoscalerOptionsApplyConfiguration represents an declarative configuration of the AutoscalerOptions type for use
// with apply.
type AutoscalerOptionsApplyConfiguration struct {
	Resources          *v1.ResourceRequirements `json:"resources,omitempty"`
	Image              *string                  `json:"image,omitempty"`
	ImagePullPolicy    *v1.PullPolicy           `json:"imagePullPolicy,omitempty"`
	Env                []v1.EnvVar              `json:"env,omitempty"`
	EnvFrom            []v1.EnvFromSource       `json:"envFrom,omitempty"`
	VolumeMounts       []v1.VolumeMount         `json:"volumeMounts,omitempty"`
	SecurityContext    *v1.SecurityContext      `json:"securityContext,omitempty"`
	IdleTimeoutSeconds *int32                   `json:"idleTimeoutSeconds,omitempty"`
	UpscalingMode      *rayv1.UpscalingMode     `json:"upscalingMode,omitempty"`
}

// AutoscalerOptionsApplyConfiguration constructs an declarative configuration of the AutoscalerOptions type for use with
// apply.
func AutoscalerOptions() *AutoscalerOptionsApplyConfiguration {
	return &AutoscalerOptionsApplyConfiguration{}
}

// WithResources sets the Resources 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 Resources field is set to the value of the last call.
func (b *AutoscalerOptionsApplyConfiguration) WithResources(value v1.ResourceRequirements) *AutoscalerOptionsApplyConfiguration {
	b.Resources = &value
	return b
}

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

// WithImagePullPolicy sets the ImagePullPolicy 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 ImagePullPolicy field is set to the value of the last call.
func (b *AutoscalerOptionsApplyConfiguration) WithImagePullPolicy(value v1.PullPolicy) *AutoscalerOptionsApplyConfiguration {
	b.ImagePullPolicy = &value
	return b
}

// WithEnv adds the given value to the Env field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Env field.
func (b *AutoscalerOptionsApplyConfiguration) WithEnv(values ...v1.EnvVar) *AutoscalerOptionsApplyConfiguration {
	for i := range values {
		b.Env = append(b.Env, values[i])
	}
	return b
}

// WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the EnvFrom field.
func (b *AutoscalerOptionsApplyConfiguration) WithEnvFrom(values ...v1.EnvFromSource) *AutoscalerOptionsApplyConfiguration {
	for i := range values {
		b.EnvFrom = append(b.EnvFrom, values[i])
	}
	return b
}

// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the VolumeMounts field.
func (b *AutoscalerOptionsApplyConfiguration) WithVolumeMounts(values ...v1.VolumeMount) *AutoscalerOptionsApplyConfiguration {
	for i := range values {
		b.VolumeMounts = append(b.VolumeMounts, values[i])
	}
	return b
}

// WithSecurityContext sets the SecurityContext 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 SecurityContext field is set to the value of the last call.
func (b *AutoscalerOptionsApplyConfiguration) WithSecurityContext(value v1.SecurityContext) *AutoscalerOptionsApplyConfiguration {
	b.SecurityContext = &value
	return b
}

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

// WithUpscalingMode sets the UpscalingMode 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 UpscalingMode field is set to the value of the last call.
func (b *AutoscalerOptionsApplyConfiguration) WithUpscalingMode(value rayv1.UpscalingMode) *AutoscalerOptionsApplyConfiguration {
	b.UpscalingMode = &value
	return b
}
