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

package gamma_api

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

type Request struct {
	_tab flatbuffers.Table
}

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

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

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

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

func (rcv *Request) ReqNum() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Request) MutateReqNum(n int32) bool {
	return rcv._tab.MutateInt32Slot(4, n)
}

func (rcv *Request) Topn() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Request) MutateTopn(n int32) bool {
	return rcv._tab.MutateInt32Slot(6, n)
}

func (rcv *Request) BruteForceSearch() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Request) MutateBruteForceSearch(n int32) bool {
	return rcv._tab.MutateInt32Slot(8, n)
}

func (rcv *Request) VecFields(obj *VectorQuery, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *Request) VecFieldsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *Request) Fields(j int) []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		a := rcv._tab.Vector(o)
		return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4))
	}
	return nil
}

func (rcv *Request) FieldsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *Request) RangeFilters(obj *RangeFilter, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *Request) RangeFiltersLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *Request) TermFilters(obj *TermFilter, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *Request) TermFiltersLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

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

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

func (rcv *Request) MutateHasRank(n bool) bool {
	return rcv._tab.MutateBoolSlot(20, n)
}

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

func (rcv *Request) MultiVectorRank() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(24))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Request) MutateMultiVectorRank(n int32) bool {
	return rcv._tab.MutateInt32Slot(24, n)
}

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

func (rcv *Request) MutateL2Sqrt(n bool) bool {
	return rcv._tab.MutateBoolSlot(26, n)
}

func RequestStart(builder *flatbuffers.Builder) {
	builder.StartObject(12)
}
func RequestAddReqNum(builder *flatbuffers.Builder, reqNum int32) {
	builder.PrependInt32Slot(0, reqNum, 0)
}
func RequestAddTopn(builder *flatbuffers.Builder, topn int32) {
	builder.PrependInt32Slot(1, topn, 0)
}
func RequestAddBruteForceSearch(builder *flatbuffers.Builder, bruteForceSearch int32) {
	builder.PrependInt32Slot(2, bruteForceSearch, 0)
}
func RequestAddVecFields(builder *flatbuffers.Builder, vecFields flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(vecFields), 0)
}
func RequestStartVecFieldsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func RequestAddFields(builder *flatbuffers.Builder, fields flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(fields), 0)
}
func RequestStartFieldsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func RequestAddRangeFilters(builder *flatbuffers.Builder, rangeFilters flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(rangeFilters), 0)
}
func RequestStartRangeFiltersVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func RequestAddTermFilters(builder *flatbuffers.Builder, termFilters flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(termFilters), 0)
}
func RequestStartTermFiltersVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func RequestAddRetrievalParams(builder *flatbuffers.Builder, retrievalParams flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(retrievalParams), 0)
}
func RequestAddHasRank(builder *flatbuffers.Builder, hasRank bool) {
	builder.PrependBoolSlot(8, hasRank, false)
}
func RequestAddOnlineLogLevel(builder *flatbuffers.Builder, onlineLogLevel flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(9, flatbuffers.UOffsetT(onlineLogLevel), 0)
}
func RequestAddMultiVectorRank(builder *flatbuffers.Builder, multiVectorRank int32) {
	builder.PrependInt32Slot(10, multiVectorRank, 0)
}
func RequestAddL2Sqrt(builder *flatbuffers.Builder, l2Sqrt bool) {
	builder.PrependBoolSlot(11, l2Sqrt, false)
}
func RequestEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
