// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/type/metadata/v2/metadata.proto

package metadatav2

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

// MetadataKey provides a general interface using `key` and `path` to retrieve value from
// :ref:`Metadata <envoy_api_msg_core.Metadata>`.
//
// For example, for the following Metadata:
//
// .. code-block:: yaml
//
//	filter_metadata:
//	  envoy.xxx:
//	    prop:
//	      foo: bar
//	      xyz:
//	        hello: envoy
//
// The following MetadataKey will retrieve a string value "bar" from the Metadata.
//
// .. code-block:: yaml
//
//	key: envoy.xxx
//	path:
//	- key: prop
//	- key: foo
type MetadataKey struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The key name of Metadata to retrieve the Struct from the metadata.
	// Typically, it represents a builtin subsystem or custom extension.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The path to retrieve the Value from the Struct. It can be a prefix or a full path,
	// e.g. “[prop, xyz]“ for a struct or “[prop, foo]“ for a string in the example,
	// which depends on the particular scenario.
	//
	// Note: Due to that only the key type segment is supported, the path can not specify a list
	// unless the list is the last segment.
	Path          []*MetadataKey_PathSegment `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*MetadataKey) ProtoMessage() {}

func (x *MetadataKey) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_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 MetadataKey.ProtoReflect.Descriptor instead.
func (*MetadataKey) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{0}
}

func (x *MetadataKey) GetKey() string {
	if x != nil {
		return x.Key
	}
	return ""
}

func (x *MetadataKey) GetPath() []*MetadataKey_PathSegment {
	if x != nil {
		return x.Path
	}
	return nil
}

// Describes what kind of metadata.
type MetadataKind struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Kind:
	//
	//	*MetadataKind_Request_
	//	*MetadataKind_Route_
	//	*MetadataKind_Cluster_
	//	*MetadataKind_Host_
	Kind          isMetadataKind_Kind `protobuf_oneof:"kind"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKind) Reset() {
	*x = MetadataKind{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKind) ProtoMessage() {}

func (x *MetadataKind) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[1]
	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 MetadataKind.ProtoReflect.Descriptor instead.
func (*MetadataKind) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{1}
}

func (x *MetadataKind) GetKind() isMetadataKind_Kind {
	if x != nil {
		return x.Kind
	}
	return nil
}

func (x *MetadataKind) GetRequest() *MetadataKind_Request {
	if x != nil {
		if x, ok := x.Kind.(*MetadataKind_Request_); ok {
			return x.Request
		}
	}
	return nil
}

func (x *MetadataKind) GetRoute() *MetadataKind_Route {
	if x != nil {
		if x, ok := x.Kind.(*MetadataKind_Route_); ok {
			return x.Route
		}
	}
	return nil
}

func (x *MetadataKind) GetCluster() *MetadataKind_Cluster {
	if x != nil {
		if x, ok := x.Kind.(*MetadataKind_Cluster_); ok {
			return x.Cluster
		}
	}
	return nil
}

func (x *MetadataKind) GetHost() *MetadataKind_Host {
	if x != nil {
		if x, ok := x.Kind.(*MetadataKind_Host_); ok {
			return x.Host
		}
	}
	return nil
}

type isMetadataKind_Kind interface {
	isMetadataKind_Kind()
}

type MetadataKind_Request_ struct {
	// Request kind of metadata.
	Request *MetadataKind_Request `protobuf:"bytes,1,opt,name=request,proto3,oneof"`
}

type MetadataKind_Route_ struct {
	// Route kind of metadata.
	Route *MetadataKind_Route `protobuf:"bytes,2,opt,name=route,proto3,oneof"`
}

type MetadataKind_Cluster_ struct {
	// Cluster kind of metadata.
	Cluster *MetadataKind_Cluster `protobuf:"bytes,3,opt,name=cluster,proto3,oneof"`
}

type MetadataKind_Host_ struct {
	// Host kind of metadata.
	Host *MetadataKind_Host `protobuf:"bytes,4,opt,name=host,proto3,oneof"`
}

func (*MetadataKind_Request_) isMetadataKind_Kind() {}

func (*MetadataKind_Route_) isMetadataKind_Kind() {}

func (*MetadataKind_Cluster_) isMetadataKind_Kind() {}

func (*MetadataKind_Host_) isMetadataKind_Kind() {}

