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

package v1alpha1

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

// RelabelActionConfigApplyConfiguration represents a declarative configuration of the RelabelActionConfig type for use
// with apply.
//
// RelabelActionConfig represents the action to perform and its configuration.
// Exactly one action-specific configuration must be specified based on the action type.
type RelabelActionConfigApplyConfiguration struct {
	// type specifies the action to perform on the matched labels.
	// Allowed values are Replace, Lowercase, Uppercase, Keep, Drop, KeepEqual, DropEqual, HashMod, LabelMap, LabelDrop, LabelKeep.
	//
	// When set to Replace, regex is matched against the concatenated source_labels; target_label is set to replacement with match group references (${1}, ${2}, ...) substituted. If regex does not match, no replacement takes place.
	//
	// When set to Lowercase, the concatenated source_labels are mapped to their lower case. Requires Prometheus >= v2.36.0.
	//
	// When set to Uppercase, the concatenated source_labels are mapped to their upper case. Requires Prometheus >= v2.36.0.
	//
	// When set to Keep, targets for which regex does not match the concatenated source_labels are dropped.
	//
	// When set to Drop, targets for which regex matches the concatenated source_labels are dropped.
	//
	// When set to KeepEqual, targets for which the concatenated source_labels do not match target_label are dropped. Requires Prometheus >= v2.41.0.
	//
	// When set to DropEqual, targets for which the concatenated source_labels do match target_label are dropped. Requires Prometheus >= v2.41.0.
	//
	// When set to HashMod, target_label is set to the modulus of a hash of the concatenated source_labels.
	//
	// When set to LabelMap, regex is matched against all source label names (not just source_labels); matching label values are copied to new names given by replacement with ${1}, ${2}, ... substituted.
	//
	// When set to LabelDrop, regex is matched against all label names; any label that matches is removed.
	//
	// When set to LabelKeep, regex is matched against all label names; any label that does not match is removed.
	Type *configv1alpha1.RelabelAction `json:"type,omitempty"`
	// replace configures the Replace action.
	// Required when type is Replace, and forbidden otherwise.
	Replace *ReplaceActionConfigApplyConfiguration `json:"replace,omitempty"`
	// hashMod configures the HashMod action.
	// Required when type is HashMod, and forbidden otherwise.
	HashMod *HashModActionConfigApplyConfiguration `json:"hashMod,omitempty"`
	// labelMap configures the LabelMap action.
	// Required when type is LabelMap, and forbidden otherwise.
	LabelMap *LabelMapActionConfigApplyConfiguration `json:"labelMap,omitempty"`
	// lowercase configures the Lowercase action.
	// Required when type is Lowercase, and forbidden otherwise.
	// Requires Prometheus >= v2.36.0.
	Lowercase *LowercaseActionConfigApplyConfiguration `json:"lowercase,omitempty"`
	// uppercase configures the Uppercase action.
	// Required when type is Uppercase, and forbidden otherwise.
	// Requires Prometheus >= v2.36.0.
	Uppercase *UppercaseActionConfigApplyConfiguration `json:"uppercase,omitempty"`
	// keepEqual configures the KeepEqual action.
	// Required when type is KeepEqual, and forbidden otherwise.
	// Requires Prometheus >= v2.41.0.
	KeepEqual *KeepEqualActionConfigApplyConfiguration `json:"keepEqual,omitempty"`
	// dropEqual configures the DropEqual action.
	// Required when type is DropEqual, and forbidden otherwise.
	// Requires Prometheus >= v2.41.0.
	DropEqual *DropEqualActionConfigApplyConfiguration `json:"dropEqual,omitempty"`
}

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

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

// WithReplace sets the Replace 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 Replace field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithReplace(value *ReplaceActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.Replace = value
	return b
}

// WithHashMod sets the HashMod 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 HashMod field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithHashMod(value *HashModActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.HashMod = value
	return b
}

// WithLabelMap sets the LabelMap 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 LabelMap field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithLabelMap(value *LabelMapActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.LabelMap = value
	return b
}

// WithLowercase sets the Lowercase 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 Lowercase field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithLowercase(value *LowercaseActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.Lowercase = value
	return b
}

// WithUppercase sets the Uppercase 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 Uppercase field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithUppercase(value *UppercaseActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.Uppercase = value
	return b
}

// WithKeepEqual sets the KeepEqual 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 KeepEqual field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithKeepEqual(value *KeepEqualActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.KeepEqual = value
	return b
}

// WithDropEqual sets the DropEqual 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 DropEqual field is set to the value of the last call.
func (b *RelabelActionConfigApplyConfiguration) WithDropEqual(value *DropEqualActionConfigApplyConfiguration) *RelabelActionConfigApplyConfiguration {
	b.DropEqual = value
	return b
}
