// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: annotations/ratelimit/ratelimit.proto

package ratelimit

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
	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)
)

// OperationType determines the kind of rate limit that will be applied to this
// RPC (i.e. read or write).
type OperationType int32

const (
	OperationType_OPERATION_TYPE_UNSPECIFIED OperationType = 0
	OperationType_OPERATION_TYPE_EXEMPT      OperationType = 1
	OperationType_OPERATION_TYPE_READ        OperationType = 2
	OperationType_OPERATION_TYPE_WRITE       OperationType = 3
)

// Enum value maps for OperationType.
var (
	OperationType_name = map[int32]string{
		0: "OPERATION_TYPE_UNSPECIFIED",
		1: "OPERATION_TYPE_EXEMPT",
		2: "OPERATION_TYPE_READ",
		3: "OPERATION_TYPE_WRITE",
	}
	OperationType_value = map[string]int32{
		"OPERATION_TYPE_UNSPECIFIED": 0,
		"OPERATION_TYPE_EXEMPT":      1,
		"OPERATION_TYPE_READ":        2,
		"OPERATION_TYPE_WRITE":       3,
	}
)

func (x OperationType) Enum() *OperationType {
	p := new(OperationType)
	*p = x
	return p
}

func (x OperationType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (OperationType) Descriptor() protoreflect.EnumDescriptor {
	return file_annotations_ratelimit_ratelimit_proto_enumTypes[0].Descriptor()
}

func (OperationType) Type() protoreflect.EnumType {
	return &file_annotations_ratelimit_ratelimit_proto_enumTypes[0]
}

func (x OperationType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use OperationType.Descriptor instead.
func (OperationType) EnumDescriptor() ([]byte, []int) {
	return file_annotations_ratelimit_ratelimit_proto_rawDescGZIP(), []int{0}
}

type OperationCategory int32

const (
	OperationCategory_OPERATION_CATEGORY_UNSPECIFIED      OperationCategory = 0
	OperationCategory_OPERATION_CATEGORY_ACL              OperationCategory = 1
	OperationCategory_OPERATION_CATEGORY_PEER_STREAM      OperationCategory = 2
	OperationCategory_OPERATION_CATEGORY_CONNECT_CA       OperationCategory = 3
	OperationCategory_OPERATION_CATEGORY_PARTITION        OperationCategory = 4
	OperationCategory_OPERATION_CATEGORY_PEERING          OperationCategory = 5
	OperationCategory_OPERATION_CATEGORY_SERVER_DISCOVERY OperationCategory = 6
	OperationCategory_OPERATION_CATEGORY_DATAPLANE        OperationCategory = 7
	OperationCategory_OPERATION_CATEGORY_DNS              OperationCategory = 8
	OperationCategory_OPERATION_CATEGORY_SUBSCRIBE        OperationCategory = 9
	OperationCategory_OPERATION_CATEGORY_OPERATOR         OperationCategory = 10
	OperationCategory_OPERATION_CATEGORY_RESOURCE         OperationCategory = 11
	OperationCategory_OPERATION_CATEGORY_CONFIGENTRY      OperationCategory = 12
)

// Enum value maps for OperationCategory.
var (
	OperationCategory_name = map[int32]string{
		0:  "OPERATION_CATEGORY_UNSPECIFIED",
		1:  "OPERATION_CATEGORY_ACL",
		2:  "OPERATION_CATEGORY_PEER_STREAM",
		3:  "OPERATION_CATEGORY_CONNECT_CA",
		4:  "OPERATION_CATEGORY_PARTITION",
		5:  "OPERATION_CATEGORY_PEERING",
		6:  "OPERATION_CATEGORY_SERVER_DISCOVERY",
		7:  "OPERATION_CATEGORY_DATAPLANE",
		8:  "OPERATION_CATEGORY_DNS",
		9:  "OPERATION_CATEGORY_SUBSCRIBE",
		10: "OPERATION_CATEGORY_OPERATOR",
		11: "OPERATION_CATEGORY_RESOURCE",
		12: "OPERATION_CATEGORY_CONFIGENTRY",
	}
	OperationCategory_value = map[string]int32{
		"OPERATION_CATEGORY_UNSPECIFIED":      0,
		"OPERATION_CATEGORY_ACL":              1,
		"OPERATION_CATEGORY_PEER_STREAM":      2,
		"OPERATION_CATEGORY_CONNECT_CA":       3,
		"OPERATION_CATEGORY_PARTITION":        4,
		"OPERATION_CATEGORY_PEERING":          5,
		"OPERATION_CATEGORY_SERVER_DISCOVERY": 6,
		"OPERATION_CATEGORY_DATAPLANE":        7,
		"OPERATION_CATEGORY_DNS":              8,
		"OPERATION_CATEGORY_SUBSCRIBE":        9,
		"OPERATION_CATEGORY_OPERATOR":         10,
		"OPERATION_CATEGORY_RESOURCE":         11,
		"OPERATION_CATEGORY_CONFIGENTRY":      12,
	}
)

func (x OperationCategory) Enum() *OperationCategory {
	p := new(OperationCategory)
	*p = x
	return p
}

func (x OperationCategory) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (OperationCategory) Descriptor() protoreflect.EnumDescriptor {
	return file_annotations_ratelimit_ratelimit_proto_enumTypes[1].Descriptor()
}

func (OperationCategory) Type() protoreflect.EnumType {
	return &file_annotations_ratelimit_ratelimit_proto_enumTypes[1]
}

func (x OperationCategory) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use OperationCategory.Descriptor instead.
func (OperationCategory) EnumDescriptor() ([]byte, []int) {
	return file_annotations_ratelimit_ratelimit_proto_rawDescGZIP(), []int{1}
}

// Spec describes the kind of rate limit that will be applied to this RPC.
type Spec struct {
	state             protoimpl.MessageState `protogen:"open.v1"`
	OperationType     OperationType          `protobuf:"varint,1,opt,name=operation_type,json=operationType,proto3,enum=hashicorp.consul.internal.ratelimit.OperationType" json:"operation_type,omitempty"`
	OperationCategory OperationCategory      `protobuf:"varint,2,opt,name=operation_category,json=operationCategory,proto3,enum=hashicorp.consul.internal.ratelimit.OperationCategory" json:"operation_category,omitempty"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

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

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

func (*Spec) ProtoMessage() {}

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

func (x *Spec) GetOperationType() OperationType {
	if x != nil {
		return x.OperationType
	}
	return OperationType_OPERATION_TYPE_UNSPECIFIED
}

func (x *Spec) GetOperationCategory() OperationCategory {
	if x != nil {
		return x.OperationCategory
	}
	return OperationCategory_OPERATION_CATEGORY_UNSPECIFIED
}

var file_annotations_ratelimit_ratelimit_proto_extTypes = []protoimpl.ExtensionInfo{
	{
		ExtendedType:  (*descriptorpb.MethodOptions)(nil),
		ExtensionType: (*Spec)(nil),
		Field:         8300,
		Name:          "hashicorp.consul.internal.ratelimit.spec",
		Tag:           "bytes,8300,opt,name=spec",
		Filename:      "annotations/ratelimit/ratelimit.proto",
	},
}

// Extension fields to descriptorpb.MethodOptions.
var (
	// optional hashicorp.consul.internal.ratelimit.Spec spec = 8300;
	E_Spec = &file_annotations_ratelimit_ratelimit_proto_extTypes[0]
)

var File_annotations_ratelimit_ratelimit_proto protoreflect.FileDescriptor

const file_annotations_ratelimit_ratelimit_proto_rawDesc = "" +
	"\n" +
	"%annotations/ratelimit/ratelimit.proto\x12#hashicorp.consul.internal.ratelimit\x1a google/protobuf/descriptor.proto\"\xc8\x01\n" +
	"\x04Spec\x12Y\n" +
	"\x0eoperation_type\x18\x01 \x01(\x0e22.hashicorp.consul.internal.ratelimit.OperationTypeR\roperationType\x12e\n" +
	"\x12operation_category\x18\x02 \x01(\x0e26.hashicorp.consul.internal.ratelimit.OperationCategoryR\x11operationCategory*}\n" +
	"\rOperationType\x12\x1e\n" +
	"\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x19\n" +
	"\x15OPERATION_TYPE_EXEMPT\x10\x01\x12\x17\n" +
	"\x13OPERATION_TYPE_READ\x10\x02\x12\x18\n" +
	"\x14OPERATION_TYPE_WRITE\x10\x03*\xcb\x03\n" +
	"\x11OperationCategory\x12\"\n" +
	"\x1eOPERATION_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n" +
	"\x16OPERATION_CATEGORY_ACL\x10\x01\x12\"\n" +
	"\x1eOPERATION_CATEGORY_PEER_STREAM\x10\x02\x12!\n" +
	"\x1dOPERATION_CATEGORY_CONNECT_CA\x10\x03\x12 \n" +
	"\x1cOPERATION_CATEGORY_PARTITION\x10\x04\x12\x1e\n" +
	"\x1aOPERATION_CATEGORY_PEERING\x10\x05\x12'\n" +
	"#OPERATION_CATEGORY_SERVER_DISCOVERY\x10\x06\x12 \n" +
	"\x1cOPERATION_CATEGORY_DATAPLANE\x10\a\x12\x1a\n" +
	"\x16OPERATION_CATEGORY_DNS\x10\b\x12 \n" +
	"\x1cOPERATION_CATEGORY_SUBSCRIBE\x10\t\x12\x1f\n" +
	"\x1bOPERATION_CATEGORY_OPERATOR\x10\n" +
	"\x12\x1f\n" +
	"\x1bOPERATION_CATEGORY_RESOURCE\x10\v\x12\"\n" +
	"\x1eOPERATION_CATEGORY_CONFIGENTRY\x10\f:^\n" +
	"\x04spec\x12\x1e.google.protobuf.MethodOptions\x18\xec@ \x01(\v2).hashicorp.consul.internal.ratelimit.SpecR\x04specB\xa9\x02\n" +
	"'com.hashicorp.consul.internal.ratelimitB\x0eRatelimitProtoP\x01Z>github.com/hashicorp/consul/proto-public/annotations/ratelimit\xa2\x02\x04HCIR\xaa\x02#Hashicorp.Consul.Internal.Ratelimit\xca\x02#Hashicorp\\Consul\\Internal\\Ratelimit\xe2\x02/Hashicorp\\Consul\\Internal\\Ratelimit\\GPBMetadata\xea\x02&Hashicorp::Consul::Internal::Ratelimitb\x06proto3"

var (
	file_annotations_ratelimit_ratelimit_proto_rawDescOnce sync.Once
	file_annotations_ratelimit_ratelimit_proto_rawDescData []byte
)

func file_annotations_ratelimit_ratelimit_proto_rawDescGZIP() []byte {
	file_annotations_ratelimit_ratelimit_proto_rawDescOnce.Do(func() {
		file_annotations_ratelimit_ratelimit_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_annotations_ratelimit_ratelimit_proto_rawDesc), len(file_annotations_ratelimit_ratelimit_proto_rawDesc)))
	})
	return file_annotations_ratelimit_ratelimit_proto_rawDescData
}

var file_annotations_ratelimit_ratelimit_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_annotations_ratelimit_ratelimit_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_annotations_ratelimit_ratelimit_proto_goTypes = []any{
	(OperationType)(0),                 // 0: hashicorp.consul.internal.ratelimit.OperationType
	(OperationCategory)(0),             // 1: hashicorp.consul.internal.ratelimit.OperationCategory
	(*Spec)(nil),                       // 2: hashicorp.consul.internal.ratelimit.Spec
	(*descriptorpb.MethodOptions)(nil), // 3: google.protobuf.MethodOptions
}
var file_annotations_ratelimit_ratelimit_proto_depIdxs = []int32{
	0, // 0: hashicorp.consul.internal.ratelimit.Spec.operation_type:type_name -> hashicorp.consul.internal.ratelimit.OperationType
	1, // 1: hashicorp.consul.internal.ratelimit.Spec.operation_category:type_name -> hashicorp.consul.internal.ratelimit.OperationCategory
	3, // 2: hashicorp.consul.internal.ratelimit.spec:extendee -> google.protobuf.MethodOptions
	2, // 3: hashicorp.consul.internal.ratelimit.spec:type_name -> hashicorp.consul.internal.ratelimit.Spec
	4, // [4:4] is the sub-list for method output_type
	4, // [4:4] is the sub-list for method input_type
	3, // [3:4] is the sub-list for extension type_name
	2, // [2:3] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_annotations_ratelimit_ratelimit_proto_init() }
func file_annotations_ratelimit_ratelimit_proto_init() {
	if File_annotations_ratelimit_ratelimit_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_annotations_ratelimit_ratelimit_proto_rawDesc), len(file_annotations_ratelimit_ratelimit_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   1,
			NumExtensions: 1,
			NumServices:   0,
		},
		GoTypes:           file_annotations_ratelimit_ratelimit_proto_goTypes,
		DependencyIndexes: file_annotations_ratelimit_ratelimit_proto_depIdxs,
		EnumInfos:         file_annotations_ratelimit_ratelimit_proto_enumTypes,
		MessageInfos:      file_annotations_ratelimit_ratelimit_proto_msgTypes,
		ExtensionInfos:    file_annotations_ratelimit_ratelimit_proto_extTypes,
	}.Build()
	File_annotations_ratelimit_ratelimit_proto = out.File
	file_annotations_ratelimit_ratelimit_proto_goTypes = nil
	file_annotations_ratelimit_ratelimit_proto_depIdxs = nil
}
