// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/type/v3/percent.proto

package typev3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	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)
)

// Fraction percentages support several fixed denominator values.
type FractionalPercent_DenominatorType int32

const (
	// 100.
	//
	// **Example**: 1/100 = 1%.
	FractionalPercent_HUNDRED FractionalPercent_DenominatorType = 0
	// 10,000.
	//
	// **Example**: 1/10000 = 0.01%.
	FractionalPercent_TEN_THOUSAND FractionalPercent_DenominatorType = 1
	// 1,000,000.
	//
	// **Example**: 1/1000000 = 0.0001%.
	FractionalPercent_MILLION FractionalPercent_DenominatorType = 2
)

// Enum value maps for FractionalPercent_DenominatorType.
var (
	FractionalPercent_DenominatorType_name = map[int32]string{
		0: "HUNDRED",
		1: "TEN_THOUSAND",
		2: "MILLION",
	}
	FractionalPercent_DenominatorType_value = map[string]int32{
		"HUNDRED":      0,
		"TEN_THOUSAND": 1,
		"MILLION":      2,
	}
)

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

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

func (FractionalPercent_DenominatorType) Descriptor() protoreflect.EnumDescriptor {
	return file_envoy_type_v3_percent_proto_enumTypes[0].Descriptor()
}

func (FractionalPercent_DenominatorType) Type() protoreflect.EnumType {
	return &file_envoy_type_v3_percent_proto_enumTypes[0]
}

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

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

// Identifies a percentage, in the range [0.0, 100.0].
type Percent struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Value         float64                `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Percent) ProtoMessage() {}

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

func (x *Percent) GetValue() float64 {
	if x != nil {
		return x.Value
	}
	return 0
}

// A fractional percentage is used in cases in which for performance reasons performing floating
// point to integer conversions during randomness calculations is undesirable. The message includes
// both a numerator and denominator that together determine the final fractional value.
//
// * **Example**: 1/100 = 1%.
// * **Example**: 3/10000 = 0.03%.
type FractionalPercent struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Specifies the numerator. Defaults to 0.
	Numerator uint32 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"`
	// Specifies the denominator. If the denominator specified is less than the numerator, the final
	// fractional percentage is capped at 1 (100%).
	Denominator   FractionalPercent_DenominatorType `protobuf:"varint,2,opt,name=denominator,proto3,enum=envoy.type.v3.FractionalPercent_DenominatorType" json:"denominator,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*FractionalPercent) ProtoMessage() {}

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

func (x *FractionalPercent) GetNumerator() uint32 {
	if x != nil {
		return x.Numerator
	}
	return 0
}

func (x *FractionalPercent) GetDenominator() FractionalPercent_DenominatorType {
	if x != nil {
		return x.Denominator
	}
	return FractionalPercent_HUNDRED
}

var File_envoy_type_v3_percent_proto protoreflect.FileDescriptor

const file_envoy_type_v3_percent_proto_rawDesc = "" +
	"\n" +
	"\x1benvoy/type/v3/percent.proto\x12\renvoy.type.v3\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\x1a\x17validate/validate.proto\"S\n" +
	"\aPercent\x12-\n" +
	"\x05value\x18\x01 \x01(\x01B\x17\xfaB\x14\x12\x12\x19\x00\x00\x00\x00\x00\x00Y@)\x00\x00\x00\x00\x00\x00\x00\x00R\x05value:\x19\x9aň\x1e\x14\n" +
	"\x12envoy.type.Percent\"\xf3\x01\n" +
	"\x11FractionalPercent\x12\x1c\n" +
	"\tnumerator\x18\x01 \x01(\rR\tnumerator\x12\\\n" +
	"\vdenominator\x18\x02 \x01(\x0e20.envoy.type.v3.FractionalPercent.DenominatorTypeB\b\xfaB\x05\x82\x01\x02\x10\x01R\vdenominator\"=\n" +
	"\x0fDenominatorType\x12\v\n" +
	"\aHUNDRED\x10\x00\x12\x10\n" +
	"\fTEN_THOUSAND\x10\x01\x12\v\n" +
	"\aMILLION\x10\x02:#\x9aň\x1e\x1e\n" +
	"\x1cenvoy.type.FractionalPercentBr\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"\x1bio.envoyproxy.envoy.type.v3B\fPercentProtoP\x01Z;github.com/envoyproxy/go-control-plane/envoy/type/v3;typev3b\x06proto3"

var (
	file_envoy_type_v3_percent_proto_rawDescOnce sync.Once
	file_envoy_type_v3_percent_proto_rawDescData []byte
)

func file_envoy_type_v3_percent_proto_rawDescGZIP() []byte {
	file_envoy_type_v3_percent_proto_rawDescOnce.Do(func() {
		file_envoy_type_v3_percent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_type_v3_percent_proto_rawDesc), len(file_envoy_type_v3_percent_proto_rawDesc)))
	})
	return file_envoy_type_v3_percent_proto_rawDescData
}

var file_envoy_type_v3_percent_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_envoy_type_v3_percent_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_envoy_type_v3_percent_proto_goTypes = []any{
	(FractionalPercent_DenominatorType)(0), // 0: envoy.type.v3.FractionalPercent.DenominatorType
	(*Percent)(nil),                        // 1: envoy.type.v3.Percent
	(*FractionalPercent)(nil),              // 2: envoy.type.v3.FractionalPercent
}
var file_envoy_type_v3_percent_proto_depIdxs = []int32{
	0, // 0: envoy.type.v3.FractionalPercent.denominator:type_name -> envoy.type.v3.FractionalPercent.DenominatorType
	1, // [1:1] is the sub-list for method output_type
	1, // [1:1] is the sub-list for method input_type
	1, // [1:1] is the sub-list for extension type_name
	1, // [1:1] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_envoy_type_v3_percent_proto_init() }
func file_envoy_type_v3_percent_proto_init() {
	if File_envoy_type_v3_percent_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_type_v3_percent_proto_rawDesc), len(file_envoy_type_v3_percent_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_type_v3_percent_proto_goTypes,
		DependencyIndexes: file_envoy_type_v3_percent_proto_depIdxs,
		EnumInfos:         file_envoy_type_v3_percent_proto_enumTypes,
		MessageInfos:      file_envoy_type_v3_percent_proto_msgTypes,
	}.Build()
	File_envoy_type_v3_percent_proto = out.File
	file_envoy_type_v3_percent_proto_goTypes = nil
	file_envoy_type_v3_percent_proto_depIdxs = nil
}
