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

package v1

import (
	context "context"
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	_ "github.com/gogo/protobuf/types"
	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
	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"
	time "time"
)

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

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

const (
	SessionSnapshot_UNKNOWN SessionSnapshot_State = 0
	SessionSnapshot_OPEN    SessionSnapshot_State = 1
	SessionSnapshot_CLOSED  SessionSnapshot_State = 2
)

var SessionSnapshot_State_name = map[int32]string{
	0: "UNKNOWN",
	1: "OPEN",
	2: "CLOSED",
}

var SessionSnapshot_State_value = map[string]int32{
	"UNKNOWN": 0,
	"OPEN":    1,
	"CLOSED":  2,
}

func (x SessionSnapshot_State) String() string {
	return proto.EnumName(SessionSnapshot_State_name, int32(x))
}

func (SessionSnapshot_State) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_6c085d9ecb5b063a, []int{8, 0}
}

type SessionProposalSnapshot_Phase int32

const (
	SessionProposalSnapshot_PENDING  SessionProposalSnapshot_Phase = 0
	SessionProposalSnapshot_RUNNING  SessionProposalSnapshot_Phase = 1
	SessionProposalSnapshot_COMPLETE SessionProposalSnapshot_Phase = 2
	SessionProposalSnapshot_CANCELED SessionProposalSnapshot_Phase = 3
)

var SessionProposalSnapshot_Phase_name = map[int32]string{
	0: "PENDING",
	1: "RUNNING",
	2: "COMPLETE",
	3: "CANCELED",
}

var SessionProposalSnapshot_Phase_value = map[string]int32{
	"PENDING":  0,
	"RUNNING":  1,
	"COMPLETE": 2,
	"CANCELED": 3,
}

func (x SessionProposalSnapshot_Phase) String() string {
	return proto.EnumName(SessionProposalSnapshot_Phase_name, int32(x))
}

func (SessionProposalSnapshot_Phase) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_6c085d9ecb5b063a, []int{9, 0}
}

type CreatePrimitiveRequest struct {
	Headers              *ProposalRequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
	CreatePrimitiveInput `protobuf:"bytes,2,opt,name=input,proto3,embedded=input" json:"input"`
}

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

var xxx_messageInfo_CreatePrimitiveRequest proto.InternalMessageInfo

func (m *CreatePrimitiveRequest) GetHeaders() *ProposalRequestHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type CreatePrimitiveResponse struct {
	Headers                *ProposalResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
	*CreatePrimitiveOutput `protobuf:"bytes,2,opt,name=output,proto3,embedded=output" json:"output,omitempty"`
}

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

var xxx_messageInfo_CreatePrimitiveResponse proto.InternalMessageInfo

func (m *CreatePrimitiveResponse) GetHeaders() *ProposalResponseHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type ClosePrimitiveRequest struct {
	Headers             *ProposalRequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
	ClosePrimitiveInput `protobuf:"bytes,2,opt,name=input,proto3,embedded=input" json:"input"`
}

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

var xxx_messageInfo_ClosePrimitiveRequest proto.InternalMessageInfo

func (m *ClosePrimitiveRequest) GetHeaders() *ProposalRequestHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type ClosePrimitiveResponse struct {
	Headers               *ProposalResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
	*ClosePrimitiveOutput `protobuf:"bytes,2,opt,name=output,proto3,embedded=output" json:"output,omitempty"`
}

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

var xxx_messageInfo_ClosePrimitiveResponse proto.InternalMessageInfo

func (m *ClosePrimitiveResponse) GetHeaders() *ProposalResponseHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type SessionProposalInput struct {
	SessionID   SessionID   `protobuf:"varint,1,opt,name=session_id,json=sessionId,proto3,casttype=SessionID" json:"session_id,omitempty"`
	SequenceNum SequenceNum `protobuf:"varint,2,opt,name=sequence_num,json=sequenceNum,proto3,casttype=SequenceNum" json:"sequence_num,omitempty"`
	// Types that are valid to be assigned to Input:
	//	*SessionProposalInput_CreatePrimitive
	//	*SessionProposalInput_ClosePrimitive
	//	*SessionProposalInput_Proposal
	Input isSessionProposalInput_Input `protobuf_oneof:"input"`
}

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

