// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: greenfield/payment/out_flow.proto

package types

import (
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	io "io"
	math "math"
	math_bits "math/bits"
)

// 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

// OutFlowStatus defines the status of a out flow
type OutFlowStatus int32

const (
	// OUT_FLOW_STATUS_ACTIVE defines the active status of a out flow.
	OUT_FLOW_STATUS_ACTIVE OutFlowStatus = 0
	// OUT_FLOW_STATUS_FROZEN defines the frozen status of a out flow.
	OUT_FLOW_STATUS_FROZEN OutFlowStatus = 1
)

var OutFlowStatus_name = map[int32]string{
	0: "OUT_FLOW_STATUS_ACTIVE",
	1: "OUT_FLOW_STATUS_FROZEN",
}

var OutFlowStatus_value = map[string]int32{
	"OUT_FLOW_STATUS_ACTIVE": 0,
	"OUT_FLOW_STATUS_FROZEN": 1,
}

func (x OutFlowStatus) String() string {
	return proto.EnumName(OutFlowStatus_name, int32(x))
}

func (OutFlowStatus) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_5659e1072949c467, []int{0}
}

// OutFlow defines the accumulative outflow stream rate in BNB
// from a stream account to a Storage Provider
type OutFlow struct {
	// stream account address who receives the flow, usually SP(service provider)
	ToAddress string `protobuf:"bytes,1,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`
	// flow rate
	Rate github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"rate"`
	// status
	Status OutFlowStatus `protobuf:"varint,3,opt,name=status,proto3,enum=greenfield.payment.OutFlowStatus" json:"status,omitempty"`
}

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

var xxx_messageInfo_OutFlow proto.InternalMessageInfo

func (m *OutFlow) GetToAddress() string {
	if m != nil {
		return m.ToAddress
	}
	return ""
}

func (m *OutFlow) GetStatus() OutFlowStatus {
	if m != nil {
		return m.Status
	}
	return OUT_FLOW_STATUS_ACTIVE
}

func init() {
	proto.RegisterEnum("greenfield.payment.OutFlowStatus", OutFlowStatus_name, OutFlowStatus_value)
	proto.RegisterType((*OutFlow)(nil), "greenfield.payment.OutFlow")
}

func init() { proto.RegisterFile("greenfield/payment/out_flow.proto", fileDescriptor_5659e1072949c467) }

var fileDescriptor_5659e1072949c467 = []byte{
	// 347 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0x2f, 0x4a, 0x4d,
	0xcd, 0x4b, 0xcb, 0x4c, 0xcd, 0x49, 0xd1, 0x2f, 0x48, 0xac, 0xcc, 0x4d,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9f, 0x91, 0xa2, 0x1e, 0xa6, 0x67, 0xf5, 0xa0, 0xee, 0x0e, 0x06, 0x2b,
	0x0c, 0x82, 0x6a, 0xd0, 0xf2, 0xe5, 0xe2, 0x45, 0x91, 0x10, 0x92, 0xe2, 0x12, 0xf3, 0x0f, 0x0d,
	0x89, 0x77, 0xf3, 0xf1, 0x0f, 0x8f, 0x0f, 0x0e, 0x71, 0x0c, 0x09, 0x0d, 0x8e, 0x77, 0x74, 0x0e,
	0xf1, 0x0c, 0x73, 0x15, 0x60, 0xc0, 0x26, 0xe7, 0x16, 0xe4, 0x1f, 0xe5, 0xea, 0x27, 0xc0, 0x28,
	0xc5, 0xd2, 0xb1, 0x58, 0x8e, 0xc1, 0xc9, 0xf3, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18,
	0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5,
	0x18, 0xa2, 0xf4, 0x91, 0xfc, 0x97, 0x94, 0x97, 0xa4, 0x9b, 0x9c, 0x91, 0x98, 0x99, 0xa7, 0x8f,
	0x14, 0x6f, 0x15, 0xf0, 0x98, 0x03, 0x7b, 0x36, 0x89, 0x0d, 0x1c, 0xe4, 0xc6, 0x80, 0x00, 0x00,
	0x00, 0xff, 0xff, 0x68, 0x18, 0x2e, 0x36, 0xdc, 0x01, 0x00, 0x00,
}

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

func (m *OutFlow) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Status != 0 {
		i = encodeVarintOutFlow(dAtA, i, uint64(m.Status))
		i--
		dAtA[i] = 0x18
	}
	{
		size := m.Rate.Size()
		i -= size
		if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintOutFlow(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x12
	if len(m.ToAddress) > 0 {
		i -= len(m.ToAddress)
		copy(dAtA[i:], m.ToAddress)
		i = encodeVarintOutFlow(dAtA, i, uint64(len(m.ToAddress)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintOutFlow(dAtA []byte, offset int, v uint64) int {
	offset -= sovOutFlow(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *OutFlow) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ToAddress)
	if l > 0 {
		n += 1 + l + sovOutFlow(uint64(l))
	}
	l = m.Rate.Size()
	n += 1 + l + sovOutFlow(uint64(l))
	if m.Status != 0 {
		n += 1 + sovOutFlow(uint64(m.Status))
	}
	return n
}

func sovOutFlow(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozOutFlow(x uint64) (n int) {
	return sovOutFlow(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *OutFlow) 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 ErrIntOverflowOutFlow
			}
			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: OutFlow: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: OutFlow: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowOutFlow
				}
				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 ErrInvalidLengthOutFlow
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthOutFlow
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ToAddress = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowOutFlow
				}
				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 ErrInvalidLengthOutFlow
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthOutFlow
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
			}
			m.Status = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowOutFlow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Status |= OutFlowStatus(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipOutFlow(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthOutFlow
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

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

var (
	ErrInvalidLengthOutFlow        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOutFlow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOutFlow = fmt.Errorf("proto: unexpected end of group")
)
