// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/extensions/http/custom_response/redirect_policy/v3/redirect_policy.proto

package redirect_policyv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/cncf/xds/go/xds/annotations/v3"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	v31 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Custom response policy to internally redirect the original response to a different
// upstream.
// [#next-free-field: 7]
type RedirectPolicy struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to RedirectActionSpecifier:
	//
	//	*RedirectPolicy_Uri
	//	*RedirectPolicy_RedirectAction
	RedirectActionSpecifier isRedirectPolicy_RedirectActionSpecifier `protobuf_oneof:"redirect_action_specifier"`
	// The new response status code if specified. This is used to override the
	// status code of the response from the new upstream if it is not an error status.
	StatusCode *wrapperspb.UInt32Value `protobuf:"bytes,3,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	// HTTP headers to add to the response. This allows the
	// response policy to append, to add or to override headers of
	// the original response for local body, or the custom response from the
	// remote body, before it is sent to a downstream client.
	// Note that these are not applied if the redirected response is an error
	// response.
	ResponseHeadersToAdd []*v3.HeaderValueOption `protobuf:"bytes,4,rep,name=response_headers_to_add,json=responseHeadersToAdd,proto3" json:"response_headers_to_add,omitempty"`
	// HTTP headers to add to the request before it is internally redirected.
	RequestHeadersToAdd []*v3.HeaderValueOption `protobuf:"bytes,5,rep,name=request_headers_to_add,json=requestHeadersToAdd,proto3" json:"request_headers_to_add,omitempty"`
	// Custom action to modify request headers before selection of the
	// redirected route.
	// [#comment: TODO(pradeepcrao) add an extension category.]
	ModifyRequestHeadersAction *v3.TypedExtensionConfig `protobuf:"bytes,6,opt,name=modify_request_headers_action,json=modifyRequestHeadersAction,proto3" json:"modify_request_headers_action,omitempty"`
	unknownFields              protoimpl.UnknownFields
	sizeCache                  protoimpl.SizeCache
}

func (x *RedirectPolicy) Reset() {
	*x = RedirectPolicy{}
	mi := &file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *RedirectPolicy) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RedirectPolicy) ProtoMessage() {}

func (x *RedirectPolicy) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RedirectPolicy.ProtoReflect.Descriptor instead.
func (*RedirectPolicy) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescGZIP(), []int{0}
}

func (x *RedirectPolicy) GetRedirectActionSpecifier() isRedirectPolicy_RedirectActionSpecifier {
	if x != nil {
		return x.RedirectActionSpecifier
	}
	return nil
}

func (x *RedirectPolicy) GetUri() string {
	if x != nil {
		if x, ok := x.RedirectActionSpecifier.(*RedirectPolicy_Uri); ok {
			return x.Uri
		}
	}
	return ""
}

func (x *RedirectPolicy) GetRedirectAction() *v31.RedirectAction {
	if x != nil {
		if x, ok := x.RedirectActionSpecifier.(*RedirectPolicy_RedirectAction); ok {
			return x.RedirectAction
		}
	}
	return nil
}

func (x *RedirectPolicy) GetStatusCode() *wrapperspb.UInt32Value {
	if x != nil {
		return x.StatusCode
	}
	return nil
}

func (x *RedirectPolicy) GetResponseHeadersToAdd() []*v3.HeaderValueOption {
	if x != nil {
		return x.ResponseHeadersToAdd
	}
	return nil
}

func (x *RedirectPolicy) GetRequestHeadersToAdd() []*v3.HeaderValueOption {
	if x != nil {
		return x.RequestHeadersToAdd
	}
	return nil
}

func (x *RedirectPolicy) GetModifyRequestHeadersAction() *v3.TypedExtensionConfig {
	if x != nil {
		return x.ModifyRequestHeadersAction
	}
	return nil
}

type isRedirectPolicy_RedirectActionSpecifier interface {
	isRedirectPolicy_RedirectActionSpecifier()
}

type RedirectPolicy_Uri struct {
	// The Http URI to redirect the original request to, to get the custom
	// response.
	// It should be a full FQDN with protocol, host and path.
	//
	// Example:
	//
	// .. code-block:: yaml
	//
	//	uri: https://www.mydomain.com/path/to/404.txt
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3,oneof"`
}

