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

package systemevents

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

type Collection struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

func (rcv *Collection) Uid() uint64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetUint64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateUid(n uint64) bool {
	return rcv._tab.MutateUint64Slot(4, n)
}

func (rcv *Collection) ScopeId() uint32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetUint32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateScopeId(n uint32) bool {
	return rcv._tab.MutateUint32Slot(6, n)
}

func (rcv *Collection) CollectionId() uint32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetUint32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateCollectionId(n uint32) bool {
	return rcv._tab.MutateUint32Slot(8, n)
}

func (rcv *Collection) TtlValid() bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.GetBool(o + rcv._tab.Pos)
	}
	return false
}

func (rcv *Collection) MutateTtlValid(n bool) bool {
	return rcv._tab.MutateBoolSlot(10, n)
}

func (rcv *Collection) MaxTtl() uint32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.GetUint32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateMaxTtl(n uint32) bool {
	return rcv._tab.MutateUint32Slot(12, n)
}

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

func (rcv *Collection) History() bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
	if o != 0 {
		return rcv._tab.GetBool(o + rcv._tab.Pos)
	}
	return false
}

func (rcv *Collection) MutateHistory(n bool) bool {
	return rcv._tab.MutateBoolSlot(16, n)
}

func (rcv *Collection) DefaultCollectionMvs() uint64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
	if o != 0 {
		return rcv._tab.GetUint64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateDefaultCollectionMvs(n uint64) bool {
	return rcv._tab.MutateUint64Slot(18, n)
}

func (rcv *Collection) Metered() bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
	if o != 0 {
		return rcv._tab.GetBool(o + rcv._tab.Pos)
	}
	return false
}

func (rcv *Collection) MutateMetered(n bool) bool {
	return rcv._tab.MutateBoolSlot(20, n)
}

func (rcv *Collection) FlushUid() uint64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(22))
	if o != 0 {
		return rcv._tab.GetUint64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Collection) MutateFlushUid(n uint64) bool {
	return rcv._tab.MutateUint64Slot(22, n)
}

func CollectionStart(builder *flatbuffers.Builder) {
	builder.StartObject(10)
}
func CollectionAddUid(builder *flatbuffers.Builder, uid uint64) {
	builder.PrependUint64Slot(0, uid, 0)
}
func CollectionAddScopeId(builder *flatbuffers.Builder, scopeId uint32) {
	builder.PrependUint32Slot(1, scopeId, 0)
}
func CollectionAddCollectionId(builder *flatbuffers.Builder, collectionId uint32) {
	builder.PrependUint32Slot(2, collectionId, 0)
}
func CollectionAddTtlValid(builder *flatbuffers.Builder, ttlValid bool) {
	builder.PrependBoolSlot(3, ttlValid, false)
}
func CollectionAddMaxTtl(builder *flatbuffers.Builder, maxTtl uint32) {
	builder.PrependUint32Slot(4, maxTtl, 0)
}
func CollectionAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(name), 0)
}
func CollectionAddHistory(builder *flatbuffers.Builder, history bool) {
	builder.PrependBoolSlot(6, history, false)
}
func CollectionAddDefaultCollectionMvs(builder *flatbuffers.Builder, defaultCollectionMvs uint64) {
	builder.PrependUint64Slot(7, defaultCollectionMvs, 0)
}
func CollectionAddMetered(builder *flatbuffers.Builder, metered bool) {
	builder.PrependBoolSlot(8, metered, false)
}
func CollectionAddFlushUid(builder *flatbuffers.Builder, flushUid uint64) {
	builder.PrependUint64Slot(9, flushUid, 0)
}
func CollectionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