// Specifies the segment in a path to retrieve value from Metadata.
// Currently it is only supported to specify the key, i.e. field name, as one segment of a path.
type MetadataKey_PathSegment struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Segment:
	//
	//	*MetadataKey_PathSegment_Key
	Segment       isMetadataKey_PathSegment_Segment `protobuf_oneof:"segment"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKey_PathSegment) Reset() {
	*x = MetadataKey_PathSegment{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKey_PathSegment) ProtoMessage() {}

func (x *MetadataKey_PathSegment) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[2]
	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 MetadataKey_PathSegment.ProtoReflect.Descriptor instead.
func (*MetadataKey_PathSegment) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{0, 0}
}

func (x *MetadataKey_PathSegment) GetSegment() isMetadataKey_PathSegment_Segment {
	if x != nil {
		return x.Segment
	}
	return nil
}

func (x *MetadataKey_PathSegment) GetKey() string {
	if x != nil {
		if x, ok := x.Segment.(*MetadataKey_PathSegment_Key); ok {
			return x.Key
		}
	}
	return ""
}

type isMetadataKey_PathSegment_Segment interface {
	isMetadataKey_PathSegment_Segment()
}

type MetadataKey_PathSegment_Key struct {
	// If specified, use the key to retrieve the value in a Struct.
	Key string `protobuf:"bytes,1,opt,name=key,proto3,oneof"`
}

func (*MetadataKey_PathSegment_Key) isMetadataKey_PathSegment_Segment() {}

// Represents dynamic metadata associated with the request.
type MetadataKind_Request struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKind_Request) Reset() {
	*x = MetadataKind_Request{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKind_Request) ProtoMessage() {}

func (x *MetadataKind_Request) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[3]
	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 MetadataKind_Request.ProtoReflect.Descriptor instead.
func (*MetadataKind_Request) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{1, 0}
}

// Represents metadata from :ref:`the route<envoy_api_field_route.Route.metadata>`.
type MetadataKind_Route struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKind_Route) Reset() {
	*x = MetadataKind_Route{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKind_Route) ProtoMessage() {}

func (x *MetadataKind_Route) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[4]
	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 MetadataKind_Route.ProtoReflect.Descriptor instead.
func (*MetadataKind_Route) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{1, 1}
}

// Represents metadata from :ref:`the upstream cluster<envoy_api_field_Cluster.metadata>`.
type MetadataKind_Cluster struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKind_Cluster) Reset() {
	*x = MetadataKind_Cluster{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[5]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKind_Cluster) ProtoMessage() {}

func (x *MetadataKind_Cluster) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[5]
	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 MetadataKind_Cluster.ProtoReflect.Descriptor instead.
func (*MetadataKind_Cluster) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{1, 2}
}

// Represents metadata from :ref:`the upstream
// host<envoy_api_field_endpoint.LbEndpoint.metadata>`.
type MetadataKind_Host struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetadataKind_Host) Reset() {
	*x = MetadataKind_Host{}
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[6]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetadataKind_Host) ProtoMessage() {}

func (x *MetadataKind_Host) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_type_metadata_v2_metadata_proto_msgTypes[6]
	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 MetadataKind_Host.ProtoReflect.Descriptor instead.
func (*MetadataKind_Host) Descriptor() ([]byte, []int) {
	return file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP(), []int{1, 3}
}

var File_envoy_type_metadata_v2_metadata_proto protoreflect.FileDescriptor

const file_envoy_type_metadata_v2_metadata_proto_rawDesc = "" +
	"\n" +
	"%envoy/type/metadata/v2/metadata.proto\x12\x16envoy.type.metadata.v2\x1a\x1eudpa/annotations/migrate.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xb3\x01\n" +
	"\vMetadataKey\x12\x19\n" +
	"\x03key\x18\x01 \x01(\tB\a\xfaB\x04r\x02 \x01R\x03key\x12M\n" +
	"\x04path\x18\x02 \x03(\v2/.envoy.type.metadata.v2.MetadataKey.PathSegmentB\b\xfaB\x05\x92\x01\x02\b\x01R\x04path\x1a:\n" +
	"\vPathSegment\x12\x1b\n" +
	"\x03key\x18\x01 \x01(\tB\a\xfaB\x04r\x02 \x01H\x00R\x03keyB\x0e\n" +
	"\asegment\x12\x03\xf8B\x01\"\xdb\x02\n" +
	"\fMetadataKind\x12H\n" +
	"\arequest\x18\x01 \x01(\v2,.envoy.type.metadata.v2.MetadataKind.RequestH\x00R\arequest\x12B\n" +
	"\x05route\x18\x02 \x01(\v2*.envoy.type.metadata.v2.MetadataKind.RouteH\x00R\x05route\x12H\n" +
	"\acluster\x18\x03 \x01(\v2,.envoy.type.metadata.v2.MetadataKind.ClusterH\x00R\acluster\x12?\n" +
	"\x04host\x18\x04 \x01(\v2).envoy.type.metadata.v2.MetadataKind.HostH\x00R\x04host\x1a\t\n" +
	"\aRequest\x1a\a\n" +
	"\x05Route\x1a\t\n" +
	"\aCluster\x1a\x06\n" +
	"\x04HostB\v\n" +
	"\x04kind\x12\x03\xf8B\x01B\xa7\x01\xf2\x98\xfe\x8f\x05\x18\x12\x16envoy.type.metadata.v3\xba\x80\xc8\xd1\x06\x02\x10\x01\n" +
	"$io.envoyproxy.envoy.type.metadata.v2B\rMetadataProtoP\x01ZHgithub.com/envoyproxy/go-control-plane/envoy/type/metadata/v2;metadatav2b\x06proto3"

