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

package user

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

type EntitlementSnapshot struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

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

func (rcv *EntitlementSnapshot) MutateIsPaid(n bool) bool {
	return rcv._tab.MutateBoolSlot(6, n)
}

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

func (rcv *EntitlementSnapshot) Actor(obj *ActorRef) *ActorRef {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(ActorRef)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

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

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

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

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

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

func (rcv *EntitlementSnapshot) UpdatedAtMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *EntitlementSnapshot) MutateUpdatedAtMs(n int64) bool {
	return rcv._tab.MutateInt64Slot(18, n)
}

func EntitlementSnapshotStart(builder *flatbuffers.Builder) {
	builder.StartObject(8)
}
func EntitlementSnapshotAddPlanCode(builder *flatbuffers.Builder, planCode flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(planCode), 0)
}
func EntitlementSnapshotAddIsPaid(builder *flatbuffers.Builder, isPaid bool) {
	builder.PrependBoolSlot(1, isPaid, false)
}
func EntitlementSnapshotAddSource(builder *flatbuffers.Builder, source flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(source), 0)
}
func EntitlementSnapshotAddActor(builder *flatbuffers.Builder, actor flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(actor), 0)
}
func EntitlementSnapshotAddReasonCode(builder *flatbuffers.Builder, reasonCode flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(reasonCode), 0)
}
func EntitlementSnapshotAddStartsAtMs(builder *flatbuffers.Builder, startsAtMs int64) {
	builder.PrependInt64Slot(5, startsAtMs, 0)
}
func EntitlementSnapshotAddEndsAtMs(builder *flatbuffers.Builder, endsAtMs int64) {
	builder.PrependInt64Slot(6, endsAtMs, 0)
}
func EntitlementSnapshotAddUpdatedAtMs(builder *flatbuffers.Builder, updatedAtMs int64) {
	builder.PrependInt64Slot(7, updatedAtMs, 0)
}
func EntitlementSnapshotEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
