// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: metric_tags.proto

package models

import (
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	strconv "strconv"
	strings "strings"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type MetricTagValue_DynamicValue int32

const (
	DynamicValueInvalid               MetricTagValue_DynamicValue = 0
	MetricTagDynamicValueIndex        MetricTagValue_DynamicValue = 1
	MetricTagDynamicValueInstanceGuid MetricTagValue_DynamicValue = 2
)

var MetricTagValue_DynamicValue_name = map[int32]string{
	0: "DynamicValueInvalid",
	1: "INDEX",
	2: "INSTANCE_GUID",
}

var MetricTagValue_DynamicValue_value = map[string]int32{
	"DynamicValueInvalid": 0,
	"INDEX":               1,
	"INSTANCE_GUID":       2,
}

func (MetricTagValue_DynamicValue) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_6fa2ee0541447d5e, []int{0, 0}
}

type MetricTagValue struct {
	// Note: we only expect one of the following set of fields to be
	// set.
	Static  string                      `protobuf:"bytes,1,opt,name=static,proto3" json:"static,omitempty"`
	Dynamic MetricTagValue_DynamicValue `protobuf:"varint,2,opt,name=dynamic,proto3,enum=models.MetricTagValue_DynamicValue" json:"dynamic,omitempty"`
}

func (m *MetricTagValue) Reset()      { *m = MetricTagValue{} }
func (*MetricTagValue) ProtoMessage() {}
func (*MetricTagValue) Descriptor() ([]byte, []int) {
	return fileDescriptor_6fa2ee0541447d5e, []int{0}
}
func (m *MetricTagValue) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MetricTagValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MetricTagValue.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *MetricTagValue) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MetricTagValue.Merge(m, src)
}
func (m *MetricTagValue) XXX_Size() int {
	return m.Size()
}
func (m *MetricTagValue) XXX_DiscardUnknown() {
	xxx_messageInfo_MetricTagValue.DiscardUnknown(m)
}

var xxx_messageInfo_MetricTagValue proto.InternalMessageInfo

func (m *MetricTagValue) GetStatic() string {
	if m != nil {
		return m.Static
	}
	return ""
}

func (m *MetricTagValue) GetDynamic() MetricTagValue_DynamicValue {
	if m != nil {
		return m.Dynamic
	}
	return DynamicValueInvalid
}

func init() {
	proto.RegisterEnum("models.MetricTagValue_DynamicValue", MetricTagValue_DynamicValue_name, MetricTagValue_DynamicValue_value)
	proto.RegisterType((*MetricTagValue)(nil), "models.MetricTagValue")
}

func init() { proto.RegisterFile("metric_tags.proto", fileDescriptor_6fa2ee0541447d5e) }

var fileDescriptor_6fa2ee0541447d5e = []byte{
	// 296 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29,
	0xca, 0x4c, 0x8e, 0x2f, 0x49, 0x4c, 0x2f, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb,
	0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce,
	0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x4b, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e,
	0x98, 0x05, 0xd1, 0xa6, 0xf4, 0x8d, 0x91, 0x8b, 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3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5,
	0x18, 0x6e, 0x3c, 0x96, 0x63, 0x48, 0x62, 0x03, 0x87, 0x9a, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff,
	0x9b, 0x83, 0x77, 0xc8, 0x81, 0x01, 0x00, 0x00,
}

func (x MetricTagValue_DynamicValue) String() string {
	s, ok := MetricTagValue_DynamicValue_name[int32(x)]
	if ok {
		return s
	}
	return strconv.Itoa(int(x))
}
func (this *MetricTagValue) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*MetricTagValue)
	if !ok {
		that2, ok := that.(MetricTagValue)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if this.Static != that1.Static {
		return false
	}
	if this.Dynamic != that1.Dynamic {
		return false
	}
	return true
}
func (this *MetricTagValue) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 6)
	s = append(s, "&models.MetricTagValue{")
	s = append(s, "Static: "+fmt.Sprintf("%#v", this.Static)+",\n")
	s = append(s, "Dynamic: "+fmt.Sprintf("%#v", this.Dynamic)+",\n")
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringMetricTags(v interface{}, typ string) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *MetricTagValue) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *MetricTagValue) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MetricTagValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Dynamic != 0 {
		i = encodeVarintMetricTags(dAtA, i, uint64(m.Dynamic))
		i--
		dAtA[i] = 0x10
	}
	if len(m.Static) > 0 {
		i -= len(m.Static)
		copy(dAtA[i:], m.Static)
		i = encodeVarintMetricTags(dAtA, i, uint64(len(m.Static)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintMetricTags(dAtA []byte, offset int, v uint64) int {
	offset -= sovMetricTags(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *MetricTagValue) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Static)
	if l > 0 {
		n += 1 + l + sovMetricTags(uint64(l))
	}
	if m.Dynamic != 0 {
		n += 1 + sovMetricTags(uint64(m.Dynamic))
	}
	return n
}

func sovMetricTags(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozMetricTags(x uint64) (n int) {
	return sovMetricTags(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *MetricTagValue) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&MetricTagValue{`,
		`Static:` + fmt.Sprintf("%v", this.Static) + `,`,
		`Dynamic:` + fmt.Sprintf("%v", this.Dynamic) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringMetricTags(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *MetricTagValue) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMetricTags
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: MetricTagValue: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MetricTagValue: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Static", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMetricTags
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthMetricTags
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMetricTags
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Static = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Dynamic", wireType)
			}
			m.Dynamic = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMetricTags
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Dynamic |= MetricTagValue_DynamicValue(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipMetricTags(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMetricTags
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipMetricTags(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowMetricTags
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowMetricTags
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowMetricTags
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthMetricTags
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupMetricTags
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthMetricTags
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthMetricTags        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetricTags          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMetricTags = fmt.Errorf("proto: unexpected end of group")
)