var (
	file_envoy_type_metadata_v2_metadata_proto_rawDescOnce sync.Once
	file_envoy_type_metadata_v2_metadata_proto_rawDescData []byte
)

func file_envoy_type_metadata_v2_metadata_proto_rawDescGZIP() []byte {
	file_envoy_type_metadata_v2_metadata_proto_rawDescOnce.Do(func() {
		file_envoy_type_metadata_v2_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_type_metadata_v2_metadata_proto_rawDesc), len(file_envoy_type_metadata_v2_metadata_proto_rawDesc)))
	})
	return file_envoy_type_metadata_v2_metadata_proto_rawDescData
}

var file_envoy_type_metadata_v2_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_envoy_type_metadata_v2_metadata_proto_goTypes = []any{
	(*MetadataKey)(nil),             // 0: envoy.type.metadata.v2.MetadataKey
	(*MetadataKind)(nil),            // 1: envoy.type.metadata.v2.MetadataKind
	(*MetadataKey_PathSegment)(nil), // 2: envoy.type.metadata.v2.MetadataKey.PathSegment
	(*MetadataKind_Request)(nil),    // 3: envoy.type.metadata.v2.MetadataKind.Request
	(*MetadataKind_Route)(nil),      // 4: envoy.type.metadata.v2.MetadataKind.Route
	(*MetadataKind_Cluster)(nil),    // 5: envoy.type.metadata.v2.MetadataKind.Cluster
	(*MetadataKind_Host)(nil),       // 6: envoy.type.metadata.v2.MetadataKind.Host
}
var file_envoy_type_metadata_v2_metadata_proto_depIdxs = []int32{
	2, // 0: envoy.type.metadata.v2.MetadataKey.path:type_name -> envoy.type.metadata.v2.MetadataKey.PathSegment
	3, // 1: envoy.type.metadata.v2.MetadataKind.request:type_name -> envoy.type.metadata.v2.MetadataKind.Request
	4, // 2: envoy.type.metadata.v2.MetadataKind.route:type_name -> envoy.type.metadata.v2.MetadataKind.Route
	5, // 3: envoy.type.metadata.v2.MetadataKind.cluster:type_name -> envoy.type.metadata.v2.MetadataKind.Cluster
	6, // 4: envoy.type.metadata.v2.MetadataKind.host:type_name -> envoy.type.metadata.v2.MetadataKind.Host
	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_type_metadata_v2_metadata_proto_init() }
func file_envoy_type_metadata_v2_metadata_proto_init() {
	if File_envoy_type_metadata_v2_metadata_proto != nil {
		return
	}
	file_envoy_type_metadata_v2_metadata_proto_msgTypes[1].OneofWrappers = []any{
		(*MetadataKind_Request_)(nil),
		(*MetadataKind_Route_)(nil),
		(*MetadataKind_Cluster_)(nil),
		(*MetadataKind_Host_)(nil),
	}
	file_envoy_type_metadata_v2_metadata_proto_msgTypes[2].OneofWrappers = []any{
		(*MetadataKey_PathSegment_Key)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_type_metadata_v2_metadata_proto_rawDesc), len(file_envoy_type_metadata_v2_metadata_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   7,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_type_metadata_v2_metadata_proto_goTypes,
		DependencyIndexes: file_envoy_type_metadata_v2_metadata_proto_depIdxs,
		MessageInfos:      file_envoy_type_metadata_v2_metadata_proto_msgTypes,
	}.Build()
	File_envoy_type_metadata_v2_metadata_proto = out.File
	file_envoy_type_metadata_v2_metadata_proto_goTypes = nil
	file_envoy_type_metadata_v2_metadata_proto_depIdxs = nil
}