var xxx_messageInfo_SessionProposalInput proto.InternalMessageInfo

type isSessionProposalInput_Input interface {
	isSessionProposalInput_Input()
	MarshalTo([]byte) (int, error)
	Size() int
}

type SessionProposalInput_CreatePrimitive struct {
	CreatePrimitive *CreatePrimitiveInput `protobuf:"bytes,3,opt,name=create_primitive,json=createPrimitive,proto3,oneof" json:"create_primitive,omitempty"`
}
type SessionProposalInput_ClosePrimitive struct {
	ClosePrimitive *ClosePrimitiveInput `protobuf:"bytes,4,opt,name=close_primitive,json=closePrimitive,proto3,oneof" json:"close_primitive,omitempty"`
}
type SessionProposalInput_Proposal struct {
	Proposal *PrimitiveProposalInput `protobuf:"bytes,5,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"`
}

func (*SessionProposalInput_CreatePrimitive) isSessionProposalInput_Input() {}
func (*SessionProposalInput_ClosePrimitive) isSessionProposalInput_Input()  {}
func (*SessionProposalInput_Proposal) isSessionProposalInput_Input()        {}

func (m *SessionProposalInput) GetInput() isSessionProposalInput_Input {
	if m != nil {
		return m.Input
	}
	return nil
}

func (m *SessionProposalInput) GetSessionID() SessionID {
	if m != nil {
		return m.SessionID
	}
	return 0
}

func (m *SessionProposalInput) GetSequenceNum() SequenceNum {
	if m != nil {
		return m.SequenceNum
	}
	return 0
}

func (m *SessionProposalInput) GetCreatePrimitive() *CreatePrimitiveInput {
	if x, ok := m.GetInput().(*SessionProposalInput_CreatePrimitive); ok {
		return x.CreatePrimitive
	}
	return nil
}

func (m *SessionProposalInput) GetClosePrimitive() *ClosePrimitiveInput {
	if x, ok := m.GetInput().(*SessionProposalInput_ClosePrimitive); ok {
		return x.ClosePrimitive
	}
	return nil
}

func (m *SessionProposalInput) GetProposal() *PrimitiveProposalInput {
	if x, ok := m.GetInput().(*SessionProposalInput_Proposal); ok {
		return x.Proposal
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*SessionProposalInput) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*SessionProposalInput_CreatePrimitive)(nil),
		(*SessionProposalInput_ClosePrimitive)(nil),
		(*SessionProposalInput_Proposal)(nil),
	}
}

type SessionProposalOutput struct {
	SequenceNum SequenceNum `protobuf:"varint,1,opt,name=sequence_num,json=sequenceNum,proto3,casttype=SequenceNum" json:"sequence_num,omitempty"`
	Failure     *Failure    `protobuf:"bytes,2,opt,name=failure,proto3" json:"failure,omitempty"`
	// Types that are valid to be assigned to Output:
	//	*SessionProposalOutput_CreatePrimitive
	//	*SessionProposalOutput_ClosePrimitive
	//	*SessionProposalOutput_Proposal
	Output isSessionProposalOutput_Output `protobuf_oneof:"output"`
}

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

var xxx_messageInfo_SessionProposalOutput proto.InternalMessageInfo

type isSessionProposalOutput_Output interface {
	isSessionProposalOutput_Output()
	MarshalTo([]byte) (int, error)
	Size() int
}

type SessionProposalOutput_CreatePrimitive struct {
	CreatePrimitive *CreatePrimitiveOutput `protobuf:"bytes,3,opt,name=create_primitive,json=createPrimitive,proto3,oneof" json:"create_primitive,omitempty"`
}
type SessionProposalOutput_ClosePrimitive struct {
	ClosePrimitive *ClosePrimitiveOutput `protobuf:"bytes,4,opt,name=close_primitive,json=closePrimitive,proto3,oneof" json:"close_primitive,omitempty"`
}
type SessionProposalOutput_Proposal struct {
	Proposal *PrimitiveProposalOutput `protobuf:"bytes,5,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"`
}

