# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dataprotocol

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class SQLResponseColumn(object):
    __slots__ = ['_tab']

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

    @classmethod
    def GetRootAsSQLResponseColumn(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # SQLResponseColumn
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # SQLResponseColumn
    def ColumnName(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

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

    # SQLResponseColumn
    def ColumnValue(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from tablestore.flatbuffer.dataprotocol.ColumnValues import ColumnValues
            obj = ColumnValues()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def SQLResponseColumnStart(builder): builder.StartObject(3)
def Start(builder):
    return SQLResponseColumnStart(builder)
def SQLResponseColumnAddColumnName(builder, columnName): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(columnName), 0)
def AddColumnName(builder, columnName):
    return SQLResponseColumnAddColumnName(builder, columnName)
def SQLResponseColumnAddColumnType(builder, columnType): builder.PrependInt8Slot(1, columnType, 0)
def AddColumnType(builder, columnType):
    return SQLResponseColumnAddColumnType(builder, columnType)
def SQLResponseColumnAddColumnValue(builder, columnValue): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(columnValue), 0)
def AddColumnValue(builder, columnValue):
    return SQLResponseColumnAddColumnValue(builder, columnValue)
def SQLResponseColumnEnd(builder): return builder.EndObject()
def End(builder):
    return SQLResponseColumnEnd(builder)