// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/filters/http/grpc_stats/v3/config.proto

package grpc_statsv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	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)
)

// gRPC statistics filter configuration
// [#next-free-field: 6]
type FilterConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// If true, the filter maintains a filter state object with the request and response message
	// counts.
	EmitFilterState bool `protobuf:"varint,1,opt,name=emit_filter_state,json=emitFilterState,proto3" json:"emit_filter_state,omitempty"`
	// Types that are valid to be assigned to PerMethodStatSpecifier:
	//
	//	*FilterConfig_IndividualMethodStatsAllowlist
	//	*FilterConfig_StatsForAllMethods
	PerMethodStatSpecifier isFilterConfig_PerMethodStatSpecifier `protobuf_oneof:"per_method_stat_specifier"`
	// If true, the filter will gather a histogram for the request time of the upstream.
	// It works with :ref:`stats_for_all_methods
	// <envoy_v3_api_field_extensions.filters.http.grpc_stats.v3.FilterConfig.stats_for_all_methods>`
	// and :ref:`individual_method_stats_allowlist
	// <envoy_v3_api_field_extensions.filters.http.grpc_stats.v3.FilterConfig.individual_method_stats_allowlist>` the same way
	// request_message_count and response_message_count works.
	EnableUpstreamStats bool `protobuf:"varint,4,opt,name=enable_upstream_stats,json=enableUpstreamStats,proto3" json:"enable_upstream_stats,omitempty"`
	// If true, the filter will replace dots in the grpc_service_name with underscores before emitting
	// the metrics. Only works when :ref:`stats_for_all_methods
	// <envoy_v3_api_field_extensions.filters.http.grpc_stats.v3.FilterConfig.stats_for_all_methods>`
	// is set to true. It could cause metrics to be merged if the edited service name conflicts with
	// an existing service. For example there are both service "foo.bar" & "foo_bar" running.
	// This config can fix incorrect gRPC metrics with dots because the existing stats tag extractor
	// assumes no dots in the gRPC service name. By default this is set as false.
	ReplaceDotsInGrpcServiceName bool `protobuf:"varint,5,opt,name=replace_dots_in_grpc_service_name,json=replaceDotsInGrpcServiceName,proto3" json:"replace_dots_in_grpc_service_name,omitempty"`
	unknownFields                protoimpl.UnknownFields
	sizeCache                    protoimpl.SizeCache
}

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

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

func (*FilterConfig) ProtoMessage() {}

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

func (x *FilterConfig) GetEmitFilterState() bool {
	if x != nil {
		return x.EmitFilterState
	}
	return false
}

func (x *FilterConfig) GetPerMethodStatSpecifier() isFilterConfig_PerMethodStatSpecifier {
	if x != nil {
		return x.PerMethodStatSpecifier
	}
	return nil
}

func (x *FilterConfig) GetIndividualMethodStatsAllowlist() *v3.GrpcMethodList {
	if x != nil {
		if x, ok := x.PerMethodStatSpecifier.(*FilterConfig_IndividualMethodStatsAllowlist); ok {
			return x.IndividualMethodStatsAllowlist
		}
	}
	return nil
}

func (x *FilterConfig) GetStatsForAllMethods() *wrapperspb.BoolValue {
	if x != nil {
		if x, ok := x.PerMethodStatSpecifier.(*FilterConfig_StatsForAllMethods); ok {
			return x.StatsForAllMethods
		}
	}
	return nil
}

func (x *FilterConfig) GetEnableUpstreamStats() bool {
	if x != nil {
		return x.EnableUpstreamStats
	}
	return false
}

func (x *FilterConfig) GetReplaceDotsInGrpcServiceName() bool {
	if x != nil {
		return x.ReplaceDotsInGrpcServiceName
	}
	return false
}

type isFilterConfig_PerMethodStatSpecifier interface {
	isFilterConfig_PerMethodStatSpecifier()
}

type FilterConfig_IndividualMethodStatsAllowlist struct {
	// If set, specifies an allowlist of service/methods that will have individual stats
	// emitted for them. Any call that does not match the allowlist will be counted
	// in a stat with no method specifier: “cluster.<name>.grpc.*“.
	IndividualMethodStatsAllowlist *v3.GrpcMethodList `protobuf:"bytes,2,opt,name=individual_method_stats_allowlist,json=individualMethodStatsAllowlist,proto3,oneof"`
}

type FilterConfig_StatsForAllMethods struct {
	// If set to true, emit stats for all service/method names.
	//
	// If set to false, emit stats for all service/message types to the same stats without including
	// the service/method in the name, with prefix “cluster.<name>.grpc“. This can be useful if
	// service/method granularity is not needed, or if each cluster only receives a single method.
	//
	// .. attention::
	//
	//	This option is only safe if all clients are trusted. If this option is enabled
	//	with untrusted clients, the clients could cause unbounded growth in the number of stats in
	//	Envoy, using unbounded memory and potentially slowing down stats pipelines.
	//
	// .. attention::
	//
	//	If neither ``individual_method_stats_allowlist`` nor ``stats_for_all_methods`` is set, the
	//	behavior will default to ``stats_for_all_methods=false``.
	StatsForAllMethods *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=stats_for_all_methods,json=statsForAllMethods,proto3,oneof"`
}