func (*SessionProposalOutput_CreatePrimitive) isSessionProposalOutput_Output() {}
func (*SessionProposalOutput_ClosePrimitive) isSessionProposalOutput_Output()  {}
func (*SessionProposalOutput_Proposal) isSessionProposalOutput_Output()        {}

func (m *SessionProposalOutput) GetOutput() isSessionProposalOutput_Output {
	if m != nil {
		return m.Output
	}
	return nil
}

func (m *SessionProposalOutput) GetSequenceNum() SequenceNum {
	if m != nil {
		return m.SequenceNum
	}
	return 0
}

func (m *SessionProposalOutput) GetFailure() *Failure {
	if m != nil {
		return m.Failure
	}
	return nil
}

func (m *SessionProposalOutput) GetCreatePrimitive() *CreatePrimitiveOutput {
	if x, ok := m.GetOutput().(*SessionProposalOutput_CreatePrimitive); ok {
		return x.CreatePrimitive
	}
	return nil
}

func (m *SessionProposalOutput) GetClosePrimitive() *ClosePrimitiveOutput {
	if x, ok := m.GetOutput().(*SessionProposalOutput_ClosePrimitive); ok {
		return x.ClosePrimitive
	}
	return nil
}

func (m *SessionProposalOutput) GetProposal() *PrimitiveProposalOutput {
	if x, ok := m.GetOutput().(*SessionProposalOutput_Proposal); ok {
		return x.Proposal
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*SessionProposalOutput) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*SessionProposalOutput_CreatePrimitive)(nil),
		(*SessionProposalOutput_ClosePrimitive)(nil),
		(*SessionProposalOutput_Proposal)(nil),
	}
}

type SessionQueryInput struct {
	SessionID   SessionID   `protobuf:"varint,1,opt,name=session_id,json=sessionId,proto3,casttype=SessionID" json:"session_id,omitempty"`
	SequenceNum SequenceNum `protobuf:"varint,2,opt,name=sequence_num,json=sequenceNum,proto3,casttype=SequenceNum" json:"sequence_num,omitempty"`
	// Types that are valid to be assigned to Input:
	//	*SessionQueryInput_Query
	Input isSessionQueryInput_Input `protobuf_oneof:"input"`
}

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

var xxx_messageInfo_SessionQueryInput proto.InternalMessageInfo

type isSessionQueryInput_Input interface {
	isSessionQueryInput_Input()
	MarshalTo([]byte) (int, error)
	Size() int
}

type SessionQueryInput_Query struct {
	Query *PrimitiveQueryInput `protobuf:"bytes,3,opt,name=query,proto3,oneof" json:"query,omitempty"`
}

func (*SessionQueryInput_Query) isSessionQueryInput_Input() {}

func (m *SessionQueryInput) GetInput() isSessionQueryInput_Input {
	if m != nil {
		return m.Input
	}
	return nil
}

func (m *SessionQueryInput) GetSessionID() SessionID {
	if m != nil {
		return m.SessionID
	}
	return 0
}

func (m *SessionQueryInput) GetSequenceNum() SequenceNum {
	if m != nil {
		return m.SequenceNum
	}
	return 0
}

func (m *SessionQueryInput) GetQuery() *PrimitiveQueryInput {
	if x, ok := m.GetInput().(*SessionQueryInput_Query); ok {
		return x.Query
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*SessionQueryInput) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*SessionQueryInput_Query)(nil),
	}
}

type SessionQueryOutput struct {
	Failure *Failure `protobuf:"bytes,1,opt,name=failure,proto3" json:"failure,omitempty"`
	// Types that are valid to be assigned to Output:
	//	*SessionQueryOutput_Query
	Output isSessionQueryOutput_Output `protobuf_oneof:"output"`
}

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

