# automatically generated by the FlatBuffers compiler, do not modify

# namespace: Types

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

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

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

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

    # Configuration
    def ShowDebugUi(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return None

    # Configuration
    def InspectIgnoreBigObject(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return None

def ConfigurationStart(builder): builder.StartObject(2)
def Start(builder):
    return ConfigurationStart(builder)
def ConfigurationAddShowDebugUi(builder, showDebugUi): builder.PrependBoolSlot(0, showDebugUi, None)
def AddShowDebugUi(builder, showDebugUi):
    return ConfigurationAddShowDebugUi(builder, showDebugUi)
def ConfigurationAddInspectIgnoreBigObject(builder, inspectIgnoreBigObject): builder.PrependBoolSlot(1, inspectIgnoreBigObject, None)
def AddInspectIgnoreBigObject(builder, inspectIgnoreBigObject):
    return ConfigurationAddInspectIgnoreBigObject(builder, inspectIgnoreBigObject)
def ConfigurationEnd(builder): return builder.EndObject()
def End(builder):
    return ConfigurationEnd(builder)

class ConfigurationT(object):

    # ConfigurationT
    def __init__(self):
        self.showDebugUi = None  # type: Optional[bool]
        self.inspectIgnoreBigObject = None  # type: Optional[bool]

    @classmethod
    def InitFromBuf(cls, buf, pos):
        configuration = Configuration()
        configuration.Init(buf, pos)
        return cls.InitFromObj(configuration)

    @classmethod
    def InitFromPackedBuf(cls, buf, pos=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
        return cls.InitFromBuf(buf, pos+n)

    @classmethod
    def InitFromObj(cls, configuration):
        x = ConfigurationT()
        x._UnPack(configuration)
        return x

    # ConfigurationT
    def _UnPack(self, configuration):
        if configuration is None:
            return
        self.showDebugUi = configuration.ShowDebugUi()
        self.inspectIgnoreBigObject = configuration.InspectIgnoreBigObject()

    # ConfigurationT
    def Pack(self, builder):
        ConfigurationStart(builder)
        ConfigurationAddShowDebugUi(builder, self.showDebugUi)
        ConfigurationAddInspectIgnoreBigObject(builder, self.inspectIgnoreBigObject)
        configuration = ConfigurationEnd(builder)
        return configuration
