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

package multiaggregation

import (
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	core "github.com/grafana/mimir/pkg/streamingpromql/planning/core"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	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 MultiAggregationGroupDetails struct {
}

func (m *MultiAggregationGroupDetails) Reset()      { *m = MultiAggregationGroupDetails{} }
func (*MultiAggregationGroupDetails) ProtoMessage() {}
func (*MultiAggregationGroupDetails) Descriptor() ([]byte, []int) {
	return fileDescriptor_0c843d59d2d938e7, []int{0}
}
func (m *MultiAggregationGroupDetails) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MultiAggregationGroupDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MultiAggregationGroupDetails.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 *MultiAggregationGroupDetails) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MultiAggregationGroupDetails.Merge(m, src)
}
func (m *MultiAggregationGroupDetails) XXX_Size() int {
	return m.Size()
}
func (m *MultiAggregationGroupDetails) XXX_DiscardUnknown() {
	xxx_messageInfo_MultiAggregationGroupDetails.DiscardUnknown(m)
}

var xxx_messageInfo_MultiAggregationGroupDetails proto.InternalMessageInfo

func (*MultiAggregationGroupDetails) XXX_MessageName() string {
	return "multiaggregation.MultiAggregationGroupDetails"
}

type MultiAggregationInstanceDetails struct {
	// Why do this, and not just use AggregateExpressionDetails?
	// This gives us more flexibility to change how multi-aggregations work in the future.
	Aggregation *core.AggregateExpressionDetails `protobuf:"bytes,1,opt,name=aggregation,proto3" json:"aggregation,omitempty"`
	Filters     []*core.LabelMatcher             `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
	SubsetIndex int64                            `protobuf:"varint,3,opt,name=subsetIndex,proto3" json:"subsetIndex,omitempty"`
}

func (m *MultiAggregationInstanceDetails) Reset()      { *m = MultiAggregationInstanceDetails{} }
func (*MultiAggregationInstanceDetails) ProtoMessage() {}
func (*MultiAggregationInstanceDetails) Descriptor() ([]byte, []int) {
	return fileDescriptor_0c843d59d2d938e7, []int{1}
}
func (m *MultiAggregationInstanceDetails) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MultiAggregationInstanceDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MultiAggregationInstanceDetails.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 *MultiAggregationInstanceDetails) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MultiAggregationInstanceDetails.Merge(m, src)
}
func (m *MultiAggregationInstanceDetails) XXX_Size() int {
	return m.Size()
}
func (m *MultiAggregationInstanceDetails) XXX_DiscardUnknown() {
	xxx_messageInfo_MultiAggregationInstanceDetails.DiscardUnknown(m)
}

var xxx_messageInfo_MultiAggregationInstanceDetails proto.InternalMessageInfo

func (m *MultiAggregationInstanceDetails) GetAggregation() *core.AggregateExpressionDetails {
	if m != nil {
		return m.Aggregation
	}
	return nil
}

func (m *MultiAggregationInstanceDetails) GetFilters() []*core.LabelMatcher {
	if m != nil {
		return m.Filters
	}
	return nil
}

func (m *MultiAggregationInstanceDetails) GetSubsetIndex() int64 {
	if m != nil {
		return m.SubsetIndex
	}
	return 0
}

func (*MultiAggregationInstanceDetails) XXX_MessageName() string {
	return "multiaggregation.MultiAggregationInstanceDetails"
}
func init() {
	proto.RegisterType((*MultiAggregationGroupDetails)(nil), "multiaggregation.MultiAggregationGroupDetails")
	proto.RegisterType((*MultiAggregationInstanceDetails)(nil), "multiaggregation.MultiAggregationInstanceDetails")
}

func init() { proto.RegisterFile("node.proto", fileDescriptor_0c843d59d2d938e7) }

var fileDescriptor_0c843d59d2d938e7 = []byte{
	// 317 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xb1, 0x6a, 0x32, 0x41,
	0x14, 0x85, 0x67, 0x7e, 0xe1, 0x0f, 0xcc, 0x36, 0x61, 0x49, 0x21, 0x12, 0x6e, 0x16, 0x2b, 0x8b,
	0xe0, 0x80, 0x69, 0xd2, 0x46, 0x22, 0x41, 0x88, 0x8d, 0x6f, 0x30, 0xbb, 0x5e, 0xc7, 0x21, 0xbb,
	0x33, 0x9b, 0x99, 0x59, 0xb0, 0xcc, 0x23, 0xe4, 0x31, 0xf2, 0x02, 0x79, 0x07, 0x4b, 0x4b, 0xcb,
	0x38, 0xdb, 0xa4, 0xf4, 0x11, 0x82, 0xab, 0x12, 0x49, 0x73, 0x39, 0x1c, 0xce, 0x77, 0xcf, 0xe5,
	0x32, 0xa6, 0xcd, 0x0c, 0xfb, 0xa5, 0x35, 0xde, 0xc4, 0x97, 0x45, 0x95, 0x7b, 0x25, 0xa4, 0xb4,
	0x28, 0x85, 0x57, 0x46, 0x77, 0x46, 0x52, 0xf9, 0x45, 0x95, 0xf6, 0x33, 0x53, 0x70, 0x69, 0xc5,
	0x5c, 0x68, 0xc1, 0x0b, 0x55, 0x28, 0xcb, 0xcb, 0x17, 0xc9, 0x9d, 0xb7, 0x28, 0x0a, 0xa5, 0x65,
	0x69, 0x4d, 0xf1, 0x9a, 0xf3, 0x32, 0x17, 0x5a, 0x2b, 0x2d, 0x79, 0x66, 0x2c, 0x36, 0xe3, 0xb0,
	0xb8, 0x73, 0x25, 0x8d, 0x34, 0x8d, 0xe4, 0x7b, 0x75, 0x70, 0xbb, 0xc0, 0xae, 0x27, 0xfb, 0xc2,
	0x87, 0xdf, 0xc2, 0x27, 0x6b, 0xaa, 0xf2, 0x11, 0xbd, 0x50, 0xb9, 0xeb, 0x7e, 0x52, 0x76, 0xf3,
	0x37, 0x30, 0xd6, 0xce, 0x0b, 0x9d, 0xe1, 0x31, 0x13, 0x0f, 0x59, 0x74, 0x76, 0x6f, 0x9b, 0x26,
	0xb4, 0x17, 0x0d, 0x92, 0x7e, 0xd3, 0x7d, 0xc2, 0x70, 0xb4, 0x2c, 0x2d, 0x3a, 0xa7, 0x8c, 0x3e,
	0x62, 0xd3, 0x73, 0x28, 0xbe, 0x65, 0x17, 0x73, 0x95, 0x7b, 0xb4, 0xae, 0xfd, 0x2f, 0x69, 0xf5,
	0xa2, 0x41, 0x7c, 0xe0, 0x9f, 0x45, 0x8a, 0xf9, 0x44, 0xf8, 0x6c, 0x81, 0x76, 0x7a, 0x8a, 0xc4,
	0x09, 0x8b, 0x5c, 0x95, 0x3a, 0xf4, 0x63, 0x3d, 0xc3, 0x65, 0xbb, 0x95, 0xd0, 0x5e, 0x6b, 0x7a,
	0x6e, 0x0d, 0xef, 0xd7, 0x5b, 0x20, 0x9b, 0x2d, 0x90, 0xdd, 0x16, 0xe8, 0x5b, 0x00, 0xfa, 0x11,
	0x80, 0xac, 0x02, 0xd0, 0x75, 0x00, 0xfa, 0x15, 0x80, 0x7e, 0x07, 0x20, 0xbb, 0x00, 0xf4, 0xbd,
	0x06, 0xb2, 0xaa, 0x81, 0xae, 0x6b, 0x20, 0x9b, 0x1a, 0x48, 0xfa, 0xbf, 0x79, 0xcc, 0xdd, 0x4f,
	0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0x56, 0x5f, 0xfd, 0x95, 0x01, 0x00, 0x00,
}

func (this *MultiAggregationGroupDetails) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 4)
	s = append(s, "&multiaggregation.MultiAggregationGroupDetails{")
	s = append(s, "}")
	return strings.Join(s, "")
}
func (this *MultiAggregationInstanceDetails) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 7)
	s = append(s, "&multiaggregation.MultiAggregationInstanceDetails{")
	if this.Aggregation != nil {
		s = append(s, "Aggregation: "+fmt.Sprintf("%#v", this.Aggregation)+",\n")
	}
	if this.Filters != nil {
		s = append(s, "Filters: "+fmt.Sprintf("%#v", this.Filters)+",\n")
	}
	s = append(s, "SubsetIndex: "+fmt.Sprintf("%#v", this.SubsetIndex)+",\n")
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringNode(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 *MultiAggregationGroupDetails) 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 *MultiAggregationGroupDetails) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MultiAggregationGroupDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	return len(dAtA) - i, nil
}

func (m *MultiAggregationInstanceDetails) 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 *MultiAggregationInstanceDetails) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MultiAggregationInstanceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.SubsetIndex != 0 {
		i = encodeVarintNode(dAtA, i, uint64(m.SubsetIndex))
		i--
		dAtA[i] = 0x18
	}
	if len(m.Filters) > 0 {
		for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintNode(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Aggregation != nil {
		{
			size, err := m.Aggregation.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintNode(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintNode(dAtA []byte, offset int, v uint64) int {
	offset -= sovNode(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *MultiAggregationGroupDetails) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	return n
}

func (m *MultiAggregationInstanceDetails) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Aggregation != nil {
		l = m.Aggregation.Size()
		n += 1 + l + sovNode(uint64(l))
	}
	if len(m.Filters) > 0 {
		for _, e := range m.Filters {
			l = e.Size()
			n += 1 + l + sovNode(uint64(l))
		}
	}
	if m.SubsetIndex != 0 {
		n += 1 + sovNode(uint64(m.SubsetIndex))
	}
	return n
}

func sovNode(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozNode(x uint64) (n int) {
	return sovNode(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *MultiAggregationGroupDetails) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&MultiAggregationGroupDetails{`,
		`}`,
	}, "")
	return s
}
func (this *MultiAggregationInstanceDetails) String() string {
	if this == nil {
		return "nil"
	}
	repeatedStringForFilters := "[]*LabelMatcher{"
	for _, f := range this.Filters {
		repeatedStringForFilters += strings.Replace(fmt.Sprintf("%v", f), "LabelMatcher", "core.LabelMatcher", 1) + ","
	}
	repeatedStringForFilters += "}"
	s := strings.Join([]string{`&MultiAggregationInstanceDetails{`,
		`Aggregation:` + strings.Replace(fmt.Sprintf("%v", this.Aggregation), "AggregateExpressionDetails", "core.AggregateExpressionDetails", 1) + `,`,
		`Filters:` + repeatedStringForFilters + `,`,
		`SubsetIndex:` + fmt.Sprintf("%v", this.SubsetIndex) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringNode(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *MultiAggregationGroupDetails) 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 ErrIntOverflowNode
			}
			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: MultiAggregationGroupDetails: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MultiAggregationGroupDetails: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		default:
			iNdEx = preIndex
			skippy, err := skipNode(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthNode
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *MultiAggregationInstanceDetails) 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 ErrIntOverflowNode
			}
			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: MultiAggregationInstanceDetails: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MultiAggregationInstanceDetails: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowNode
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthNode
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthNode
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Aggregation == nil {
				m.Aggregation = &core.AggregateExpressionDetails{}
			}
			if err := m.Aggregation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowNode
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthNode
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthNode
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Filters = append(m.Filters, &core.LabelMatcher{})
			if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SubsetIndex", wireType)
			}
			m.SubsetIndex = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowNode
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SubsetIndex |= int64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipNode(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthNode
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipNode(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, ErrIntOverflowNode
			}
			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, ErrIntOverflowNode
				}
				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, ErrIntOverflowNode
				}
				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, ErrInvalidLengthNode
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupNode
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthNode
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthNode        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowNode          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupNode = fmt.Errorf("proto: unexpected end of group")
)
