// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package user

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type DeviceSessionView struct {
	_tab flatbuffers.Table
}

func GetRootAsDeviceSessionView(buf []byte, offset flatbuffers.UOffsetT) *DeviceSessionView {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &DeviceSessionView{}
	x.Init(buf, n+offset)
	return x
}

func FinishDeviceSessionViewBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.Finish(offset)
}

func GetSizePrefixedRootAsDeviceSessionView(buf []byte, offset flatbuffers.UOffsetT) *DeviceSessionView {
	n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
	x := &DeviceSessionView{}
	x.Init(buf, n+offset+flatbuffers.SizeUint32)
	return x
}

func FinishSizePrefixedDeviceSessionViewBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.FinishSizePrefixed(offset)
}

func (rcv *DeviceSessionView) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *DeviceSessionView) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *DeviceSessionView) DeviceSessionId() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func (rcv *DeviceSessionView) UserId() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func (rcv *DeviceSessionView) Status() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func (rcv *DeviceSessionView) ClientPublicKey() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func (rcv *DeviceSessionView) CreatedAtMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *DeviceSessionView) MutateCreatedAtMs(n int64) bool {
	return rcv._tab.MutateInt64Slot(12, n)
}

func (rcv *DeviceSessionView) RevokedAtMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *DeviceSessionView) MutateRevokedAtMs(n int64) bool {
	return rcv._tab.MutateInt64Slot(14, n)
}

func (rcv *DeviceSessionView) LastSeenAtMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *DeviceSessionView) MutateLastSeenAtMs(n int64) bool {
	return rcv._tab.MutateInt64Slot(16, n)
}

func DeviceSessionViewStart(builder *flatbuffers.Builder) {
	builder.StartObject(7)
}
func DeviceSessionViewAddDeviceSessionId(builder *flatbuffers.Builder, deviceSessionId flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(deviceSessionId), 0)
}
func DeviceSessionViewAddUserId(builder *flatbuffers.Builder, userId flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(userId), 0)
}
func DeviceSessionViewAddStatus(builder *flatbuffers.Builder, status flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(status), 0)
}
func DeviceSessionViewAddClientPublicKey(builder *flatbuffers.Builder, clientPublicKey flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(clientPublicKey), 0)
}
func DeviceSessionViewAddCreatedAtMs(builder *flatbuffers.Builder, createdAtMs int64) {
	builder.PrependInt64Slot(4, createdAtMs, 0)
}
func DeviceSessionViewAddRevokedAtMs(builder *flatbuffers.Builder, revokedAtMs int64) {
	builder.PrependInt64Slot(5, revokedAtMs, 0)
}
func DeviceSessionViewAddLastSeenAtMs(builder *flatbuffers.Builder, lastSeenAtMs int64) {
	builder.PrependInt64Slot(6, lastSeenAtMs, 0)
}
func DeviceSessionViewEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
