# automatically generated by the FlatBuffers compiler, do not modify

# namespace:

import flatbuffers
from flatbuffers.compat import import_numpy

np = import_numpy()


class ActionResponse(object):
    __slots__ = ["_tab"]

    @classmethod
    def GetRootAsActionResponse(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = ActionResponse()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def ActionResponseBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(
            buf, offset, b"\x61\x6E\x73\x77", size_prefixed=size_prefixed
        )

    # ActionResponse
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # ActionResponse
    def ServiceId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # ActionResponse
    def JobId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # ActionResponse
    def Action(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # ActionResponse
    def Outcome(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # ActionResponse
    def StatusCode(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # ActionResponse
    def StopTime(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(
                flatbuffers.number_types.Uint64Flags, o + self._tab.Pos
            )
        return 0

    # ActionResponse
    def Message(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # ActionResponse
    def CommandId(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None


def ActionResponseStart(builder):
    builder.StartObject(8)


def ActionResponseAddServiceId(builder, serviceId):
    builder.PrependUOffsetTRelativeSlot(
        0, flatbuffers.number_types.UOffsetTFlags.py_type(serviceId), 0
    )


def ActionResponseAddJobId(builder, jobId):
    builder.PrependUOffsetTRelativeSlot(
        1, flatbuffers.number_types.UOffsetTFlags.py_type(jobId), 0
    )


def ActionResponseAddAction(builder, action):
    builder.PrependInt8Slot(2, action, 0)


def ActionResponseAddOutcome(builder, outcome):
    builder.PrependInt8Slot(3, outcome, 0)


def ActionResponseAddStatusCode(builder, statusCode):
    builder.PrependInt32Slot(4, statusCode, 0)


def ActionResponseAddStopTime(builder, stopTime):
    builder.PrependUint64Slot(5, stopTime, 0)


def ActionResponseAddMessage(builder, message):
    builder.PrependUOffsetTRelativeSlot(
        6, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0
    )


def ActionResponseAddCommandId(builder, commandId):
    builder.PrependUOffsetTRelativeSlot(
        7, flatbuffers.number_types.UOffsetTFlags.py_type(commandId), 0
    )


def ActionResponseEnd(builder):
    return builder.EndObject()
