// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: runtime/election/v1/election.proto

package v1

import (
	context "context"
	fmt "fmt"
	v1 "github.com/atomix/atomix/api/runtime/v1"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	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 EnterRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_EnterRequest proto.InternalMessageInfo

func (m *EnterRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *EnterRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type EnterResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_EnterResponse proto.InternalMessageInfo

func (m *EnterResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type WithdrawRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_WithdrawRequest proto.InternalMessageInfo

func (m *WithdrawRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *WithdrawRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type WithdrawResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_WithdrawResponse proto.InternalMessageInfo

func (m *WithdrawResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type AnointRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_AnointRequest proto.InternalMessageInfo

func (m *AnointRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *AnointRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type AnointResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_AnointResponse proto.InternalMessageInfo

func (m *AnointResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type PromoteRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_PromoteRequest proto.InternalMessageInfo

func (m *PromoteRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *PromoteRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type PromoteResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_PromoteResponse proto.InternalMessageInfo

func (m *PromoteResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type DemoteRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_DemoteRequest proto.InternalMessageInfo

func (m *DemoteRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *DemoteRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type DemoteResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_DemoteResponse proto.InternalMessageInfo

func (m *DemoteResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type EvictRequest struct {
	ID        v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	Candidate string         `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
}

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

var xxx_messageInfo_EvictRequest proto.InternalMessageInfo

func (m *EvictRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

func (m *EvictRequest) GetCandidate() string {
	if m != nil {
		return m.Candidate
	}
	return ""
}

type EvictResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_EvictResponse proto.InternalMessageInfo

func (m *EvictResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type GetTermRequest struct {
	ID v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
}

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

var xxx_messageInfo_GetTermRequest proto.InternalMessageInfo

func (m *GetTermRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

type GetTermResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_GetTermResponse proto.InternalMessageInfo

func (m *GetTermResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type WatchRequest struct {
	ID v1.PrimitiveID `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
}

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

var xxx_messageInfo_WatchRequest proto.InternalMessageInfo

func (m *WatchRequest) GetID() v1.PrimitiveID {
	if m != nil {
		return m.ID
	}
	return v1.PrimitiveID{}
}

type WatchResponse struct {
	Term Term `protobuf:"bytes,1,opt,name=term,proto3" json:"term"`
}

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

var xxx_messageInfo_WatchResponse proto.InternalMessageInfo

func (m *WatchResponse) GetTerm() Term {
	if m != nil {
		return m.Term
	}
	return Term{}
}

type Term struct {
	Term       uint64   `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
	Leader     string   `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"`
	Candidates []string `protobuf:"bytes,3,rep,name=candidates,proto3" json:"candidates,omitempty"`
}

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

var xxx_messageInfo_Term proto.InternalMessageInfo

func (m *Term) GetTerm() uint64 {
	if m != nil {
		return m.Term
	}
	return 0
}

func (m *Term) GetLeader() string {
	if m != nil {
		return m.Leader
	}
	return ""
}

func (m *Term) GetCandidates() []string {
	if m != nil {
		return m.Candidates
	}
	return nil
}

func init() {
	proto.RegisterType((*EnterRequest)(nil), "atomix.runtime.election.v1.EnterRequest")
	proto.RegisterType((*EnterResponse)(nil), "atomix.runtime.election.v1.EnterResponse")
	proto.RegisterType((*WithdrawRequest)(nil), "atomix.runtime.election.v1.WithdrawRequest")
	proto.RegisterType((*WithdrawResponse)(nil), "atomix.runtime.election.v1.WithdrawResponse")
	proto.RegisterType((*AnointRequest)(nil), "atomix.runtime.election.v1.AnointRequest")
	proto.RegisterType((*AnointResponse)(nil), "atomix.runtime.election.v1.AnointResponse")
	proto.RegisterType((*PromoteRequest)(nil), "atomix.runtime.election.v1.PromoteRequest")
	proto.RegisterType((*PromoteResponse)(nil), "atomix.runtime.election.v1.PromoteResponse")
	proto.RegisterType((*DemoteRequest)(nil), "atomix.runtime.election.v1.DemoteRequest")
	proto.RegisterType((*DemoteResponse)(nil), "atomix.runtime.election.v1.DemoteResponse")
	proto.RegisterType((*EvictRequest)(nil), "atomix.runtime.election.v1.EvictRequest")
	proto.RegisterType((*EvictResponse)(nil), "atomix.runtime.election.v1.EvictResponse")
	proto.RegisterType((*GetTermRequest)(nil), "atomix.runtime.election.v1.GetTermRequest")
	proto.RegisterType((*GetTermResponse)(nil), "atomix.runtime.election.v1.GetTermResponse")
	proto.RegisterType((*WatchRequest)(nil), "atomix.runtime.election.v1.WatchRequest")
	proto.RegisterType((*WatchResponse)(nil), "atomix.runtime.election.v1.WatchResponse")
	proto.RegisterType((*Term)(nil), "atomix.runtime.election.v1.Term")
}

func init() {
	proto.RegisterFile("runtime/election/v1/election.proto", fileDescriptor_82125d8a3de9ca9e)
}

var fileDescriptor_82125d8a3de9ca9e = []byte{
	// 609 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x6f, 0xd3, 0x40,
	0x10, 0x8d, 0xf3, 0x49, 0x86, 0x26, 0xad, 0x56, 0x08, 0x05, 0x0b, 0xb9, 0x51, 0xb8, 0x04, 0x8a,
	0x1c, 0x52, 0x6e, 0xbd, 0x91, 0xa6, 0xaa, 0x4a, 0x03, 0x8a, 0x2c, 0x44, 0x2f, 0x08, 0xe4, 0xc4,
	0xab, 0x66, 0x21, 0xf6, 0x86, 0xf5, 0xd6, 0xf0, 0x13, 0x38, 0xf2, 0xb3, 0x7a, 0xec, 0x91, 0x53,
	0x85, 0x12, 0x89, 0xdf, 0x81, 0x6c, 0xaf, 0x13, 0x3b, 0x52, 0x37, 0x3e, 0x38, 0xbd, 0x6d, 0x66,
	0xdf, 0xcc, 0x7b, 0xb3, 0x93, 0x79, 0x09, 0xb4, 0xd8, 0x95, 0xc3, 0x89, 0x8d, 0x3b, 0x78, 0x8a,
	0xc7, 0x9c, 0x50, 0xa7, 0xe3, 0x75, 0x97, 0x67, 0x7d, 0xc6, 0x28, 0xa7, 0x48, 0x35, 0x39, 0xb5,
	0xc9, 0x4f, 0x5d, 0x40, 0xf5, 0xe5, 0xb5, 0xd7, 0x55, 0x1b, 0x51, 0xbe, 0xd7, 0xed, 0x44, 0xf7,
	0x41, 0x96, 0xfa, 0x4c, 0x56, 0xd9, 0x15, 0xa0, 0x47, 0x97, 0xf4, 0x92, 0x06, 0xc7, 0x8e, 0x7f,
	0x0a, 0xa3, 0xad, 0x09, 0xec, 0x9c, 0x38, 0x1c, 0x33, 0x03, 0x7f, 0xbf, 0xc2, 0x2e, 0x47, 0x47,
	0x90, 0x27, 0x56, 0x43, 0x69, 0x2a, 0xed, 0x87, 0x87, 0x9a, 0xbe, 0xa6, 0xc6, 0xeb, 0xea, 0x43,
	0x46, 0x6c, 0xc2, 0x89, 0x87, 0xcf, 0xfa, 0x3d, 0xb8, 0xbe, 0xdd, 0xcf, 0xcd, 0x6f, 0xf7, 0xf3,
	0x67, 0x7d, 0x23, 0x4f, 0x2c, 0xf4, 0x14, 0xaa, 0x63, 0xd3, 0xb1, 0x88, 0x65, 0x72, 0xdc, 0xc8,
	0x37, 0x95, 0x76, 0xd5, 0x58, 0x05, 0x5a, 0xe7, 0x50, 0x13, 0x4c, 0xee, 0x8c, 0x3a, 0x2e, 0x46,
	0x47, 0x50, 0xe4, 0x98, 0xd9, 0x82, 0xac, 0xa9, 0xdf, 0xdd, 0xba, 0xfe, 0x01, 0x33, 0xbb, 0x57,
	0xf4, 0xe9, 0x8c, 0x20, 0xa7, 0xf5, 0x0d, 0x76, 0x2f, 0x08, 0x9f, 0x58, 0xcc, 0xfc, 0xb1, 0x7d,
	0xe5, 0xef, 0x61, 0x6f, 0x45, 0x96, 0x81, 0x78, 0x02, 0xb5, 0x37, 0x0e, 0x25, 0x0e, 0xdf, 0xbe,
	0xf4, 0x01, 0xd4, 0x23, 0xaa, 0x0c, 0x84, 0x7f, 0x85, 0xfa, 0x90, 0x51, 0x9b, 0x72, 0xbc, 0x7d,
	0xe5, 0xef, 0x60, 0x77, 0xc9, 0x95, 0xcd, 0x9b, 0xf7, 0xf1, 0xfd, 0x28, 0x1f, 0x40, 0x3d, 0xa2,
	0xca, 0x40, 0xb8, 0xbf, 0xa0, 0x1e, 0x19, 0xf3, 0xfb, 0x59, 0xd0, 0x90, 0x29, 0x03, 0xd9, 0x03,
	0xa8, 0x9f, 0x62, 0xee, 0x87, 0x33, 0x10, 0xee, 0x7f, 0x19, 0x96, 0xd5, 0x32, 0x10, 0xf7, 0x16,
	0x76, 0x2e, 0x4c, 0x3e, 0x9e, 0x64, 0x21, 0xed, 0x1c, 0x6a, 0xa2, 0x56, 0x06, 0xc2, 0x0c, 0x28,
	0xfa, 0x31, 0x84, 0x62, 0x35, 0x8a, 0xe1, 0x1d, 0x7a, 0x0c, 0xe5, 0x29, 0x36, 0x2d, 0xcc, 0xc4,
	0xe4, 0xc4, 0x27, 0xa4, 0x01, 0x2c, 0x67, 0xe8, 0x36, 0x0a, 0xcd, 0x42, 0xbb, 0x6a, 0xc4, 0x22,
	0x87, 0xff, 0x2a, 0x50, 0x1f, 0x04, 0xd0, 0x13, 0x41, 0x8d, 0x3e, 0x41, 0x29, 0xb0, 0x62, 0xd4,
	0x96, 0xa9, 0x8b, 0xff, 0x2e, 0xa8, 0xcf, 0x53, 0x20, 0xc5, 0x03, 0x60, 0x78, 0x10, 0xd9, 0x25,
	0x3a, 0x90, 0xa5, 0xad, 0x39, 0xb8, 0xfa, 0x32, 0x1d, 0x58, 0xd0, 0x7c, 0x81, 0x72, 0x68, 0x6d,
	0x48, 0xaa, 0x2d, 0xe1, 0xb4, 0xea, 0x8b, 0x34, 0x50, 0x41, 0x30, 0x82, 0x8a, 0x70, 0x20, 0x24,
	0x4d, 0x4b, 0x5a, 0xa2, 0x7a, 0x90, 0x0a, 0xbb, 0x6a, 0x22, 0xf4, 0x0a, 0x79, 0x13, 0x09, 0xeb,
	0x92, 0x37, 0xb1, 0x66, 0x3d, 0xfe, 0xa8, 0xfd, 0xa5, 0xde, 0x30, 0xea, 0x98, 0xc3, 0x6c, 0x18,
	0x75, 0xc2, 0x21, 0x46, 0x50, 0x11, 0x7b, 0x29, 0x7f, 0xa2, 0xa4, 0x15, 0xc8, 0x9f, 0x68, 0x7d,
	0xd1, 0x3f, 0x43, 0x29, 0x58, 0x30, 0x79, 0x07, 0xf1, 0x7d, 0x96, 0x77, 0x90, 0xd8, 0xd6, 0x57,
	0x0a, 0xb2, 0xa0, 0x7c, 0xcc, 0xb0, 0xb9, 0x69, 0x04, 0x21, 0x26, 0xd5, 0x08, 0x22, 0x68, 0x48,
	0xd1, 0x2a, 0xfc, 0xca, 0x2b, 0xc8, 0x84, 0xd2, 0xf1, 0x94, 0xba, 0x58, 0xde, 0x45, 0x00, 0x49,
	0xd5, 0x85, 0x40, 0xc6, 0x28, 0x7a, 0xa7, 0xd7, 0x73, 0x4d, 0xb9, 0x99, 0x6b, 0xca, 0xdf, 0xb9,
	0xa6, 0xfc, 0x5e, 0x68, 0xb9, 0x9b, 0x85, 0x96, 0xfb, 0xb3, 0xd0, 0x72, 0xf0, 0x84, 0xd0, 0xa8,
	0x96, 0x39, 0x23, 0xf1, 0x3a, 0xbd, 0xbd, 0xa4, 0x35, 0x7c, 0xec, 0x0e, 0x95, 0x51, 0x39, 0xf8,
	0x6b, 0xf8, 0xfa, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x48, 0x57, 0x29, 0xb1, 0x0a, 0x00,
	0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// LeaderElectionClient is the client API for LeaderElection service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LeaderElectionClient interface {
	// Enter enters the leader election
	Enter(ctx context.Context, in *EnterRequest, opts ...grpc.CallOption) (*EnterResponse, error)
	// Withdraw withdraws a candidate from the leader election
	Withdraw(ctx context.Context, in *WithdrawRequest, opts ...grpc.CallOption) (*WithdrawResponse, error)
	// Anoint anoints a candidate leader
	Anoint(ctx context.Context, in *AnointRequest, opts ...grpc.CallOption) (*AnointResponse, error)
	// Promote promotes a candidate
	Promote(ctx context.Context, in *PromoteRequest, opts ...grpc.CallOption) (*PromoteResponse, error)
	// Demote demotes a candidate
	Demote(ctx context.Context, in *DemoteRequest, opts ...grpc.CallOption) (*DemoteResponse, error)
	// Evict evicts a candidate from the election
	Evict(ctx context.Context, in *EvictRequest, opts ...grpc.CallOption) (*EvictResponse, error)
	// GetTerm gets the current leadership term
	GetTerm(ctx context.Context, in *GetTermRequest, opts ...grpc.CallOption) (*GetTermResponse, error)
	// Watch watches the election for events
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (LeaderElection_WatchClient, error)
	// Create creates the election
	// Deprecated: use the LeaderElections service instead
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Close closes the election
	// Deprecated: use the LeaderElections service instead
	Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error)
}

type leaderElectionClient struct {
	cc *grpc.ClientConn
}

func NewLeaderElectionClient(cc *grpc.ClientConn) LeaderElectionClient {
	return &leaderElectionClient{cc}
}

func (c *leaderElectionClient) Enter(ctx context.Context, in *EnterRequest, opts ...grpc.CallOption) (*EnterResponse, error) {
	out := new(EnterResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Enter", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Withdraw(ctx context.Context, in *WithdrawRequest, opts ...grpc.CallOption) (*WithdrawResponse, error) {
	out := new(WithdrawResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Withdraw", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Anoint(ctx context.Context, in *AnointRequest, opts ...grpc.CallOption) (*AnointResponse, error) {
	out := new(AnointResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Anoint", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Promote(ctx context.Context, in *PromoteRequest, opts ...grpc.CallOption) (*PromoteResponse, error) {
	out := new(PromoteResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Promote", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Demote(ctx context.Context, in *DemoteRequest, opts ...grpc.CallOption) (*DemoteResponse, error) {
	out := new(DemoteResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Demote", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Evict(ctx context.Context, in *EvictRequest, opts ...grpc.CallOption) (*EvictResponse, error) {
	out := new(EvictResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Evict", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) GetTerm(ctx context.Context, in *GetTermRequest, opts ...grpc.CallOption) (*GetTermResponse, error) {
	out := new(GetTermResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/GetTerm", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *leaderElectionClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (LeaderElection_WatchClient, error) {
	stream, err := c.cc.NewStream(ctx, &_LeaderElection_serviceDesc.Streams[0], "/atomix.runtime.election.v1.LeaderElection/Watch", opts...)
	if err != nil {
		return nil, err
	}
	x := &leaderElectionWatchClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type LeaderElection_WatchClient interface {
	Recv() (*WatchResponse, error)
	grpc.ClientStream
}

type leaderElectionWatchClient struct {
	grpc.ClientStream
}

func (x *leaderElectionWatchClient) Recv() (*WatchResponse, error) {
	m := new(WatchResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Deprecated: Do not use.
func (c *leaderElectionClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
	out := new(CreateResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Create", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Deprecated: Do not use.
func (c *leaderElectionClient) Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error) {
	out := new(CloseResponse)
	err := c.cc.Invoke(ctx, "/atomix.runtime.election.v1.LeaderElection/Close", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LeaderElectionServer is the server API for LeaderElection service.
type LeaderElectionServer interface {
	// Enter enters the leader election
	Enter(context.Context, *EnterRequest) (*EnterResponse, error)
	// Withdraw withdraws a candidate from the leader election
	Withdraw(context.Context, *WithdrawRequest) (*WithdrawResponse, error)
	// Anoint anoints a candidate leader
	Anoint(context.Context, *AnointRequest) (*AnointResponse, error)
	// Promote promotes a candidate
	Promote(context.Context, *PromoteRequest) (*PromoteResponse, error)
	// Demote demotes a candidate
	Demote(context.Context, *DemoteRequest) (*DemoteResponse, error)
	// Evict evicts a candidate from the election
	Evict(context.Context, *EvictRequest) (*EvictResponse, error)
	// GetTerm gets the current leadership term
	GetTerm(context.Context, *GetTermRequest) (*GetTermResponse, error)
	// Watch watches the election for events
	Watch(*WatchRequest, LeaderElection_WatchServer) error
	// Create creates the election
	// Deprecated: use the LeaderElections service instead
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Close closes the election
	// Deprecated: use the LeaderElections service instead
	Close(context.Context, *CloseRequest) (*CloseResponse, error)
}

// UnimplementedLeaderElectionServer can be embedded to have forward compatible implementations.
type UnimplementedLeaderElectionServer struct {
}

func (*UnimplementedLeaderElectionServer) Enter(ctx context.Context, req *EnterRequest) (*EnterResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Enter not implemented")
}
func (*UnimplementedLeaderElectionServer) Withdraw(ctx context.Context, req *WithdrawRequest) (*WithdrawResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Withdraw not implemented")
}
func (*UnimplementedLeaderElectionServer) Anoint(ctx context.Context, req *AnointRequest) (*AnointResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Anoint not implemented")
}
func (*UnimplementedLeaderElectionServer) Promote(ctx context.Context, req *PromoteRequest) (*PromoteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Promote not implemented")
}
func (*UnimplementedLeaderElectionServer) Demote(ctx context.Context, req *DemoteRequest) (*DemoteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Demote not implemented")
}
func (*UnimplementedLeaderElectionServer) Evict(ctx context.Context, req *EvictRequest) (*EvictResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Evict not implemented")
}
func (*UnimplementedLeaderElectionServer) GetTerm(ctx context.Context, req *GetTermRequest) (*GetTermResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetTerm not implemented")
}
func (*UnimplementedLeaderElectionServer) Watch(req *WatchRequest, srv LeaderElection_WatchServer) error {
	return status.Errorf(codes.Unimplemented, "method Watch not implemented")
}
func (*UnimplementedLeaderElectionServer) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (*UnimplementedLeaderElectionServer) Close(ctx context.Context, req *CloseRequest) (*CloseResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Close not implemented")
}

func RegisterLeaderElectionServer(s *grpc.Server, srv LeaderElectionServer) {
	s.RegisterService(&_LeaderElection_serviceDesc, srv)
}

func _LeaderElection_Enter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EnterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Enter(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Enter",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Enter(ctx, req.(*EnterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Withdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WithdrawRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Withdraw(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Withdraw",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Withdraw(ctx, req.(*WithdrawRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Anoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AnointRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Anoint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Anoint",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Anoint(ctx, req.(*AnointRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Promote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PromoteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Promote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Promote",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Promote(ctx, req.(*PromoteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Demote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DemoteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Demote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Demote",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Demote(ctx, req.(*DemoteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Evict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EvictRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Evict(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Evict",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Evict(ctx, req.(*EvictRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_GetTerm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTermRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).GetTerm(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/GetTerm",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).GetTerm(ctx, req.(*GetTermRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(WatchRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LeaderElectionServer).Watch(m, &leaderElectionWatchServer{stream})
}

type LeaderElection_WatchServer interface {
	Send(*WatchResponse) error
	grpc.ServerStream
}

type leaderElectionWatchServer struct {
	grpc.ServerStream
}

func (x *leaderElectionWatchServer) Send(m *WatchResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _LeaderElection_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Create",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Create(ctx, req.(*CreateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LeaderElection_Close_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CloseRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LeaderElectionServer).Close(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.runtime.election.v1.LeaderElection/Close",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LeaderElectionServer).Close(ctx, req.(*CloseRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _LeaderElection_serviceDesc = grpc.ServiceDesc{
	ServiceName: "atomix.runtime.election.v1.LeaderElection",
	HandlerType: (*LeaderElectionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Enter",
			Handler:    _LeaderElection_Enter_Handler,
		},
		{
			MethodName: "Withdraw",
			Handler:    _LeaderElection_Withdraw_Handler,
		},
		{
			MethodName: "Anoint",
			Handler:    _LeaderElection_Anoint_Handler,
		},
		{
			MethodName: "Promote",
			Handler:    _LeaderElection_Promote_Handler,
		},
		{
			MethodName: "Demote",
			Handler:    _LeaderElection_Demote_Handler,
		},
		{
			MethodName: "Evict",
			Handler:    _LeaderElection_Evict_Handler,
		},
		{
			MethodName: "GetTerm",
			Handler:    _LeaderElection_GetTerm_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _LeaderElection_Create_Handler,
		},
		{
			MethodName: "Close",
			Handler:    _LeaderElection_Close_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Watch",
			Handler:       _LeaderElection_Watch_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "runtime/election/v1/election.proto",
}

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

func (m *EnterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *EnterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *WithdrawRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *WithdrawResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *AnointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *AnointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *PromoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *PromoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *DemoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *DemoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *EvictRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidate) > 0 {
		i -= len(m.Candidate)
		copy(dAtA[i:], m.Candidate)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Candidate)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *EvictResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *GetTermRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *GetTermResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.ID.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *WatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Term.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintElection(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

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

func (m *Term) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Candidates) > 0 {
		for iNdEx := len(m.Candidates) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Candidates[iNdEx])
			copy(dAtA[i:], m.Candidates[iNdEx])
			i = encodeVarintElection(dAtA, i, uint64(len(m.Candidates[iNdEx])))
			i--
			dAtA[i] = 0x1a
		}
	}
	if len(m.Leader) > 0 {
		i -= len(m.Leader)
		copy(dAtA[i:], m.Leader)
		i = encodeVarintElection(dAtA, i, uint64(len(m.Leader)))
		i--
		dAtA[i] = 0x12
	}
	if m.Term != 0 {
		i = encodeVarintElection(dAtA, i, uint64(m.Term))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *EnterResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *WithdrawRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	l = len(m.Candidate)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	return n
}

func (m *WithdrawResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *AnointRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	l = len(m.Candidate)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	return n
}

func (m *AnointResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *PromoteRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	l = len(m.Candidate)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	return n
}

func (m *PromoteResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *DemoteRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	l = len(m.Candidate)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	return n
}

func (m *DemoteResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *EvictRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	l = len(m.Candidate)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	return n
}

func (m *EvictResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *GetTermRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *GetTermResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *WatchRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.ID.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *WatchResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Term.Size()
	n += 1 + l + sovElection(uint64(l))
	return n
}

func (m *Term) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Term != 0 {
		n += 1 + sovElection(uint64(m.Term))
	}
	l = len(m.Leader)
	if l > 0 {
		n += 1 + l + sovElection(uint64(l))
	}
	if len(m.Candidates) > 0 {
		for _, s := range m.Candidates {
			l = len(s)
			n += 1 + l + sovElection(uint64(l))
		}
	}
	return n
}

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

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *EnterResponse) 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 ErrIntOverflowElection
			}
			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: EnterResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: EnterResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *WithdrawRequest) 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 ErrIntOverflowElection
			}
			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: WithdrawRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: WithdrawRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidate = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *WithdrawResponse) 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 ErrIntOverflowElection
			}
			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: WithdrawResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: WithdrawResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *AnointRequest) 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 ErrIntOverflowElection
			}
			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: AnointRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AnointRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidate = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *AnointResponse) 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 ErrIntOverflowElection
			}
			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: AnointResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AnointResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *PromoteRequest) 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 ErrIntOverflowElection
			}
			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: PromoteRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: PromoteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidate = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *PromoteResponse) 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 ErrIntOverflowElection
			}
			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: PromoteResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: PromoteResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *DemoteRequest) 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 ErrIntOverflowElection
			}
			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: DemoteRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: DemoteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidate = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *DemoteResponse) 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 ErrIntOverflowElection
			}
			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: DemoteResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: DemoteResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *EvictRequest) 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 ErrIntOverflowElection
			}
			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: EvictRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: EvictRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidate", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidate = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *EvictResponse) 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 ErrIntOverflowElection
			}
			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: EvictResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: EvictResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *GetTermRequest) 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 ErrIntOverflowElection
			}
			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: GetTermRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GetTermRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *GetTermResponse) 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 ErrIntOverflowElection
			}
			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: GetTermResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GetTermResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *WatchRequest) 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 ErrIntOverflowElection
			}
			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: WatchRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *WatchResponse) 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 ErrIntOverflowElection
			}
			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: WatchResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthElection
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Term.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Term) 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 ErrIntOverflowElection
			}
			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: Term: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Term: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			m.Term = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Term |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Leader = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Candidates", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowElection
				}
				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 ErrInvalidLengthElection
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthElection
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Candidates = append(m.Candidates, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipElection(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthElection
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

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

var (
	ErrInvalidLengthElection        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowElection          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupElection = fmt.Errorf("proto: unexpected end of group")
)
