// 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/admission_control/v3/admission_control.proto

package admission_controlv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	v31 "github.com/envoyproxy/go-control-plane/envoy/type/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: 8]
type AdmissionControl struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// If set to false, the admission control filter will operate as a pass-through filter. If the
	// message is unspecified, the filter will be enabled.
	Enabled *v3.RuntimeFeatureFlag `protobuf:"bytes,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// Defines how a request is considered a success/failure.
	//
	// Types that are valid to be assigned to EvaluationCriteria:
	//
	//	*AdmissionControl_SuccessCriteria_
	EvaluationCriteria isAdmissionControl_EvaluationCriteria `protobuf_oneof:"evaluation_criteria"`
	// The sliding time window over which the success rate is calculated. The window is rounded to the
	// nearest second. Defaults to 30s.
	SamplingWindow *durationpb.Duration `protobuf:"bytes,3,opt,name=sampling_window,json=samplingWindow,proto3" json:"sampling_window,omitempty"`
	// Rejection probability is defined by the formula::
	//
	//	max(0, (rq_count -  rq_success_count / sr_threshold) / (rq_count + 1)) ^ (1 / aggression)
	//
	// The aggression dictates how heavily the admission controller will throttle requests upon SR
	// dropping at or below the threshold. A value of 1 will result in a linear increase in
	// rejection probability as SR drops. Any values less than 1.0, will be set to 1.0. If the
	// message is unspecified, the aggression is 1.0. See `the admission control documentation
	// <https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/admission_control_filter.html>`_
	// for a diagram illustrating this.
	Aggression *v3.RuntimeDouble `protobuf:"bytes,4,opt,name=aggression,proto3" json:"aggression,omitempty"`
	// Dictates the success rate at which the rejection probability is non-zero. As success rate drops
	// below this threshold, rejection probability will increase. Any success rate above the threshold
	// results in a rejection probability of 0. Defaults to 95%.
	SrThreshold *v3.RuntimePercent `protobuf:"bytes,5,opt,name=sr_threshold,json=srThreshold,proto3" json:"sr_threshold,omitempty"`
	// If the average RPS of the sampling window is below this threshold, the request
	// will not be rejected, even if the success rate is lower than sr_threshold.
	// Defaults to 0.
	RpsThreshold *v3.RuntimeUInt32 `protobuf:"bytes,6,opt,name=rps_threshold,json=rpsThreshold,proto3" json:"rps_threshold,omitempty"`
	// The probability of rejection will never exceed this value, even if the failure rate is rising.
	// Defaults to 80%.
	MaxRejectionProbability *v3.RuntimePercent `protobuf:"bytes,7,opt,name=max_rejection_probability,json=maxRejectionProbability,proto3" json:"max_rejection_probability,omitempty"`
	unknownFields           protoimpl.UnknownFields
	sizeCache               protoimpl.SizeCache
}

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

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

func (*AdmissionControl) ProtoMessage() {}

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

func (x *AdmissionControl) GetEnabled() *v3.RuntimeFeatureFlag {
	if x != nil {
		return x.Enabled
	}
	return nil
}

func (x *AdmissionControl) GetEvaluationCriteria() isAdmissionControl_EvaluationCriteria {
	if x != nil {
		return x.EvaluationCriteria
	}
	return nil
}

func (x *AdmissionControl) GetSuccessCriteria() *AdmissionControl_SuccessCriteria {
	if x != nil {
		if x, ok := x.EvaluationCriteria.(*AdmissionControl_SuccessCriteria_); ok {
			return x.SuccessCriteria
		}
	}
	return nil
}

func (x *AdmissionControl) GetSamplingWindow() *durationpb.Duration {
	if x != nil {
		return x.SamplingWindow
	}
	return nil
}

func (x *AdmissionControl) GetAggression() *v3.RuntimeDouble {
	if x != nil {
		return x.Aggression
	}
	return nil
}

func (x *AdmissionControl) GetSrThreshold() *v3.RuntimePercent {
	if x != nil {
		return x.SrThreshold
	}
	return nil
}

func (x *AdmissionControl) GetRpsThreshold() *v3.RuntimeUInt32 {
	if x != nil {
		return x.RpsThreshold
	}
	return nil
}

func (x *AdmissionControl) GetMaxRejectionProbability() *v3.RuntimePercent {
	if x != nil {
		return x.MaxRejectionProbability
	}
	return nil
}

type isAdmissionControl_EvaluationCriteria interface {
	isAdmissionControl_EvaluationCriteria()
}