func (*FilterConfig_IndividualMethodStatsAllowlist) isFilterConfig_PerMethodStatSpecifier() {}

func (*FilterConfig_StatsForAllMethods) isFilterConfig_PerMethodStatSpecifier() {}

// gRPC statistics filter state object in protobuf form.
type FilterObject struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Count of request messages in the request stream.
	RequestMessageCount uint64 `protobuf:"varint,1,opt,name=request_message_count,json=requestMessageCount,proto3" json:"request_message_count,omitempty"`
	// Count of response messages in the response stream.
	ResponseMessageCount uint64 `protobuf:"varint,2,opt,name=response_message_count,json=responseMessageCount,proto3" json:"response_message_count,omitempty"`
	unknownFields        protoimpl.UnknownFields
	sizeCache            protoimpl.SizeCache
}

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

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

func (*FilterObject) ProtoMessage() {}

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

func (x *FilterObject) GetRequestMessageCount() uint64 {
	if x != nil {
		return x.RequestMessageCount
	}
	return 0
}

func (x *FilterObject) GetResponseMessageCount() uint64 {
	if x != nil {
		return x.ResponseMessageCount
	}
	return 0
}

var File_envoy_extensions_filters_http_grpc_stats_v3_config_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDesc = "" +
	"\n" +
	"8envoy/extensions/filters/http/grpc_stats/v3/config.proto\x12+envoy.extensions.filters.http.grpc_stats.v3\x1a+envoy/config/core/v3/grpc_method_list.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\"\xd9\x03\n" +
	"\fFilterConfig\x12*\n" +
	"\x11emit_filter_state\x18\x01 \x01(\bR\x0femitFilterState\x12q\n" +
	"!individual_method_stats_allowlist\x18\x02 \x01(\v2$.envoy.config.core.v3.GrpcMethodListH\x00R\x1eindividualMethodStatsAllowlist\x12O\n" +
	"\x15stats_for_all_methods\x18\x03 \x01(\v2\x1a.google.protobuf.BoolValueH\x00R\x12statsForAllMethods\x122\n" +
	"\x15enable_upstream_stats\x18\x04 \x01(\bR\x13enableUpstreamStats\x12G\n" +
	"!replace_dots_in_grpc_service_name\x18\x05 \x01(\bR\x1creplaceDotsInGrpcServiceName:?\x9aň\x1e:\n" +
	"8envoy.config.filter.http.grpc_stats.v2alpha.FilterConfigB\x1b\n" +
	"\x19per_method_stat_specifier\"\xb9\x01\n" +
	"\fFilterObject\x122\n" +
	"\x15request_message_count\x18\x01 \x01(\x04R\x13requestMessageCount\x124\n" +
	"\x16response_message_count\x18\x02 \x01(\x04R\x14responseMessageCount:?\x9aň\x1e:\n" +
	"8envoy.config.filter.http.grpc_stats.v2alpha.FilterObjectB\xb3\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"9io.envoyproxy.envoy.extensions.filters.http.grpc_stats.v3B\vConfigProtoP\x01Z_github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/grpc_stats/v3;grpc_statsv3b\x06proto3"

var (
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDesc), len(file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDescData
}

var file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_goTypes = []any{
	(*FilterConfig)(nil),         // 0: envoy.extensions.filters.http.grpc_stats.v3.FilterConfig
	(*FilterObject)(nil),         // 1: envoy.extensions.filters.http.grpc_stats.v3.FilterObject
	(*v3.GrpcMethodList)(nil),    // 2: envoy.config.core.v3.GrpcMethodList
	(*wrapperspb.BoolValue)(nil), // 3: google.protobuf.BoolValue
}
var file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.grpc_stats.v3.FilterConfig.individual_method_stats_allowlist:type_name -> envoy.config.core.v3.GrpcMethodList
	3, // 1: envoy.extensions.filters.http.grpc_stats.v3.FilterConfig.stats_for_all_methods:type_name -> google.protobuf.BoolValue
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_init() }
func file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_init() {
	if File_envoy_extensions_filters_http_grpc_stats_v3_config_proto != nil {
		return
	}
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_msgTypes[0].OneofWrappers = []any{
		(*FilterConfig_IndividualMethodStatsAllowlist)(nil),
		(*FilterConfig_StatsForAllMethods)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDesc), len(file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_grpc_stats_v3_config_proto = out.File
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_goTypes = nil
	file_envoy_extensions_filters_http_grpc_stats_v3_config_proto_depIdxs = nil
}
