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

package user

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

type ActiveSanction struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

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

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

func (rcv *ActiveSanction) 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 *ActiveSanction) AppliedAtMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

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

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

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

func ActiveSanctionStart(builder *flatbuffers.Builder) {
	builder.StartObject(6)
}
func ActiveSanctionAddSanctionCode(builder *flatbuffers.Builder, sanctionCode flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(sanctionCode), 0)
}
func ActiveSanctionAddScope(builder *flatbuffers.Builder, scope flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(scope), 0)
}
func ActiveSanctionAddReasonCode(builder *flatbuffers.Builder, reasonCode flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(reasonCode), 0)
}
func ActiveSanctionAddActor(builder *flatbuffers.Builder, actor flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(actor), 0)
}
func ActiveSanctionAddAppliedAtMs(builder *flatbuffers.Builder, appliedAtMs int64) {
	builder.PrependInt64Slot(4, appliedAtMs, 0)
}
func ActiveSanctionAddExpiresAtMs(builder *flatbuffers.Builder, expiresAtMs int64) {
	builder.PrependInt64Slot(5, expiresAtMs, 0)
}
func ActiveSanctionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
