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

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
)

// IngressControllerCaptureHTTPCookieUnionApplyConfiguration represents a declarative configuration of the IngressControllerCaptureHTTPCookieUnion type for use
// with apply.
//
// IngressControllerCaptureHTTPCookieUnion describes optional fields of an HTTP cookie that should be captured.
type IngressControllerCaptureHTTPCookieUnionApplyConfiguration struct {
	// matchType specifies the type of match to be performed on the cookie
	// name.  Allowed values are "Exact" for an exact string match and
	// "Prefix" for a string prefix match.  If "Exact" is specified, a name
	// must be specified in the name field.  If "Prefix" is provided, a
	// prefix must be specified in the namePrefix field.  For example,
	// specifying matchType "Prefix" and namePrefix "foo" will capture a
	// cookie named "foo" or "foobar" but not one named "bar".  The first
	// matching cookie is captured.
	MatchType *operatorv1.CookieMatchType `json:"matchType,omitempty"`
	// name specifies a cookie name.  Its value must be a valid HTTP cookie
	// name as defined in RFC 6265 section 4.1.
	Name *string `json:"name,omitempty"`
	// namePrefix specifies a cookie name prefix.  Its value must be a valid
	// HTTP cookie name as defined in RFC 6265 section 4.1.
	NamePrefix *string `json:"namePrefix,omitempty"`
}

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

// WithMatchType sets the MatchType 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 MatchType field is set to the value of the last call.
func (b *IngressControllerCaptureHTTPCookieUnionApplyConfiguration) WithMatchType(value operatorv1.CookieMatchType) *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
	b.MatchType = &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 *IngressControllerCaptureHTTPCookieUnionApplyConfiguration) WithName(value string) *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
	b.Name = &value
	return b
}

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