var xxx_messageInfo_SessionQueryOutput proto.InternalMessageInfo

type isSessionQueryOutput_Output interface {
	isSessionQueryOutput_Output()
	MarshalTo([]byte) (int, error)
	Size() int
}

type SessionQueryOutput_Query struct {
	Query *PrimitiveQueryOutput `protobuf:"bytes,2,opt,name=query,proto3,oneof" json:"query,omitempty"`
}

func (*SessionQueryOutput_Query) isSessionQueryOutput_Output() {}

func (m *SessionQueryOutput) GetOutput() isSessionQueryOutput_Output {
	if m != nil {
		return m.Output
	}
	return nil
}

func (m *SessionQueryOutput) GetFailure() *Failure {
	if m != nil {
		return m.Failure
	}
	return nil
}

func (m *SessionQueryOutput) GetQuery() *PrimitiveQueryOutput {
	if x, ok := m.GetOutput().(*SessionQueryOutput_Query); ok {
		return x.Query
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*SessionQueryOutput) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*SessionQueryOutput_Query)(nil),
	}
}

type SessionSnapshot struct {
	SessionID   SessionID             `protobuf:"varint,1,opt,name=session_id,json=sessionId,proto3,casttype=SessionID" json:"session_id,omitempty"`
	State       SessionSnapshot_State `protobuf:"varint,2,opt,name=state,proto3,enum=atomix.protocols.rsm.v1.SessionSnapshot_State" json:"state,omitempty"`
	Timeout     time.Duration         `protobuf:"bytes,3,opt,name=timeout,proto3,stdduration" json:"timeout"`
	LastUpdated time.Time             `protobuf:"bytes,4,opt,name=last_updated,json=lastUpdated,proto3,stdtime" json:"last_updated"`
}

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

var xxx_messageInfo_SessionSnapshot proto.InternalMessageInfo

func (m *SessionSnapshot) GetSessionID() SessionID {
	if m != nil {
		return m.SessionID
	}
	return 0
}

func (m *SessionSnapshot) GetState() SessionSnapshot_State {
	if m != nil {
		return m.State
	}
	return SessionSnapshot_UNKNOWN
}

func (m *SessionSnapshot) GetTimeout() time.Duration {
	if m != nil {
		return m.Timeout
	}
	return 0
}

func (m *SessionSnapshot) GetLastUpdated() time.Time {
	if m != nil {
		return m.LastUpdated
	}
	return time.Time{}
}

