// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: electra/meter/power_purchase_contract.proto

package types

import (
	fmt "fmt"
	proto "github.com/gogo/protobuf/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

type PowerPurchaseContract struct {
	ContractID                    string `protobuf:"bytes,1,opt,name=contractID,proto3" json:"contractID,omitempty"`
	ContractDeviceID              string `protobuf:"bytes,2,opt,name=contractDeviceID,proto3" json:"contractDeviceID,omitempty"`
	ContractName                  string `protobuf:"bytes,3,opt,name=contractName,proto3" json:"contractName,omitempty"`
	ContractActive                bool   `protobuf:"varint,4,opt,name=contractActive,proto3" json:"contractActive,omitempty"`
	ContractPhase                 uint64 `protobuf:"varint,5,opt,name=contractPhase,proto3" json:"contractPhase,omitempty"`
	ContractForAll                bool   `protobuf:"varint,6,opt,name=contractForAll,proto3" json:"contractForAll,omitempty"`
	ContractForAllPrice           uint64 `protobuf:"varint,7,opt,name=contractForAllPrice,proto3" json:"contractForAllPrice,omitempty"`
	ContractForAllCurency         string `protobuf:"bytes,8,opt,name=contractForAllCurency,proto3" json:"contractForAllCurency,omitempty"`
	ContractForAllActivePeriod    string `protobuf:"bytes,9,opt,name=contractForAllActivePeriod,proto3" json:"contractForAllActivePeriod,omitempty"`
	ContractPreferred             bool   `protobuf:"varint,10,opt,name=contractPreferred,proto3" json:"contractPreferred,omitempty"`
	ContractPreferredPrice        uint64 `protobuf:"varint,11,opt,name=contractPreferredPrice,proto3" json:"contractPreferredPrice,omitempty"`
	ContractPreferredActivePeriod string `protobuf:"bytes,12,opt,name=contractPreferredActivePeriod,proto3" json:"contractPreferredActivePeriod,omitempty"`
	ContractPreferredCurency      string `protobuf:"bytes,13,opt,name=contractPreferredCurency,proto3" json:"contractPreferredCurency,omitempty"`
	ContractStartDate             uint64 `protobuf:"varint,14,opt,name=contractStartDate,proto3" json:"contractStartDate,omitempty"`
	ContractEndDate               uint64 `protobuf:"varint,15,opt,name=contractEndDate,proto3" json:"contractEndDate,omitempty"`
	Phase1RemainingWh             uint64 `protobuf:"varint,16,opt,name=phase1RemainingWh,proto3" json:"phase1RemainingWh,omitempty"`
	Phase2RemainingWh             uint64 `protobuf:"varint,17,opt,name=phase2RemainingWh,proto3" json:"phase2RemainingWh,omitempty"`
	Phase3RemainingWh             uint64 `protobuf:"varint,18,opt,name=phase3RemainingWh,proto3" json:"phase3RemainingWh,omitempty"`
	Creator                       string `protobuf:"bytes,19,opt,name=creator,proto3" json:"creator,omitempty"`
}

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

var xxx_messageInfo_PowerPurchaseContract proto.InternalMessageInfo

func (m *PowerPurchaseContract) GetContractID() string {
	if m != nil {
		return m.ContractID
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractDeviceID() string {
	if m != nil {
		return m.ContractDeviceID
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractName() string {
	if m != nil {
		return m.ContractName
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractActive() bool {
	if m != nil {
		return m.ContractActive
	}
	return false
}

func (m *PowerPurchaseContract) GetContractPhase() uint64 {
	if m != nil {
		return m.ContractPhase
	}
	return 0
}

func (m *PowerPurchaseContract) GetContractForAll() bool {
	if m != nil {
		return m.ContractForAll
	}
	return false
}

func (m *PowerPurchaseContract) GetContractForAllPrice() uint64 {
	if m != nil {
		return m.ContractForAllPrice
	}
	return 0
}

func (m *PowerPurchaseContract) GetContractForAllCurency() string {
	if m != nil {
		return m.ContractForAllCurency
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractForAllActivePeriod() string {
	if m != nil {
		return m.ContractForAllActivePeriod
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractPreferred() bool {
	if m != nil {
		return m.ContractPreferred
	}
	return false
}

func (m *PowerPurchaseContract) GetContractPreferredPrice() uint64 {
	if m != nil {
		return m.ContractPreferredPrice
	}
	return 0
}

func (m *PowerPurchaseContract) GetContractPreferredActivePeriod() string {
	if m != nil {
		return m.ContractPreferredActivePeriod
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractPreferredCurency() string {
	if m != nil {
		return m.ContractPreferredCurency
	}
	return ""
}

func (m *PowerPurchaseContract) GetContractStartDate() uint64 {
	if m != nil {
		return m.ContractStartDate
	}
	return 0
}

func (m *PowerPurchaseContract) GetContractEndDate() uint64 {
	if m != nil {
		return m.ContractEndDate
	}
	return 0
}

func (m *PowerPurchaseContract) GetPhase1RemainingWh() uint64 {
	if m != nil {
		return m.Phase1RemainingWh
	}
	return 0
}

func (m *PowerPurchaseContract) GetPhase2RemainingWh() uint64 {
	if m != nil {
		return m.Phase2RemainingWh
	}
	return 0
}

func (m *PowerPurchaseContract) GetPhase3RemainingWh() uint64 {
	if m != nil {
		return m.Phase3RemainingWh
	}
	return 0
}

func (m *PowerPurchaseContract) GetCreator() string {
	if m != nil {
		return m.Creator
	}
	return ""
}

func init() {
	proto.RegisterType((*PowerPurchaseContract)(nil), "electra.meter.PowerPurchaseContract")
}

func init() {
	proto.RegisterFile("electra/meter/power_purchase_contract.proto", fileDescriptor_e430b0116c7a04bf)
}

var fileDescriptor_e430b0116c7a04bf = []byte{
	// 435 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcf, 0x6e, 0xd3, 0x40,
	0x10, 0xc6, 0x63, 0x28, 0x4d, 0x3b, 0x34, 0xfd, 0x33, 0x55, 0xd0, 0x0a, 0x09, 0x2b, 0xaa, 0x10,
	0xb2, 0x00, 0x35, 0xd0, 0x22, 0x0e, 0x1c, 0x90, 0x4a, 0x0d, 0x52, 0x2f, 0xc8, 0x32, 0x07, 0x24,
	0x2e, 0xd5, 0xb2, 0x19, 0xa8, 0xa5, 0xc4, 0xb6, 0xa6, 0xdb, 0x42, 0x1e, 0x81, 0x1b, 0x8f, 0xc5,
	0x31, 0x47, 0x8e, 0x28, 0x79, 0x11, 0xe4, 0xb5, 0x37, 0x5a, 0xc7, 0x49, 0x8e, 0xfb, 0xfb, 0x7e,
	0x3b, 0x9a, 0xcf, 0xf2, 0xc2, 0x33, 0x1a, 0x92, 0xd2, 0x2c, 0xfb, 0x23, 0xd2, 0xc4, 0xfd, 0x3c,
	0xfb, 0x41, 0x7c, 0x99, 0xdf, 0xb0, 0xba, 0x92, 0xd7, 0x74, 0xa9, 0xb2, 0x54, 0xb3, 0x54, 0xfa,
	0x38, 0xe7, 0x4c, 0x67, 0xd8, 0xa9, 0xe4, 0x63, 0x23, 0x1f, 0xfd, 0x6a, 0x43, 0x37, 0x2a, 0x2e,
	0x44, 0x95, 0x7f, 0x5e, 0xe9, 0xe8, 0x03, 0xd8, 0xab, 0x17, 0xa1, 0xf0, 0x7a, 0x5e, 0xb0, 0x1d,
	0x3b, 0x04, 0x9f, 0xc2, 0xbe, 0x3d, 0x85, 0x74, 0x9b, 0x28, 0xba, 0x08, 0xc5, 0x1d, 0x63, 0x35,
	0x38, 0x1e, 0xc1, 0x8e, 0x65, 0x1f, 0xe5, 0x88, 0xc4, 0x5d, 0xe3, 0xd5, 0x18, 0x3e, 0x81, 0x5d,
	0x7b, 0x3e, 0x53, 0x3a, 0xb9, 0x25, 0xb1, 0xd1, 0xf3, 0x82, 0xad, 0x78, 0x81, 0xe2, 0x63, 0xe8,
	0x58, 0x12, 0x15, 0x0b, 0x8b, 0x7b, 0x3d, 0x2f, 0xd8, 0x88, 0xeb, 0xd0, 0x9d, 0xf6, 0x21, 0xe3,
	0xb3, 0xe1, 0x50, 0x6c, 0xd6, 0xa7, 0x95, 0x14, 0x5f, 0xc0, 0x61, 0x9d, 0x44, 0x9c, 0x28, 0x12,
	0x6d, 0x33, 0x73, 0x59, 0x84, 0xaf, 0xa0, 0x5b, 0xc7, 0xe7, 0x37, 0x4c, 0xa9, 0x1a, 0x8b, 0x2d,
	0x53, 0x6a, 0x79, 0x88, 0x6f, 0xe1, 0x61, 0x3d, 0x28, 0xdb, 0x44, 0xc4, 0x49, 0x36, 0x10, 0xdb,
	0xe6, 0xea, 0x1a, 0x03, 0x9f, 0xc3, 0xc1, 0xbc, 0x20, 0xd3, 0x37, 0x62, 0xa6, 0x81, 0x00, 0x53,
	0xa9, 0x19, 0xe0, 0x6b, 0x78, 0xd0, 0x80, 0x65, 0xb1, 0xfb, 0xa6, 0xd8, 0x8a, 0x14, 0x43, 0x78,
	0xd4, 0x48, 0x6a, 0x8b, 0xee, 0x98, 0x45, 0xd7, 0x4b, 0xf8, 0x06, 0x44, 0x43, 0xb0, 0x1f, 0xa9,
	0x63, 0x06, 0xac, 0xcc, 0xdd, 0x9e, 0x9f, 0xb4, 0x64, 0x1d, 0x4a, 0x4d, 0x62, 0xd7, 0x2c, 0xdd,
	0x0c, 0x30, 0x80, 0x3d, 0x0b, 0xdf, 0xa7, 0x03, 0xe3, 0xee, 0x19, 0x77, 0x11, 0x17, 0x73, 0xf3,
	0xe2, 0xc7, 0x78, 0x19, 0xd3, 0x48, 0x26, 0x69, 0x92, 0x7e, 0xff, 0x7c, 0x25, 0xf6, 0xcb, 0xb9,
	0x8d, 0x60, 0x6e, 0x9f, 0xb8, 0xf6, 0x81, 0x63, 0x9f, 0x2c, 0xb3, 0x4f, 0x5d, 0x1b, 0x1d, 0xdb,
	0x0d, 0x50, 0x40, 0x5b, 0x31, 0x49, 0x9d, 0xb1, 0x38, 0x34, 0x1f, 0xc3, 0x1e, 0xdf, 0xf5, 0xff,
	0x4c, 0x7d, 0x6f, 0x32, 0xf5, 0xbd, 0x7f, 0x53, 0xdf, 0xfb, 0x3d, 0xf3, 0x5b, 0x93, 0x99, 0xdf,
	0xfa, 0x3b, 0xf3, 0x5b, 0x5f, 0xba, 0xf6, 0x85, 0xff, 0xac, 0xde, 0xb8, 0x1e, 0xe7, 0x74, 0xfd,
	0x75, 0xd3, 0x3c, 0xe9, 0xd3, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xc2, 0x80, 0x8d, 0x01,
	0x04, 0x00, 0x00,
}

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

func (m *PowerPurchaseContract) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Creator) > 0 {
		i -= len(m.Creator)
		copy(dAtA[i:], m.Creator)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.Creator)))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x9a
	}
	if m.Phase3RemainingWh != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.Phase3RemainingWh))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x90
	}
	if m.Phase2RemainingWh != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.Phase2RemainingWh))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x88
	}
	if m.Phase1RemainingWh != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.Phase1RemainingWh))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x80
	}
	if m.ContractEndDate != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.ContractEndDate))
		i--
		dAtA[i] = 0x78
	}
	if m.ContractStartDate != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.ContractStartDate))
		i--
		dAtA[i] = 0x70
	}
	if len(m.ContractPreferredCurency) > 0 {
		i -= len(m.ContractPreferredCurency)
		copy(dAtA[i:], m.ContractPreferredCurency)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractPreferredCurency)))
		i--
		dAtA[i] = 0x6a
	}
	if len(m.ContractPreferredActivePeriod) > 0 {
		i -= len(m.ContractPreferredActivePeriod)
		copy(dAtA[i:], m.ContractPreferredActivePeriod)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractPreferredActivePeriod)))
		i--
		dAtA[i] = 0x62
	}
	if m.ContractPreferredPrice != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.ContractPreferredPrice))
		i--
		dAtA[i] = 0x58
	}
	if m.ContractPreferred {
		i--
		if m.ContractPreferred {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x50
	}
	if len(m.ContractForAllActivePeriod) > 0 {
		i -= len(m.ContractForAllActivePeriod)
		copy(dAtA[i:], m.ContractForAllActivePeriod)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractForAllActivePeriod)))
		i--
		dAtA[i] = 0x4a
	}
	if len(m.ContractForAllCurency) > 0 {
		i -= len(m.ContractForAllCurency)
		copy(dAtA[i:], m.ContractForAllCurency)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractForAllCurency)))
		i--
		dAtA[i] = 0x42
	}
	if m.ContractForAllPrice != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.ContractForAllPrice))
		i--
		dAtA[i] = 0x38
	}
	if m.ContractForAll {
		i--
		if m.ContractForAll {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x30
	}
	if m.ContractPhase != 0 {
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(m.ContractPhase))
		i--
		dAtA[i] = 0x28
	}
	if m.ContractActive {
		i--
		if m.ContractActive {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x20
	}
	if len(m.ContractName) > 0 {
		i -= len(m.ContractName)
		copy(dAtA[i:], m.ContractName)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractName)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.ContractDeviceID) > 0 {
		i -= len(m.ContractDeviceID)
		copy(dAtA[i:], m.ContractDeviceID)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractDeviceID)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.ContractID) > 0 {
		i -= len(m.ContractID)
		copy(dAtA[i:], m.ContractID)
		i = encodeVarintPowerPurchaseContract(dAtA, i, uint64(len(m.ContractID)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintPowerPurchaseContract(dAtA []byte, offset int, v uint64) int {
	offset -= sovPowerPurchaseContract(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *PowerPurchaseContract) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ContractID)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	l = len(m.ContractDeviceID)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	l = len(m.ContractName)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	if m.ContractActive {
		n += 2
	}
	if m.ContractPhase != 0 {
		n += 1 + sovPowerPurchaseContract(uint64(m.ContractPhase))
	}
	if m.ContractForAll {
		n += 2
	}
	if m.ContractForAllPrice != 0 {
		n += 1 + sovPowerPurchaseContract(uint64(m.ContractForAllPrice))
	}
	l = len(m.ContractForAllCurency)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	l = len(m.ContractForAllActivePeriod)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	if m.ContractPreferred {
		n += 2
	}
	if m.ContractPreferredPrice != 0 {
		n += 1 + sovPowerPurchaseContract(uint64(m.ContractPreferredPrice))
	}
	l = len(m.ContractPreferredActivePeriod)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	l = len(m.ContractPreferredCurency)
	if l > 0 {
		n += 1 + l + sovPowerPurchaseContract(uint64(l))
	}
	if m.ContractStartDate != 0 {
		n += 1 + sovPowerPurchaseContract(uint64(m.ContractStartDate))
	}
	if m.ContractEndDate != 0 {
		n += 1 + sovPowerPurchaseContract(uint64(m.ContractEndDate))
	}
	if m.Phase1RemainingWh != 0 {
		n += 2 + sovPowerPurchaseContract(uint64(m.Phase1RemainingWh))
	}
	if m.Phase2RemainingWh != 0 {
		n += 2 + sovPowerPurchaseContract(uint64(m.Phase2RemainingWh))
	}
	if m.Phase3RemainingWh != 0 {
		n += 2 + sovPowerPurchaseContract(uint64(m.Phase3RemainingWh))
	}
	l = len(m.Creator)
	if l > 0 {
		n += 2 + l + sovPowerPurchaseContract(uint64(l))
	}
	return n
}

func sovPowerPurchaseContract(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozPowerPurchaseContract(x uint64) (n int) {
	return sovPowerPurchaseContract(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *PowerPurchaseContract) 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 ErrIntOverflowPowerPurchaseContract
			}
			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: PowerPurchaseContract: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: PowerPurchaseContract: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractID", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractID = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractDeviceID", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractDeviceID = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractName", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractName = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractActive", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.ContractActive = bool(v != 0)
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractPhase", wireType)
			}
			m.ContractPhase = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ContractPhase |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 6:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractForAll", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.ContractForAll = bool(v != 0)
		case 7:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractForAllPrice", wireType)
			}
			m.ContractForAllPrice = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ContractForAllPrice |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractForAllCurency", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractForAllCurency = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 9:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractForAllActivePeriod", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractForAllActivePeriod = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 10:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractPreferred", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.ContractPreferred = bool(v != 0)
		case 11:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractPreferredPrice", wireType)
			}
			m.ContractPreferredPrice = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ContractPreferredPrice |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 12:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractPreferredActivePeriod", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractPreferredActivePeriod = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 13:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractPreferredCurency", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ContractPreferredCurency = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 14:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractStartDate", wireType)
			}
			m.ContractStartDate = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ContractStartDate |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 15:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ContractEndDate", wireType)
			}
			m.ContractEndDate = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ContractEndDate |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 16:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Phase1RemainingWh", wireType)
			}
			m.Phase1RemainingWh = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Phase1RemainingWh |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 17:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Phase2RemainingWh", wireType)
			}
			m.Phase2RemainingWh = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Phase2RemainingWh |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 18:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Phase3RemainingWh", wireType)
			}
			m.Phase3RemainingWh = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Phase3RemainingWh |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 19:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPowerPurchaseContract
				}
				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 ErrInvalidLengthPowerPurchaseContract
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Creator = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipPowerPurchaseContract(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthPowerPurchaseContract
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

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

var (
	ErrInvalidLengthPowerPurchaseContract        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPowerPurchaseContract          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPowerPurchaseContract = fmt.Errorf("proto: unexpected end of group")
)
