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

package v1

// RouteHTTPHeaderActionsApplyConfiguration represents a declarative configuration of the RouteHTTPHeaderActions type for use
// with apply.
//
// RouteHTTPHeaderActions defines configuration for actions on HTTP request and response headers.
type RouteHTTPHeaderActionsApplyConfiguration struct {
	// response is a list of HTTP response headers to modify.
	// Currently, actions may define to either `Set` or `Delete` headers values.
	// Actions defined here will modify the response headers of all requests made through a route.
	// These actions are applied to a specific Route defined within a cluster i.e. connections made through a route.
	// Route actions will be executed before IngressController actions for response headers.
	// Actions are applied in sequence as defined in this list.
	// A maximum of 20 response header actions may be configured.
	// You can use this field to specify HTTP response headers that should be set or deleted
	// when forwarding responses from your application to the client.
	// Sample fetchers allowed are "res.hdr" and "ssl_c_der".
	// Converters allowed are "lower" and "base64".
	// Example header values: "%[res.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]".
	// Note: This field cannot be used if your route uses TLS passthrough.
	Response []RouteHTTPHeaderApplyConfiguration `json:"response,omitempty"`
	// request is a list of HTTP request headers to modify.
	// Currently, actions may define to either `Set` or `Delete` headers values.
	// Actions defined here will modify the request headers of all requests made through a route.
	// These actions are applied to a specific Route defined within a cluster i.e. connections made through a route.
	// Currently, actions may define to either `Set` or `Delete` headers values.
	// Route actions will be executed after IngressController actions for request headers.
	// Actions are applied in sequence as defined in this list.
	// A maximum of 20 request header actions may be configured.
	// You can use this field to specify HTTP request headers that should be set or deleted
	// when forwarding connections from the client to your application.
	// Sample fetchers allowed are "req.hdr" and "ssl_c_der".
	// Converters allowed are "lower" and "base64".
	// Example header values: "%[req.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]".
	// Any request header configuration applied directly via a Route resource using this API
	// will override header configuration for a header of the same name applied via
	// spec.httpHeaders.actions on the IngressController or route annotation.
	// Note: This field cannot be used if your route uses TLS passthrough.
	Request []RouteHTTPHeaderApplyConfiguration `json:"request,omitempty"`
}

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

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

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