type RedirectPolicy_RedirectAction struct {
	// Specify elements of the redirect url individually.
	// Note: Do not specify the “response_code“ field in “redirect_action“, use
	// “status_code“ instead.
	// The following fields in “redirect_action“ are currently not supported,
	// and specifying them will cause the config to be rejected:
	// - “prefix_rewrite“
	// - “regex_rewrite“
	RedirectAction *v31.RedirectAction `protobuf:"bytes,2,opt,name=redirect_action,json=redirectAction,proto3,oneof"`
}

func (*RedirectPolicy_Uri) isRedirectPolicy_RedirectActionSpecifier() {}

func (*RedirectPolicy_RedirectAction) isRedirectPolicy_RedirectActionSpecifier() {}

var File_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto protoreflect.FileDescriptor

const file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDesc = "" +
	"\n" +
	"Nenvoy/extensions/http/custom_response/redirect_policy/v3/redirect_policy.proto\x128envoy.extensions.http.custom_response.redirect_policy.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a$envoy/config/core/v3/extension.proto\x1a,envoy/config/route/v3/route_components.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1fxds/annotations/v3/status.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xb0\x04\n" +
	"\x0eRedirectPolicy\x12\x1b\n" +
	"\x03uri\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01H\x00R\x03uri\x12P\n" +
	"\x0fredirect_action\x18\x02 \x01(\v2%.envoy.config.route.v3.RedirectActionH\x00R\x0eredirectAction\x12J\n" +
	"\vstatus_code\x18\x03 \x01(\v2\x1c.google.protobuf.UInt32ValueB\v\xfaB\b*\x06\x18\xe7\a(\xc8\x01R\n" +
	"statusCode\x12i\n" +
	"\x17response_headers_to_add\x18\x04 \x03(\v2'.envoy.config.core.v3.HeaderValueOptionB\t\xfaB\x06\x92\x01\x03\x10\xe8\aR\x14responseHeadersToAdd\x12g\n" +
	"\x16request_headers_to_add\x18\x05 \x03(\v2'.envoy.config.core.v3.HeaderValueOptionB\t\xfaB\x06\x92\x01\x03\x10\xe8\aR\x13requestHeadersToAdd\x12m\n" +
	"\x1dmodify_request_headers_action\x18\x06 \x01(\v2*.envoy.config.core.v3.TypedExtensionConfigR\x1amodifyRequestHeadersActionB \n" +
	"\x19redirect_action_specifier\x12\x03\xf8B\x01B\xe2\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\xd2Ƥ\xe1\x06\x02\b\x01\n" +
	"Fio.envoyproxy.envoy.extensions.http.custom_response.redirect_policy.v3B\x13RedirectPolicyProtoP\x01Zqgithub.com/envoyproxy/go-control-plane/envoy/extensions/http/custom_response/redirect_policy/v3;redirect_policyv3b\x06proto3"

var (
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescOnce sync.Once
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescData []byte
)

func file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescGZIP() []byte {
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDesc), len(file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDesc)))
	})
	return file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDescData
}

var file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_goTypes = []any{
	(*RedirectPolicy)(nil),          // 0: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy
	(*v31.RedirectAction)(nil),      // 1: envoy.config.route.v3.RedirectAction
	(*wrapperspb.UInt32Value)(nil),  // 2: google.protobuf.UInt32Value
	(*v3.HeaderValueOption)(nil),    // 3: envoy.config.core.v3.HeaderValueOption
	(*v3.TypedExtensionConfig)(nil), // 4: envoy.config.core.v3.TypedExtensionConfig
}
var file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_depIdxs = []int32{
	1, // 0: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy.redirect_action:type_name -> envoy.config.route.v3.RedirectAction
	2, // 1: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy.status_code:type_name -> google.protobuf.UInt32Value
	3, // 2: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy.response_headers_to_add:type_name -> envoy.config.core.v3.HeaderValueOption
	3, // 3: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy.request_headers_to_add:type_name -> envoy.config.core.v3.HeaderValueOption
	4, // 4: envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy.modify_request_headers_action:type_name -> envoy.config.core.v3.TypedExtensionConfig
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() {
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_init()
}
func file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_init() {
	if File_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto != nil {
		return
	}
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_msgTypes[0].OneofWrappers = []any{
		(*RedirectPolicy_Uri)(nil),
		(*RedirectPolicy_RedirectAction)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDesc), len(file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_msgTypes,
	}.Build()
	File_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto = out.File
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_goTypes = nil
	file_envoy_extensions_http_custom_response_redirect_policy_v3_redirect_policy_proto_depIdxs = nil
}
