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

package bandwidth_sharev3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/cncf/xds/go/xds/type/matcher/v3"
	v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	durationpb "google.golang.org/protobuf/types/known/durationpb"
	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)
)

// [#next-free-field: 9]
type BandwidthShare struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Configuration for request limiting. If unset, requests are not limited.
	// If “kbps“ is zero, requests are not limited.
	RequestLimit *BandwidthShare_Limit `protobuf:"bytes,1,opt,name=request_limit,json=requestLimit,proto3" json:"request_limit,omitempty"`
	// Configuration for response limiting. If unset, responses are not limited.
	// If “kbps“ is zero, responses are not limited.
	ResponseLimit *BandwidthShare_Limit `protobuf:"bytes,2,opt,name=response_limit,json=responseLimit,proto3" json:"response_limit,omitempty"`
	// Optional fill interval in milliseconds for the token refills. Defaults to 50ms.
	// It must be at least 20ms to avoid too aggressive refills.
	//
	// Lower values will use more CPU and provide smoother bandwidth distribution
	// when the limit is being enforced.
	FillInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=fill_interval,json=fillInterval,proto3" json:"fill_interval,omitempty"`
	// Enable response trailers.
	//
	// .. note::
	//
	//	If set true, the following 4 trailers will be added, prefixed by ``response_trailer_prefix``:
	//	* bandwidth-request-delay-ms: delay time in milliseconds added by the limiter.
	//	* bandwidth-response-delay-ms: delay time in milliseconds added by the limiter.
	//	* bandwidth-request-duration-ms: total duration of receiving and processing the request.
	//	* bandwidth-response-duration-ms: total duration of receiving and processing the response.
	//
	//	If ``response_limit`` is unset or has ``kbps`` of 0, the trailers will not be set.
	//
	//	If both the request and response delay time is 0, the trailers will not be set.
	//
	//	Note that the delay time may overlap with other factors such that it may not actually
	//	increase the duration by the stated amount - for example, the source data may still be
	//	arriving into a buffer during the artificial delay, such that it's possible to fully
	//	"catch up" the lost time by reading from that buffer at a later, less-constrained time.
	EnableResponseTrailers bool `protobuf:"varint,4,opt,name=enable_response_trailers,json=enableResponseTrailers,proto3" json:"enable_response_trailers,omitempty"`
	// The prefix for the response trailers. Empty string is a valid prefix.
	//
	// If set, “enable_response_trailers“ must be true.
	//
	// For example, if this value is “x-banana-“ then the trailer keys will be
	// “x-banana-bandwidth-request-delay-ms“, “x-banana-bandwidth-response-duration-ms“,
	// etc.
	ResponseTrailerPrefix string `protobuf:"bytes,5,opt,name=response_trailer_prefix,json=responseTrailerPrefix,proto3" json:"response_trailer_prefix,omitempty"`
	// An optional matcher which returns a string to use as a tenant name.
	//
	// If unset, the tenant name will always be the empty string, and all requests will
	// have equal weight when limiting is being enforced.
	//
	// If tenant names are set when limiting is being enforced, traffic may be
	// distributed unevenly - for example, assuming all requests want all possible
	// bandwidth, if there are five streams with tenant “foo“ and two streams with
	// tenant “bar“, and no custom weights, “foo“ and “bar“ will get an equal
	// share of the bandwidth (half), then the requests within each tenant will get
	// an equal share of that tenant's share, i.e. the “foo“ requests will each
	// get a fifth of the “foo“ half, a tenth of the total, and the “bar“ requests
	// will each get half of the “bar“ half, a quarter of the total.
	//
	// An example way this might be used is to have “tenant_name_selector“ make
	// each source IP address a tenant. Then if one source IP is trying to make 100
	// requests in parallel, and 99 other IPs are making one request each, the
	// total bandwidth distribution (assuming the limit is being exceeded) would
	// be equal per IP, versus with no tenants it would be equal per request and
	// the greedy IP address would be getting 100x more bandwidth than the others.
	//
	// Note that if the limit is not consistently exceeded, all available bandwidth
	// is still distributed - so in this case if the 99 other IPs were only using
	// half the available bandwidth total between them, the greedy IP would still
	// be able to get 50x more bandwidth than the rest. In this example the value is
	// clearer - the less greedy tenants get all the bandwidth they want, and
	// only the greedy tenant gets throttled, vs. without tenants all the requests
	// would be throttled equally.
	TenantNameSelector *v3.Matcher `protobuf:"bytes,6,opt,name=tenant_name_selector,json=tenantNameSelector,proto3" json:"tenant_name_selector,omitempty"`
	// A map from tenant names to configurations. If a tenant name is not present
	// in the map, “default_tenant_config“ is used.
	TenantConfigs map[string]*BandwidthShare_TenantConfig `protobuf:"bytes,7,rep,name=tenant_configs,json=tenantConfigs,proto3" json:"tenant_configs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// Optional configuration override for the default tenant. If unset, the
	// default values are used.
	DefaultTenantConfig *BandwidthShare_TenantConfig `protobuf:"bytes,8,opt,name=default_tenant_config,json=defaultTenantConfig,proto3" json:"default_tenant_config,omitempty"`
	unknownFields       protoimpl.UnknownFields
	sizeCache           protoimpl.SizeCache
}

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

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

func (*BandwidthShare) ProtoMessage() {}

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

func (x *BandwidthShare) GetRequestLimit() *BandwidthShare_Limit {
	if x != nil {
		return x.RequestLimit
	}
	return nil
}

func (x *BandwidthShare) GetResponseLimit() *BandwidthShare_Limit {
	if x != nil {
		return x.ResponseLimit
	}
	return nil
}

func (x *BandwidthShare) GetFillInterval() *durationpb.Duration {
	if x != nil {
		return x.FillInterval
	}
	return nil
}

func (x *BandwidthShare) GetEnableResponseTrailers() bool {
	if x != nil {
		return x.EnableResponseTrailers
	}
	return false
}

func (x *BandwidthShare) GetResponseTrailerPrefix() string {
	if x != nil {
		return x.ResponseTrailerPrefix
	}
	return ""
}

func (x *BandwidthShare) GetTenantNameSelector() *v3.Matcher {
	if x != nil {
		return x.TenantNameSelector
	}
	return nil
}

func (x *BandwidthShare) GetTenantConfigs() map[string]*BandwidthShare_TenantConfig {
	if x != nil {
		return x.TenantConfigs
	}
	return nil
}

func (x *BandwidthShare) GetDefaultTenantConfig() *BandwidthShare_TenantConfig {
	if x != nil {
		return x.DefaultTenantConfig
	}
	return nil
}

type BandwidthShare_TenantConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Weight of the tenant. For example, if two tenants are competing for
	// limited bandwidth, one has weight=3 and the other has weight=1, the
	// contested bandwidth will be distributed 3/4 to the weight=3 tenant
	// and 1/4 to the weight=1 tenant.
	//
	// If unset or 0, the default weight of 1 will be used.
	Weight uint32 `protobuf:"varint,1,opt,name=weight,proto3" json:"weight,omitempty"`
	// True to record stats with “tenant“ tag set to the tenant name.
	// If false or unset, the stats tag will be empty. It is recommended not
	// to set this to default true if tenant names are dynamically generated
	// from untrusted sources (or otherwise with unlimited scope), to
	// avoid creating unlimited stats cardinality.
	IncludeStatsTag bool `protobuf:"varint,2,opt,name=include_stats_tag,json=includeStatsTag,proto3" json:"include_stats_tag,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*BandwidthShare_TenantConfig) ProtoMessage() {}

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

