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

package v1alpha1

import (
	configv1alpha1 "github.com/openshift/api/config/v1alpha1"
)

// QueueConfigApplyConfiguration represents a declarative configuration of the QueueConfig type for use
// with apply.
//
// QueueConfig allows tuning configuration for remote write queue parameters.
// Configure this when you need to control throughput, backpressure, or retry behavior—for example to avoid overloading the remote endpoint, to reduce memory usage, or to tune for high-cardinality workloads. Consider capacity, maxShards, and batchSendDeadlineSeconds for throughput; minBackoffMilliseconds and maxBackoffMilliseconds for retries; and rateLimitedAction when the remote returns HTTP 429.
type QueueConfigApplyConfiguration struct {
	// capacity is the number of samples to buffer per shard before we start dropping them.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// The default value is 10000.
	// Minimum value is 1.
	// Maximum value is 1000000.
	Capacity *int32 `json:"capacity,omitempty"`
	// maxShards is the maximum number of shards, i.e. amount of concurrency.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// The default value is 200.
	// Minimum value is 1.
	// Maximum value is 10000.
	MaxShards *int32 `json:"maxShards,omitempty"`
	// minShards is the minimum number of shards, i.e. amount of concurrency.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// The default value is 1.
	// Minimum value is 1.
	// Maximum value is 10000.
	MinShards *int32 `json:"minShards,omitempty"`
	// maxSamplesPerSend is the maximum number of samples per send.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// The default value is 1000.
	// Minimum value is 1.
	// Maximum value is 100000.
	MaxSamplesPerSend *int32 `json:"maxSamplesPerSend,omitempty"`
	// batchSendDeadlineSeconds is the maximum time in seconds a sample will wait in buffer before being sent.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// Minimum value is 1 second.
	// Maximum value is 3600 seconds (1 hour).
	BatchSendDeadlineSeconds *int32 `json:"batchSendDeadlineSeconds,omitempty"`
	// minBackoffMilliseconds is the minimum retry delay in milliseconds.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// Minimum value is 1 millisecond.
	// Maximum value is 3600000 milliseconds (1 hour).
	MinBackoffMilliseconds *int32 `json:"minBackoffMilliseconds,omitempty"`
	// maxBackoffMilliseconds is the maximum retry delay in milliseconds.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// Minimum value is 1 millisecond.
	// Maximum value is 3600000 milliseconds (1 hour).
	MaxBackoffMilliseconds *int32 `json:"maxBackoffMilliseconds,omitempty"`
	// rateLimitedAction controls what to do when the remote write endpoint returns HTTP 429 (Too Many Requests).
	// When omitted, no retries are performed on rate limit responses.
	// When set to "Retry", Prometheus will retry such requests using the backoff settings above.
	// Valid value when set is "Retry".
	RateLimitedAction *configv1alpha1.RateLimitedAction `json:"rateLimitedAction,omitempty"`
}

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

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

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

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

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

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

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

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

// WithRateLimitedAction sets the RateLimitedAction 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 RateLimitedAction field is set to the value of the last call.
func (b *QueueConfigApplyConfiguration) WithRateLimitedAction(value configv1alpha1.RateLimitedAction) *QueueConfigApplyConfiguration {
	b.RateLimitedAction = &value
	return b
}
