# automatically generated by the FlatBuffers compiler, do not modify

# namespace: HTTPReqCall

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

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

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

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

    # Rewrite
    def Path(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

    # Rewrite
    def Headers(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from A6.TextEntry import TextEntry
            obj = TextEntry()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Rewrite
    def HeadersLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Rewrite
    def HeadersIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # Rewrite
    def Args(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from A6.TextEntry import TextEntry
            obj = TextEntry()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Rewrite
    def ArgsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Rewrite
    def ArgsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

def Start(builder): builder.StartObject(3)
def RewriteStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddPath(builder, path): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(path), 0)
def RewriteAddPath(builder, path):
    """This method is deprecated. Please switch to AddPath."""
    return AddPath(builder, path)
def AddHeaders(builder, headers): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(headers), 0)
def RewriteAddHeaders(builder, headers):
    """This method is deprecated. Please switch to AddHeaders."""
    return AddHeaders(builder, headers)
def StartHeadersVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def RewriteStartHeadersVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartHeadersVector(builder, numElems)
def AddArgs(builder, args): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(args), 0)
def RewriteAddArgs(builder, args):
    """This method is deprecated. Please switch to AddArgs."""
    return AddArgs(builder, args)
def StartArgsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def RewriteStartArgsVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartArgsVector(builder, numElems)
def End(builder): return builder.EndObject()
def RewriteEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)