func (x *BandwidthShare_TenantConfig) GetWeight() uint32 {
	if x != nil {
		return x.Weight
	}
	return 0
}

func (x *BandwidthShare_TenantConfig) GetIncludeStatsTag() bool {
	if x != nil {
		return x.IncludeStatsTag
	}
	return false
}

type BandwidthShare_Limit struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The unique id of the limiter. Should be set if you want to apply distinct
	// limits on different listeners, or distinct limits for requests and responses.
	// With matching “bucket_id“ values, multiple listeners can share a single limit
	// (e.g. for https and http listener that share a network bandwidth constraint).
	//
	// Also used for the “bucket_id“ stats tag.
	//
	// The empty string is a valid “bucket_id“.
	BucketId string `protobuf:"bytes,1,opt,name=bucket_id,json=bucketId,proto3" json:"bucket_id,omitempty"`
	// The limit supplied in KiB/s.
	//
	// .. note::
	//
	//	The limit is associated with the ``bucket_id``. If the same ``bucket_id``
	//	is used in multiple listeners/routes, it is a config error for the
	//	configurations to not be identical. If the configuration is updated
	//	dynamically via xds, changing the runtime key, the ``bucket_id`` must
	//	also be changed or it is a config error.
	//
	// The limit can be updated dynamically via runtime. Setting the limit
	// to zero, or unset, disables the filter.
	Kbps          *v31.RuntimeUInt32 `protobuf:"bytes,2,opt,name=kbps,proto3" json:"kbps,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*BandwidthShare_Limit) ProtoMessage() {}

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

func (x *BandwidthShare_Limit) GetBucketId() string {
	if x != nil {
		return x.BucketId
	}
	return ""
}

func (x *BandwidthShare_Limit) GetKbps() *v31.RuntimeUInt32 {
	if x != nil {
		return x.Kbps
	}
	return nil
}

var File_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDesc = "" +
	"\n" +
	"Fenvoy/extensions/filters/http/bandwidth_share/v3/bandwidth_share.proto\x120envoy.extensions.filters.http.bandwidth_share.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a\x1egoogle/protobuf/duration.proto\x1a!xds/type/matcher/v3/matcher.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xdd\b\n" +
	"\x0eBandwidthShare\x12k\n" +
	"\rrequest_limit\x18\x01 \x01(\v2F.envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.LimitR\frequestLimit\x12m\n" +
	"\x0eresponse_limit\x18\x02 \x01(\v2F.envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.LimitR\rresponseLimit\x12Q\n" +
	"\rfill_interval\x18\x03 \x01(\v2\x19.google.protobuf.DurationB\x11\xfaB\x0e\xaa\x01\v\"\x02\b\x012\x05\x10\x80\xda\xc4\tR\ffillInterval\x128\n" +
	"\x18enable_response_trailers\x18\x04 \x01(\bR\x16enableResponseTrailers\x12C\n" +
	"\x17response_trailer_prefix\x18\x05 \x01(\tB\v\xfaB\br\x06\xc8\x01\x00\xc0\x01\x01R\x15responseTrailerPrefix\x12N\n" +
	"\x14tenant_name_selector\x18\x06 \x01(\v2\x1c.xds.type.matcher.v3.MatcherR\x12tenantNameSelector\x12z\n" +
	"\x0etenant_configs\x18\a \x03(\v2S.envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigsEntryR\rtenantConfigs\x12\x81\x01\n" +
	"\x15default_tenant_config\x18\b \x01(\v2M.envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigR\x13defaultTenantConfig\x1aR\n" +
	"\fTenantConfig\x12\x16\n" +
	"\x06weight\x18\x01 \x01(\rR\x06weight\x12*\n" +
	"\x11include_stats_tag\x18\x02 \x01(\bR\x0fincludeStatsTag\x1ag\n" +
	"\x05Limit\x12\x1b\n" +
	"\tbucket_id\x18\x01 \x01(\tR\bbucketId\x12A\n" +
	"\x04kbps\x18\x02 \x01(\v2#.envoy.config.core.v3.RuntimeUInt32B\b\xfaB\x05\x8a\x01\x02\x10\x01R\x04kbps\x1a\x8f\x01\n" +
	"\x12TenantConfigsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12c\n" +
	"\x05value\x18\x02 \x01(\v2M.envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigR\x05value:\x028\x01B\xca\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	">io.envoyproxy.envoy.extensions.filters.http.bandwidth_share.v3B\x13BandwidthShareProtoP\x01Zigithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/bandwidth_share/v3;bandwidth_sharev3b\x06proto3"

var (
	file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDesc), len(file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDescData
}

var file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_goTypes = []any{
	(*BandwidthShare)(nil),              // 0: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare
	(*BandwidthShare_TenantConfig)(nil), // 1: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfig
	(*BandwidthShare_Limit)(nil),        // 2: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.Limit
	nil,                                 // 3: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigsEntry
	(*durationpb.Duration)(nil),         // 4: google.protobuf.Duration
	(*v3.Matcher)(nil),                  // 5: xds.type.matcher.v3.Matcher
	(*v31.RuntimeUInt32)(nil),           // 6: envoy.config.core.v3.RuntimeUInt32
}
var file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.request_limit:type_name -> envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.Limit
	2, // 1: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.response_limit:type_name -> envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.Limit
	4, // 2: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.fill_interval:type_name -> google.protobuf.Duration
	5, // 3: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.tenant_name_selector:type_name -> xds.type.matcher.v3.Matcher
	3, // 4: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.tenant_configs:type_name -> envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigsEntry
	1, // 5: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.default_tenant_config:type_name -> envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfig
	6, // 6: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.Limit.kbps:type_name -> envoy.config.core.v3.RuntimeUInt32
	1, // 7: envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfigsEntry.value:type_name -> envoy.extensions.filters.http.bandwidth_share.v3.BandwidthShare.TenantConfig
	8, // [8:8] is the sub-list for method output_type
	8, // [8:8] is the sub-list for method input_type
	8, // [8:8] is the sub-list for extension type_name
	8, // [8:8] is the sub-list for extension extendee
	0, // [0:8] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_init() }
func file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_init() {
	if File_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDesc), len(file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto = out.File
	file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_goTypes = nil
	file_envoy_extensions_filters_http_bandwidth_share_v3_bandwidth_share_proto_depIdxs = nil
}