type SessionProposalSnapshot struct {
	Index                 Index                         `protobuf:"varint,1,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Phase                 SessionProposalSnapshot_Phase `protobuf:"varint,2,opt,name=phase,proto3,enum=atomix.protocols.rsm.v1.SessionProposalSnapshot_Phase" json:"phase,omitempty"`
	Input                 *SessionProposalInput         `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	PendingOutputs        []*SessionProposalOutput      `protobuf:"bytes,4,rep,name=pending_outputs,json=pendingOutputs,proto3" json:"pending_outputs,omitempty"`
	LastOutputSequenceNum SequenceNum                   `protobuf:"varint,5,opt,name=last_output_sequence_num,json=lastOutputSequenceNum,proto3,casttype=SequenceNum" json:"last_output_sequence_num,omitempty"`
	Timestamp             time.Time                     `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
}

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

var xxx_messageInfo_SessionProposalSnapshot proto.InternalMessageInfo

func (m *SessionProposalSnapshot) GetIndex() Index {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *SessionProposalSnapshot) GetPhase() SessionProposalSnapshot_Phase {
	if m != nil {
		return m.Phase
	}
	return SessionProposalSnapshot_PENDING
}

func (m *SessionProposalSnapshot) GetInput() *SessionProposalInput {
	if m != nil {
		return m.Input
	}
	return nil
}

func (m *SessionProposalSnapshot) GetPendingOutputs() []*SessionProposalOutput {
	if m != nil {
		return m.PendingOutputs
	}
	return nil
}

func (m *SessionProposalSnapshot) GetLastOutputSequenceNum() SequenceNum {
	if m != nil {
		return m.LastOutputSequenceNum
	}
	return 0
}

func (m *SessionProposalSnapshot) GetTimestamp() time.Time {
	if m != nil {
		return m.Timestamp
	}
	return time.Time{}
}

func init() {
	proto.RegisterEnum("atomix.protocols.rsm.v1.SessionSnapshot_State", SessionSnapshot_State_name, SessionSnapshot_State_value)
	proto.RegisterEnum("atomix.protocols.rsm.v1.SessionProposalSnapshot_Phase", SessionProposalSnapshot_Phase_name, SessionProposalSnapshot_Phase_value)
	proto.RegisterType((*CreatePrimitiveRequest)(nil), "atomix.protocols.rsm.v1.CreatePrimitiveRequest")
	proto.RegisterType((*CreatePrimitiveResponse)(nil), "atomix.protocols.rsm.v1.CreatePrimitiveResponse")
	proto.RegisterType((*ClosePrimitiveRequest)(nil), "atomix.protocols.rsm.v1.ClosePrimitiveRequest")
	proto.RegisterType((*ClosePrimitiveResponse)(nil), "atomix.protocols.rsm.v1.ClosePrimitiveResponse")
	proto.RegisterType((*SessionProposalInput)(nil), "atomix.protocols.rsm.v1.SessionProposalInput")
	proto.RegisterType((*SessionProposalOutput)(nil), "atomix.protocols.rsm.v1.SessionProposalOutput")
	proto.RegisterType((*SessionQueryInput)(nil), "atomix.protocols.rsm.v1.SessionQueryInput")
	proto.RegisterType((*SessionQueryOutput)(nil), "atomix.protocols.rsm.v1.SessionQueryOutput")
	proto.RegisterType((*SessionSnapshot)(nil), "atomix.protocols.rsm.v1.SessionSnapshot")
	proto.RegisterType((*SessionProposalSnapshot)(nil), "atomix.protocols.rsm.v1.SessionProposalSnapshot")
}

func init() { proto.RegisterFile("v1/session.proto", fileDescriptor_6c085d9ecb5b063a) }

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

// SessionClient is the client API for Session service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SessionClient interface {
	CreatePrimitive(ctx context.Context, in *CreatePrimitiveRequest, opts ...grpc.CallOption) (*CreatePrimitiveResponse, error)
	ClosePrimitive(ctx context.Context, in *ClosePrimitiveRequest, opts ...grpc.CallOption) (*ClosePrimitiveResponse, error)
}

type sessionClient struct {
	cc *grpc.ClientConn
}

func NewSessionClient(cc *grpc.ClientConn) SessionClient {
	return &sessionClient{cc}
}

func (c *sessionClient) CreatePrimitive(ctx context.Context, in *CreatePrimitiveRequest, opts ...grpc.CallOption) (*CreatePrimitiveResponse, error) {
	out := new(CreatePrimitiveResponse)
	err := c.cc.Invoke(ctx, "/atomix.protocols.rsm.v1.Session/CreatePrimitive", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *sessionClient) ClosePrimitive(ctx context.Context, in *ClosePrimitiveRequest, opts ...grpc.CallOption) (*ClosePrimitiveResponse, error) {
	out := new(ClosePrimitiveResponse)
	err := c.cc.Invoke(ctx, "/atomix.protocols.rsm.v1.Session/ClosePrimitive", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SessionServer is the server API for Session service.
type SessionServer interface {
	CreatePrimitive(context.Context, *CreatePrimitiveRequest) (*CreatePrimitiveResponse, error)
	ClosePrimitive(context.Context, *ClosePrimitiveRequest) (*ClosePrimitiveResponse, error)
}

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

func (*UnimplementedSessionServer) CreatePrimitive(ctx context.Context, req *CreatePrimitiveRequest) (*CreatePrimitiveResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreatePrimitive not implemented")
}
func (*UnimplementedSessionServer) ClosePrimitive(ctx context.Context, req *ClosePrimitiveRequest) (*ClosePrimitiveResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClosePrimitive not implemented")
}

func RegisterSessionServer(s *grpc.Server, srv SessionServer) {
	s.RegisterService(&_Session_serviceDesc, srv)
}

func _Session_CreatePrimitive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreatePrimitiveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SessionServer).CreatePrimitive(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.protocols.rsm.v1.Session/CreatePrimitive",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SessionServer).CreatePrimitive(ctx, req.(*CreatePrimitiveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Session_ClosePrimitive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ClosePrimitiveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SessionServer).ClosePrimitive(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.protocols.rsm.v1.Session/ClosePrimitive",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SessionServer).ClosePrimitive(ctx, req.(*ClosePrimitiveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Session_serviceDesc = grpc.ServiceDesc{
	ServiceName: "atomix.protocols.rsm.v1.Session",
	HandlerType: (*SessionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreatePrimitive",
			Handler:    _Session_CreatePrimitive_Handler,
		},
		{
			MethodName: "ClosePrimitive",
			Handler:    _Session_ClosePrimitive_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/session.proto",
}

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

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

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

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

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

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

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

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

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

func (m *SessionProposalInput) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Input != nil {
		{
			size := m.Input.Size()
			i -= size
			if _, err := m.Input.MarshalTo(dAtA[i:]); err != nil {
				return 0, err
			}
		}
	}
	if m.SequenceNum != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SequenceNum))
		i--
		dAtA[i] = 0x10
	}
	if m.SessionID != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SessionID))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *SessionProposalInput_CreatePrimitive) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.CreatePrimitive != nil {
		{
			size, err := m.CreatePrimitive.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x1a
	}
	return len(dAtA) - i, nil
}
func (m *SessionProposalInput_ClosePrimitive) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionProposalInput_ClosePrimitive) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.ClosePrimitive != nil {
		{
			size, err := m.ClosePrimitive.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x22
	}
	return len(dAtA) - i, nil
}
func (m *SessionProposalInput_Proposal) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionProposalInput_Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.Proposal != nil {
		{
			size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x2a
	}
	return len(dAtA) - i, nil
}
func (m *SessionProposalOutput) 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 *SessionProposalOutput) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionProposalOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Output != nil {
		{
			size := m.Output.Size()
			i -= size
			if _, err := m.Output.MarshalTo(dAtA[i:]); err != nil {
				return 0, err
			}
		}
	}
	if m.Failure != nil {
		{
			size, err := m.Failure.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if m.SequenceNum != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SequenceNum))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *SessionProposalOutput_CreatePrimitive) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.CreatePrimitive != nil {
		{
			size, err := m.CreatePrimitive.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x1a
	}
	return len(dAtA) - i, nil
}
func (m *SessionProposalOutput_ClosePrimitive) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionProposalOutput_ClosePrimitive) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.ClosePrimitive != nil {
		{
			size, err := m.ClosePrimitive.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x22
	}
	return len(dAtA) - i, nil
}
func (m *SessionProposalOutput_Proposal) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionProposalOutput_Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.Proposal != nil {
		{
			size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x2a
	}
	return len(dAtA) - i, nil
}
func (m *SessionQueryInput) 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 *SessionQueryInput) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionQueryInput) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Input != nil {
		{
			size := m.Input.Size()
			i -= size
			if _, err := m.Input.MarshalTo(dAtA[i:]); err != nil {
				return 0, err
			}
		}
	}
	if m.SequenceNum != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SequenceNum))
		i--
		dAtA[i] = 0x10
	}
	if m.SessionID != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SessionID))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *SessionQueryInput_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.Query != nil {
		{
			size, err := m.Query.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x1a
	}
	return len(dAtA) - i, nil
}
func (m *SessionQueryOutput) 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 *SessionQueryOutput) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionQueryOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Output != nil {
		{
			size := m.Output.Size()
			i -= size
			if _, err := m.Output.MarshalTo(dAtA[i:]); err != nil {
				return 0, err
			}
		}
	}
	if m.Failure != nil {
		{
			size, err := m.Failure.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

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

func (m *SessionQueryOutput_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	if m.Query != nil {
		{
			size, err := m.Query.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	return len(dAtA) - i, nil
}
func (m *SessionSnapshot) 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 *SessionSnapshot) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SessionSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated):])
	if err19 != nil {
		return 0, err19
	}
	i -= n19
	i = encodeVarintSession(dAtA, i, uint64(n19))
	i--
	dAtA[i] = 0x22
	n20, err20 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):])
	if err20 != nil {
		return 0, err20
	}
	i -= n20
	i = encodeVarintSession(dAtA, i, uint64(n20))
	i--
	dAtA[i] = 0x1a
	if m.State != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.State))
		i--
		dAtA[i] = 0x10
	}
	if m.SessionID != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.SessionID))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *SessionProposalSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	n21, err21 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
	if err21 != nil {
		return 0, err21
	}
	i -= n21
	i = encodeVarintSession(dAtA, i, uint64(n21))
	i--
	dAtA[i] = 0x32
	if m.LastOutputSequenceNum != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.LastOutputSequenceNum))
		i--
		dAtA[i] = 0x28
	}
	if len(m.PendingOutputs) > 0 {
		for iNdEx := len(m.PendingOutputs) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.PendingOutputs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintSession(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x22
		}
	}
	if m.Input != nil {
		{
			size, err := m.Input.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintSession(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x1a
	}
	if m.Phase != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.Phase))
		i--
		dAtA[i] = 0x10
	}
	if m.Index != 0 {
		i = encodeVarintSession(dAtA, i, uint64(m.Index))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *CreatePrimitiveResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	if m.CreatePrimitiveOutput != nil {
		l = m.CreatePrimitiveOutput.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}

func (m *ClosePrimitiveRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	l = m.ClosePrimitiveInput.Size()
	n += 1 + l + sovSession(uint64(l))
	return n
}

func (m *ClosePrimitiveResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	if m.ClosePrimitiveOutput != nil {
		l = m.ClosePrimitiveOutput.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}

func (m *SessionProposalInput) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.SessionID != 0 {
		n += 1 + sovSession(uint64(m.SessionID))
	}
	if m.SequenceNum != 0 {
		n += 1 + sovSession(uint64(m.SequenceNum))
	}
	if m.Input != nil {
		n += m.Input.Size()
	}
	return n
}

func (m *SessionProposalInput_CreatePrimitive) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.CreatePrimitive != nil {
		l = m.CreatePrimitive.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionProposalInput_ClosePrimitive) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ClosePrimitive != nil {
		l = m.ClosePrimitive.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionProposalInput_Proposal) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Proposal != nil {
		l = m.Proposal.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionProposalOutput) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.SequenceNum != 0 {
		n += 1 + sovSession(uint64(m.SequenceNum))
	}
	if m.Failure != nil {
		l = m.Failure.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	if m.Output != nil {
		n += m.Output.Size()
	}
	return n
}

func (m *SessionProposalOutput_CreatePrimitive) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.CreatePrimitive != nil {
		l = m.CreatePrimitive.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionProposalOutput_ClosePrimitive) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ClosePrimitive != nil {
		l = m.ClosePrimitive.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionProposalOutput_Proposal) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Proposal != nil {
		l = m.Proposal.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionQueryInput) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.SessionID != 0 {
		n += 1 + sovSession(uint64(m.SessionID))
	}
	if m.SequenceNum != 0 {
		n += 1 + sovSession(uint64(m.SequenceNum))
	}
	if m.Input != nil {
		n += m.Input.Size()
	}
	return n
}

func (m *SessionQueryInput_Query) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Query != nil {
		l = m.Query.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionQueryOutput) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Failure != nil {
		l = m.Failure.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	if m.Output != nil {
		n += m.Output.Size()
	}
	return n
}

func (m *SessionQueryOutput_Query) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Query != nil {
		l = m.Query.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	return n
}
func (m *SessionSnapshot) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.SessionID != 0 {
		n += 1 + sovSession(uint64(m.SessionID))
	}
	if m.State != 0 {
		n += 1 + sovSession(uint64(m.State))
	}
	l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout)
	n += 1 + l + sovSession(uint64(l))
	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated)
	n += 1 + l + sovSession(uint64(l))
	return n
}

func (m *SessionProposalSnapshot) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Index != 0 {
		n += 1 + sovSession(uint64(m.Index))
	}
	if m.Phase != 0 {
		n += 1 + sovSession(uint64(m.Phase))
	}
	if m.Input != nil {
		l = m.Input.Size()
		n += 1 + l + sovSession(uint64(l))
	}
	if len(m.PendingOutputs) > 0 {
		for _, e := range m.PendingOutputs {
			l = e.Size()
			n += 1 + l + sovSession(uint64(l))
		}
	}
	if m.LastOutputSequenceNum != 0 {
		n += 1 + sovSession(uint64(m.LastOutputSequenceNum))
	}
	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
	n += 1 + l + sovSession(uint64(l))
	return n
}

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

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

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

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

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SessionProposalInput) 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 ErrIntOverflowSession
			}
			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: SessionProposalInput: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SessionProposalInput: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
			}
			m.SessionID = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SessionID |= SessionID(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SequenceNum", wireType)
			}
			m.SequenceNum = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SequenceNum |= SequenceNum(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field CreatePrimitive", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &CreatePrimitiveInput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Input = &SessionProposalInput_CreatePrimitive{v}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClosePrimitive", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &ClosePrimitiveInput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Input = &SessionProposalInput_ClosePrimitive{v}
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &PrimitiveProposalInput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Input = &SessionProposalInput_Proposal{v}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipSession(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthSession
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SessionProposalOutput) 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 ErrIntOverflowSession
			}
			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: SessionProposalOutput: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SessionProposalOutput: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SequenceNum", wireType)
			}
			m.SequenceNum = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SequenceNum |= SequenceNum(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Failure == nil {
				m.Failure = &Failure{}
			}
			if err := m.Failure.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field CreatePrimitive", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &CreatePrimitiveOutput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Output = &SessionProposalOutput_CreatePrimitive{v}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClosePrimitive", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &ClosePrimitiveOutput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Output = &SessionProposalOutput_ClosePrimitive{v}
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			v := &PrimitiveProposalOutput{}
			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			m.Output = &SessionProposalOutput_Proposal{v}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipSession(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthSession
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

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

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

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SessionSnapshot) 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 ErrIntOverflowSession
			}
			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: SessionSnapshot: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SessionSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
			}
			m.SessionID = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SessionID |= SessionID(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
			}
			m.State = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.State |= SessionSnapshot_State(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastUpdated, dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipSession(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthSession
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SessionProposalSnapshot) 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 ErrIntOverflowSession
			}
			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: SessionProposalSnapshot: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SessionProposalSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
			}
			m.Index = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Index |= Index(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Phase", wireType)
			}
			m.Phase = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Phase |= SessionProposalSnapshot_Phase(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Input", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Input == nil {
				m.Input = &SessionProposalInput{}
			}
			if err := m.Input.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field PendingOutputs", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.PendingOutputs = append(m.PendingOutputs, &SessionProposalOutput{})
			if err := m.PendingOutputs[len(m.PendingOutputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field LastOutputSequenceNum", wireType)
			}
			m.LastOutputSequenceNum = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.LastOutputSequenceNum |= SequenceNum(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowSession
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthSession
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthSession
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipSession(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthSession
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

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

var (
	ErrInvalidLengthSession        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSession          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSession = fmt.Errorf("proto: unexpected end of group")
)
