// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v3.21.12
// source: yandex/cloud/apploadbalancer/v1/rate_limit.proto

package apploadbalancer

import (
	_ "github.com/yandex-cloud/go-genproto/yandex/cloud"
	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)
)

// RateLimit is a set of settings for global rate limiting.
type RateLimit struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// AllRequests is a rate limit configuration applied to all incoming requests.
	AllRequests *RateLimit_Limit `protobuf:"bytes,3,opt,name=all_requests,json=allRequests,proto3" json:"all_requests,omitempty"`
	// RequestsPerIp is a rate limit configuration applied separately for each set of requests
	// grouped by client IP address.
	RequestsPerIp *RateLimit_Limit `protobuf:"bytes,4,opt,name=requests_per_ip,json=requestsPerIp,proto3" json:"requests_per_ip,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*RateLimit) ProtoMessage() {}

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

func (x *RateLimit) GetAllRequests() *RateLimit_Limit {
	if x != nil {
		return x.AllRequests
	}
	return nil
}

func (x *RateLimit) GetRequestsPerIp() *RateLimit_Limit {
	if x != nil {
		return x.RequestsPerIp
	}
	return nil
}

// Limit is a rate limit value settings.
type RateLimit_Limit struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Rate:
	//
	//	*RateLimit_Limit_PerSecond
	//	*RateLimit_Limit_PerMinute
	Rate          isRateLimit_Limit_Rate `protobuf_oneof:"rate"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*RateLimit_Limit) ProtoMessage() {}

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

func (x *RateLimit_Limit) GetRate() isRateLimit_Limit_Rate {
	if x != nil {
		return x.Rate
	}
	return nil
}

func (x *RateLimit_Limit) GetPerSecond() int64 {
	if x != nil {
		if x, ok := x.Rate.(*RateLimit_Limit_PerSecond); ok {
			return x.PerSecond
		}
	}
	return 0
}

func (x *RateLimit_Limit) GetPerMinute() int64 {
	if x != nil {
		if x, ok := x.Rate.(*RateLimit_Limit_PerMinute); ok {
			return x.PerMinute
		}
	}
	return 0
}

type isRateLimit_Limit_Rate interface {
	isRateLimit_Limit_Rate()
}

type RateLimit_Limit_PerSecond struct {
	// PerSecond is a limit value specified with per second time unit.
	PerSecond int64 `protobuf:"varint,1,opt,name=per_second,json=perSecond,proto3,oneof"`
}

type RateLimit_Limit_PerMinute struct {
	// PerMinute is a limit value specified with per minute time unit.
	PerMinute int64 `protobuf:"varint,2,opt,name=per_minute,json=perMinute,proto3,oneof"`
}

func (*RateLimit_Limit_PerSecond) isRateLimit_Limit_Rate() {}

func (*RateLimit_Limit_PerMinute) isRateLimit_Limit_Rate() {}

var File_yandex_cloud_apploadbalancer_v1_rate_limit_proto protoreflect.FileDescriptor

const file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDesc = "" +
	"\n" +
	"0yandex/cloud/apploadbalancer/v1/rate_limit.proto\x12\x1fyandex.cloud.apploadbalancer.v1\x1a\x1dyandex/cloud/validation.proto\"\xa3\x02\n" +
	"\tRateLimit\x12S\n" +
	"\fall_requests\x18\x03 \x01(\v20.yandex.cloud.apploadbalancer.v1.RateLimit.LimitR\vallRequests\x12X\n" +
	"\x0frequests_per_ip\x18\x04 \x01(\v20.yandex.cloud.apploadbalancer.v1.RateLimit.LimitR\rrequestsPerIp\x1ag\n" +
	"\x05Limit\x12'\n" +
	"\n" +
	"per_second\x18\x01 \x01(\x03B\x06\xfa\xc71\x02>0H\x00R\tperSecond\x12'\n" +
	"\n" +
	"per_minute\x18\x02 \x01(\x03B\x06\xfa\xc71\x02>0H\x00R\tperMinuteB\f\n" +
	"\x04rate\x12\x04\xc0\xc11\x01Bz\n" +
	"#yandex.cloud.api.apploadbalancer.v1ZSgithub.com/yandex-cloud/go-genproto/yandex/cloud/apploadbalancer/v1;apploadbalancerb\x06proto3"

var (
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescOnce sync.Once
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescData []byte
)

func file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescGZIP() []byte {
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescOnce.Do(func() {
		file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDesc), len(file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDesc)))
	})
	return file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDescData
}

var file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_goTypes = []any{
	(*RateLimit)(nil),       // 0: yandex.cloud.apploadbalancer.v1.RateLimit
	(*RateLimit_Limit)(nil), // 1: yandex.cloud.apploadbalancer.v1.RateLimit.Limit
}
var file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_depIdxs = []int32{
	1, // 0: yandex.cloud.apploadbalancer.v1.RateLimit.all_requests:type_name -> yandex.cloud.apploadbalancer.v1.RateLimit.Limit
	1, // 1: yandex.cloud.apploadbalancer.v1.RateLimit.requests_per_ip:type_name -> yandex.cloud.apploadbalancer.v1.RateLimit.Limit
	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_yandex_cloud_apploadbalancer_v1_rate_limit_proto_init() }
func file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_init() {
	if File_yandex_cloud_apploadbalancer_v1_rate_limit_proto != nil {
		return
	}
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_msgTypes[1].OneofWrappers = []any{
		(*RateLimit_Limit_PerSecond)(nil),
		(*RateLimit_Limit_PerMinute)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDesc), len(file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_goTypes,
		DependencyIndexes: file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_depIdxs,
		MessageInfos:      file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_msgTypes,
	}.Build()
	File_yandex_cloud_apploadbalancer_v1_rate_limit_proto = out.File
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_goTypes = nil
	file_yandex_cloud_apploadbalancer_v1_rate_limit_proto_depIdxs = nil
}