type AdmissionControl_SuccessCriteria_ struct {
	SuccessCriteria *AdmissionControl_SuccessCriteria `protobuf:"bytes,2,opt,name=success_criteria,json=successCriteria,proto3,oneof"`
}

func (*AdmissionControl_SuccessCriteria_) isAdmissionControl_EvaluationCriteria() {}

// Default method of specifying what constitutes a successful request. All status codes that
// indicate a successful request must be explicitly specified if not relying on the default
// values.
type AdmissionControl_SuccessCriteria struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// If HTTP criteria are unspecified, all HTTP status codes below 500 are treated as successful
	// responses.
	//
	// .. note::
	//
	//	The default HTTP codes considered successful by the admission controller are done so due
	//	to the unlikelihood that sending fewer requests would change their behavior (for example:
	//	redirects, unauthorized access, or bad requests won't be alleviated by sending less
	//	traffic).
	HttpCriteria *AdmissionControl_SuccessCriteria_HttpCriteria `protobuf:"bytes,1,opt,name=http_criteria,json=httpCriteria,proto3" json:"http_criteria,omitempty"`
	// GRPC status codes to consider as request successes. If unspecified, defaults to: Ok,
	// Cancelled, Unknown, InvalidArgument, NotFound, AlreadyExists, Unauthenticated,
	// FailedPrecondition, OutOfRange, PermissionDenied, and Unimplemented.
	//
	// .. note::
	//
	//	The default gRPC codes that are considered successful by the admission controller are
	//	chosen because of the unlikelihood that sending fewer requests will change the behavior.
	GrpcCriteria  *AdmissionControl_SuccessCriteria_GrpcCriteria `protobuf:"bytes,2,opt,name=grpc_criteria,json=grpcCriteria,proto3" json:"grpc_criteria,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*AdmissionControl_SuccessCriteria) ProtoMessage() {}

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

func (x *AdmissionControl_SuccessCriteria) GetHttpCriteria() *AdmissionControl_SuccessCriteria_HttpCriteria {
	if x != nil {
		return x.HttpCriteria
	}
	return nil
}

func (x *AdmissionControl_SuccessCriteria) GetGrpcCriteria() *AdmissionControl_SuccessCriteria_GrpcCriteria {
	if x != nil {
		return x.GrpcCriteria
	}
	return nil
}

type AdmissionControl_SuccessCriteria_HttpCriteria struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Status code ranges that constitute a successful request. Configurable codes are in the
	// range [100, 600).
	HttpSuccessStatus []*v31.Int32Range `protobuf:"bytes,1,rep,name=http_success_status,json=httpSuccessStatus,proto3" json:"http_success_status,omitempty"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

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

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

func (*AdmissionControl_SuccessCriteria_HttpCriteria) ProtoMessage() {}

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

func (x *AdmissionControl_SuccessCriteria_HttpCriteria) GetHttpSuccessStatus() []*v31.Int32Range {
	if x != nil {
		return x.HttpSuccessStatus
	}
	return nil
}

type AdmissionControl_SuccessCriteria_GrpcCriteria struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Status codes that constitute a successful request.
	// Mappings can be found at: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md.
	GrpcSuccessStatus []uint32 `protobuf:"varint,1,rep,packed,name=grpc_success_status,json=grpcSuccessStatus,proto3" json:"grpc_success_status,omitempty"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

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

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

func (*AdmissionControl_SuccessCriteria_GrpcCriteria) ProtoMessage() {}

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

func (x *AdmissionControl_SuccessCriteria_GrpcCriteria) GetGrpcSuccessStatus() []uint32 {
	if x != nil {
		return x.GrpcSuccessStatus
	}
	return nil
}

var File_envoy_extensions_filters_http_admission_control_v3_admission_control_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDesc = "" +
	"\n" +
	"Jenvoy/extensions/filters/http/admission_control/v3/admission_control.proto\x122envoy.extensions.filters.http.admission_control.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a\x19envoy/type/v3/range.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xc9\b\n" +
	"\x10AdmissionControl\x12B\n" +
	"\aenabled\x18\x01 \x01(\v2(.envoy.config.core.v3.RuntimeFeatureFlagR\aenabled\x12\x81\x01\n" +
	"\x10success_criteria\x18\x02 \x01(\v2T.envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteriaH\x00R\x0fsuccessCriteria\x12B\n" +
	"\x0fsampling_window\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x0esamplingWindow\x12C\n" +
	"\n" +
	"aggression\x18\x04 \x01(\v2#.envoy.config.core.v3.RuntimeDoubleR\n" +
	"aggression\x12G\n" +
	"\fsr_threshold\x18\x05 \x01(\v2$.envoy.config.core.v3.RuntimePercentR\vsrThreshold\x12H\n" +
	"\rrps_threshold\x18\x06 \x01(\v2#.envoy.config.core.v3.RuntimeUInt32R\frpsThreshold\x12`\n" +
	"\x19max_rejection_probability\x18\a \x01(\v2$.envoy.config.core.v3.RuntimePercentR\x17maxRejectionProbability\x1a\xd2\x03\n" +
	"\x0fSuccessCriteria\x12\x86\x01\n" +
	"\rhttp_criteria\x18\x01 \x01(\v2a.envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.HttpCriteriaR\fhttpCriteria\x12\x86\x01\n" +
	"\rgrpc_criteria\x18\x02 \x01(\v2a.envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.GrpcCriteriaR\fgrpcCriteria\x1ac\n" +
	"\fHttpCriteria\x12S\n" +
	"\x13http_success_status\x18\x01 \x03(\v2\x19.envoy.type.v3.Int32RangeB\b\xfaB\x05\x92\x01\x02\b\x01R\x11httpSuccessStatus\x1aH\n" +
	"\fGrpcCriteria\x128\n" +
	"\x13grpc_success_status\x18\x01 \x03(\rB\b\xfaB\x05\x92\x01\x02\b\x01R\x11grpcSuccessStatusB\x1a\n" +
	"\x13evaluation_criteria\x12\x03\xf8B\x01B\xd2\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"@io.envoyproxy.envoy.extensions.filters.http.admission_control.v3B\x15AdmissionControlProtoP\x01Zmgithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/admission_control/v3;admission_controlv3b\x06proto3"

