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

package v1alpha1

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

// RemoteWriteSpecApplyConfiguration represents a declarative configuration of the RemoteWriteSpec type for use
// with apply.
//
// RemoteWriteSpec represents configuration for remote write endpoints.
type RemoteWriteSpecApplyConfiguration struct {
	// url is the URL of the remote write endpoint.
	// Must be a valid URL with http or https scheme and a non-empty hostname.
	// Query parameters, fragments, and user information (e.g. user:password@host) are not allowed.
	// Empty string is invalid. Must be between 1 and 2048 characters in length.
	URL *string `json:"url,omitempty"`
	// name is a required identifier for this remote write configuration (name is the list key for the remoteWrite list).
	// This name is used in metrics and logging to differentiate remote write queues.
	// Must contain only alphanumeric characters, hyphens, and underscores.
	// Must be between 1 and 63 characters in length.
	Name *string `json:"name,omitempty"`
	// authorization defines the authorization method for the remote write endpoint.
	// When omitted, no authorization is performed.
	// When set, type must be one of Authorization, BasicAuth, OAuth2, SigV4, or ServiceAccount; the corresponding nested config must be set (ServiceAccount has no config).
	AuthorizationConfig *RemoteWriteAuthorizationApplyConfiguration `json:"authorization,omitempty"`
	// headers specifies the custom HTTP headers to be sent along with each remote write request.
	// Sending custom headers makes the configuration of a proxy in between optional and helps the
	// receiver recognize the given source better.
	// Clients MAY allow users to send custom HTTP headers; they MUST NOT allow users to configure
	// them in such a way as to send reserved headers. Headers set by Prometheus cannot be overwritten.
	// When omitted, no custom headers are sent.
	// Maximum of 50 headers can be specified. Each header name must be unique.
	// Each header name must contain only alphanumeric characters, hyphens, and underscores, and must not be a reserved Prometheus header (Host, Authorization, Content-Encoding, Content-Type, X-Prometheus-Remote-Write-Version, User-Agent, Connection, Keep-Alive, Proxy-Authenticate, Proxy-Authorization, WWW-Authenticate).
	Headers []PrometheusRemoteWriteHeaderApplyConfiguration `json:"headers,omitempty"`
	// metadataConfig configures the sending of series metadata to remote storage.
	// When omitted, no metadata is sent.
	// When set to sendPolicy: Default, metadata is sent using platform-chosen defaults (e.g. send interval 30 seconds).
	// When set to sendPolicy: Custom, metadata is sent using the settings in the custom field (e.g. custom.sendIntervalSeconds).
	MetadataConfig *MetadataConfigApplyConfiguration `json:"metadataConfig,omitempty"`
	// proxyUrl defines an optional proxy URL.
	// If the cluster-wide proxy is enabled, it replaces the proxyUrl setting.
	// The cluster-wide proxy supports both HTTP and HTTPS proxies, with HTTPS taking precedence.
	// When omitted, no proxy is used.
	// Must be a valid URL with http or https scheme.
	// Must be between 1 and 2048 characters in length.
	ProxyURL *string `json:"proxyUrl,omitempty"`
	// queueConfig allows tuning configuration for remote write queue parameters.
	// When omitted, default queue configuration is used.
	QueueConfig *QueueConfigApplyConfiguration `json:"queueConfig,omitempty"`
	// remoteTimeoutSeconds defines the timeout in seconds for requests to the remote write endpoint.
	// 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 600 seconds (10 minutes).
	RemoteTimeoutSeconds *int32 `json:"remoteTimeoutSeconds,omitempty"`
	// exemplarsMode controls whether exemplars are sent via remote write.
	// Valid values are "Send", "DoNotSend" and omitted.
	// When set to "Send", Prometheus is configured to store a maximum of 100,000 exemplars in memory and send them with remote write.
	// Note that this setting only applies to user-defined monitoring. It is not applicable to default in-cluster monitoring.
	// When omitted or set to "DoNotSend", exemplars are not sent.
	ExemplarsMode *configv1alpha1.ExemplarsMode `json:"exemplarsMode,omitempty"`
	// tlsConfig defines TLS authentication settings for the remote write endpoint.
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"`
	// writeRelabelConfigs is a list of relabeling rules to apply before sending data to the remote endpoint.
	// When omitted, no relabeling is performed and all metrics are sent as-is.
	// Minimum of 1 and maximum of 10 relabeling rules can be specified.
	// Each rule must have a unique name.
	WriteRelabelConfigs []RelabelConfigApplyConfiguration `json:"writeRelabelConfigs,omitempty"`
}

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

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

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

// WithAuthorizationConfig sets the AuthorizationConfig 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 AuthorizationConfig field is set to the value of the last call.
func (b *RemoteWriteSpecApplyConfiguration) WithAuthorizationConfig(value *RemoteWriteAuthorizationApplyConfiguration) *RemoteWriteSpecApplyConfiguration {
	b.AuthorizationConfig = value
	return b
}

// WithHeaders adds the given value to the Headers 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 Headers field.
func (b *RemoteWriteSpecApplyConfiguration) WithHeaders(values ...*PrometheusRemoteWriteHeaderApplyConfiguration) *RemoteWriteSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithHeaders")
		}
		b.Headers = append(b.Headers, *values[i])
	}
	return b
}

// WithMetadataConfig sets the MetadataConfig 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 MetadataConfig field is set to the value of the last call.
func (b *RemoteWriteSpecApplyConfiguration) WithMetadataConfig(value *MetadataConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration {
	b.MetadataConfig = value
	return b
}

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

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

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

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

// WithTLSConfig sets the TLSConfig 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 TLSConfig field is set to the value of the last call.
func (b *RemoteWriteSpecApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration {
	b.TLSConfig = value
	return b
}

// WithWriteRelabelConfigs adds the given value to the WriteRelabelConfigs 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 WriteRelabelConfigs field.
func (b *RemoteWriteSpecApplyConfiguration) WithWriteRelabelConfigs(values ...*RelabelConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithWriteRelabelConfigs")
		}
		b.WriteRelabelConfigs = append(b.WriteRelabelConfigs, *values[i])
	}
	return b
}