var (
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDesc), len(file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDescData
}

var file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_goTypes = []any{
	(*AdmissionControl)(nil),                              // 0: envoy.extensions.filters.http.admission_control.v3.AdmissionControl
	(*AdmissionControl_SuccessCriteria)(nil),              // 1: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria
	(*AdmissionControl_SuccessCriteria_HttpCriteria)(nil), // 2: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.HttpCriteria
	(*AdmissionControl_SuccessCriteria_GrpcCriteria)(nil), // 3: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.GrpcCriteria
	(*v3.RuntimeFeatureFlag)(nil),                         // 4: envoy.config.core.v3.RuntimeFeatureFlag
	(*durationpb.Duration)(nil),                           // 5: google.protobuf.Duration
	(*v3.RuntimeDouble)(nil),                              // 6: envoy.config.core.v3.RuntimeDouble
	(*v3.RuntimePercent)(nil),                             // 7: envoy.config.core.v3.RuntimePercent
	(*v3.RuntimeUInt32)(nil),                              // 8: envoy.config.core.v3.RuntimeUInt32
	(*v31.Int32Range)(nil),                                // 9: envoy.type.v3.Int32Range
}
var file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_depIdxs = []int32{
	4,  // 0: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.enabled:type_name -> envoy.config.core.v3.RuntimeFeatureFlag
	1,  // 1: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.success_criteria:type_name -> envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria
	5,  // 2: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.sampling_window:type_name -> google.protobuf.Duration
	6,  // 3: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.aggression:type_name -> envoy.config.core.v3.RuntimeDouble
	7,  // 4: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.sr_threshold:type_name -> envoy.config.core.v3.RuntimePercent
	8,  // 5: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.rps_threshold:type_name -> envoy.config.core.v3.RuntimeUInt32
	7,  // 6: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.max_rejection_probability:type_name -> envoy.config.core.v3.RuntimePercent
	2,  // 7: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.http_criteria:type_name -> envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.HttpCriteria
	3,  // 8: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.grpc_criteria:type_name -> envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.GrpcCriteria
	9,  // 9: envoy.extensions.filters.http.admission_control.v3.AdmissionControl.SuccessCriteria.HttpCriteria.http_success_status:type_name -> envoy.type.v3.Int32Range
	10, // [10:10] is the sub-list for method output_type
	10, // [10:10] is the sub-list for method input_type
	10, // [10:10] is the sub-list for extension type_name
	10, // [10:10] is the sub-list for extension extendee
	0,  // [0:10] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_init() }
func file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_init() {
	if File_envoy_extensions_filters_http_admission_control_v3_admission_control_proto != nil {
		return
	}
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_msgTypes[0].OneofWrappers = []any{
		(*AdmissionControl_SuccessCriteria_)(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_admission_control_v3_admission_control_proto_rawDesc), len(file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_admission_control_v3_admission_control_proto = out.File
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_goTypes = nil
	file_envoy_extensions_filters_http_admission_control_v3_admission_control_proto_depIdxs = nil
}
