<gh_stars>1-10
#
# Autogenerated by Thrift Compiler (0.11.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys

from thrift.transport import TTransport
all_structs = []


class TIntStringValue(object):
    """
    Attributes:
     - intValue
     - stringValue
    """


    def __init__(self, intValue=None, stringValue=None,):
        self.intValue = intValue
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntStringValue')
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 1)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 2)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TIntStringStringValue(object):
    """
    Attributes:
     - intValue
     - stringValue1
     - stringValue2
    """


    def __init__(self, intValue=None, stringValue1=None, stringValue2=None,):
        self.intValue = intValue
        self.stringValue1 = stringValue1
        self.stringValue2 = stringValue2

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.stringValue1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.stringValue2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntStringStringValue')
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 1)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.stringValue1 is not None:
            oprot.writeFieldBegin('stringValue1', TType.STRING, 2)
            oprot.writeString(self.stringValue1.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue1)
            oprot.writeFieldEnd()
        if self.stringValue2 is not None:
            oprot.writeFieldBegin('stringValue2', TType.STRING, 3)
            oprot.writeString(self.stringValue2.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue2)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TLongIntIntByteByteStringValue(object):
    """
    Attributes:
     - longValue
     - intValue1
     - intValue2
     - byteValue1
     - byteValue2
     - stringValue
    """


    def __init__(self, longValue=None, intValue1=None, intValue2=None, byteValue1=None, byteValue2=None, stringValue=None,):
        self.longValue = longValue
        self.intValue1 = intValue1
        self.intValue2 = intValue2
        self.byteValue1 = byteValue1
        self.byteValue2 = byteValue2
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.longValue = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.intValue1 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue2 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BYTE:
                    self.byteValue1 = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BYTE:
                    self.byteValue2 = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TLongIntIntByteByteStringValue')
        if self.longValue is not None:
            oprot.writeFieldBegin('longValue', TType.I64, 1)
            oprot.writeI64(self.longValue)
            oprot.writeFieldEnd()
        if self.intValue1 is not None:
            oprot.writeFieldBegin('intValue1', TType.I32, 2)
            oprot.writeI32(self.intValue1)
            oprot.writeFieldEnd()
        if self.intValue2 is not None:
            oprot.writeFieldBegin('intValue2', TType.I32, 3)
            oprot.writeI32(self.intValue2)
            oprot.writeFieldEnd()
        if self.byteValue1 is not None:
            oprot.writeFieldBegin('byteValue1', TType.BYTE, 4)
            oprot.writeByte(self.byteValue1)
            oprot.writeFieldEnd()
        if self.byteValue2 is not None:
            oprot.writeFieldBegin('byteValue2', TType.BYTE, 5)
            oprot.writeByte(self.byteValue2)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 6)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TIntBooleanIntBooleanValue(object):
    """
    Attributes:
     - intValue1
     - boolValue1
     - intValue2
     - boolValue2
    """


    def __init__(self, intValue1=None, boolValue1=None, intValue2=None, boolValue2=None,):
        self.intValue1 = intValue1
        self.boolValue1 = boolValue1
        self.intValue2 = intValue2
        self.boolValue2 = boolValue2

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue1 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.boolValue1 = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue2 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.boolValue2 = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntBooleanIntBooleanValue')
        if self.intValue1 is not None:
            oprot.writeFieldBegin('intValue1', TType.I32, 1)
            oprot.writeI32(self.intValue1)
            oprot.writeFieldEnd()
        if self.boolValue1 is not None:
            oprot.writeFieldBegin('boolValue1', TType.BOOL, 2)
            oprot.writeBool(self.boolValue1)
            oprot.writeFieldEnd()
        if self.intValue2 is not None:
            oprot.writeFieldBegin('intValue2', TType.I32, 3)
            oprot.writeI32(self.intValue2)
            oprot.writeFieldEnd()
        if self.boolValue2 is not None:
            oprot.writeFieldBegin('boolValue2', TType.BOOL, 4)
            oprot.writeBool(self.boolValue2)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TAnnotationValue(object):
    """
    Attributes:
     - stringValue
     - boolValue
     - intValue
     - longValue
     - shortValue
     - doubleValue
     - binaryValue
     - byteValue
     - intStringValue
     - intStringStringValue
     - longIntIntByteByteStringValue
     - intBooleanIntBooleanValue
    """


    def __init__(self, stringValue=None, boolValue=None, intValue=None, longValue=None, shortValue=None, doubleValue=None, binaryValue=None, byteValue=None, intStringValue=None, intStringStringValue=None, longIntIntByteByteStringValue=None, intBooleanIntBooleanValue=None,):
        self.stringValue = stringValue
        self.boolValue = boolValue
        self.intValue = intValue
        self.longValue = longValue
        self.shortValue = shortValue
        self.doubleValue = doubleValue
        self.binaryValue = binaryValue
        self.byteValue = byteValue
        self.intStringValue = intStringValue
        self.intStringStringValue = intStringStringValue
        self.longIntIntByteByteStringValue = longIntIntByteByteStringValue
        self.intBooleanIntBooleanValue = intBooleanIntBooleanValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.boolValue = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.longValue = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I16:
                    self.shortValue = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.DOUBLE:
                    self.doubleValue = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.binaryValue = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BYTE:
                    self.byteValue = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.STRUCT:
                    self.intStringValue = TIntStringValue()
                    self.intStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.STRUCT:
                    self.intStringStringValue = TIntStringStringValue()
                    self.intStringStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRUCT:
                    self.longIntIntByteByteStringValue = TLongIntIntByteByteStringValue()
                    self.longIntIntByteByteStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.STRUCT:
                    self.intBooleanIntBooleanValue = TIntBooleanIntBooleanValue()
                    self.intBooleanIntBooleanValue.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TAnnotationValue')
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 1)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        if self.boolValue is not None:
            oprot.writeFieldBegin('boolValue', TType.BOOL, 2)
            oprot.writeBool(self.boolValue)
            oprot.writeFieldEnd()
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 3)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.longValue is not None:
            oprot.writeFieldBegin('longValue', TType.I64, 4)
            oprot.writeI64(self.longValue)
            oprot.writeFieldEnd()
        if self.shortValue is not None:
            oprot.writeFieldBegin('shortValue', TType.I16, 5)
            oprot.writeI16(self.shortValue)
            oprot.writeFieldEnd()
        if self.doubleValue is not None:
            oprot.writeFieldBegin('doubleValue', TType.DOUBLE, 6)
            oprot.writeDouble(self.doubleValue)
            oprot.writeFieldEnd()
        if self.binaryValue is not None:
            oprot.writeFieldBegin('binaryValue', TType.STRING, 7)
            oprot.writeBinary(self.binaryValue)
            oprot.writeFieldEnd()
        if self.byteValue is not None:
            oprot.writeFieldBegin('byteValue', TType.BYTE, 8)
            oprot.writeByte(self.byteValue)
            oprot.writeFieldEnd()
        if self.intStringValue is not None:
            oprot.writeFieldBegin('intStringValue', TType.STRUCT, 9)
            self.intStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.intStringStringValue is not None:
            oprot.writeFieldBegin('intStringStringValue', TType.STRUCT, 10)
            self.intStringStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.longIntIntByteByteStringValue is not None:
            oprot.writeFieldBegin('longIntIntByteByteStringValue', TType.STRUCT, 11)
            self.longIntIntByteByteStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.intBooleanIntBooleanValue is not None:
            oprot.writeFieldBegin('intBooleanIntBooleanValue', TType.STRUCT, 12)
            self.intBooleanIntBooleanValue.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TAnnotation(object):
    """
    Attributes:
     - key
     - value
    """


    def __init__(self, key=None, value=None,):
        self.key = key
        self.value = value

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.key = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.value = TAnnotationValue()
                    self.value.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TAnnotation')
        if self.key is not None:
            oprot.writeFieldBegin('key', TType.I32, 1)
            oprot.writeI32(self.key)
            oprot.writeFieldEnd()
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRUCT, 2)
            self.value.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpanEvent(object):
    """
    Attributes:
     - spanId
     - sequence
     - startElapsed
     - endElapsed
     - rpc
     - serviceType
     - endPoint
     - annotations
     - depth
     - nextSpanId
     - destinationId
     - apiId
     - exceptionInfo
     - asyncId
     - nextAsyncId
     - asyncSequence
    """


    def __init__(self, spanId=None, sequence=None, startElapsed=None, endElapsed=0, rpc=None, serviceType=None, endPoint=None, annotations=None, depth=-1, nextSpanId=-1, destinationId=None, apiId=None, exceptionInfo=None, asyncId=None, nextAsyncId=None, asyncSequence=None,):
        self.spanId = spanId
        self.sequence = sequence
        self.startElapsed = startElapsed
        self.endElapsed = endElapsed
        self.rpc = rpc
        self.serviceType = serviceType
        self.endPoint = endPoint
        self.annotations = annotations
        self.depth = depth
        self.nextSpanId = nextSpanId
        self.destinationId = destinationId
        self.apiId = apiId
        self.exceptionInfo = exceptionInfo
        self.asyncId = asyncId
        self.nextAsyncId = nextAsyncId
        self.asyncSequence = asyncSequence

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 7:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I16:
                    self.sequence = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I32:
                    self.startElapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.endElapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.rpc = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.LIST:
                    self.annotations = []
                    (_etype3, _size0) = iprot.readListBegin()
                    for _i4 in range(_size0):
                        _elem5 = TAnnotation()
                        _elem5.read(iprot)
                        self.annotations.append(_elem5)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.I32:
                    self.depth = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.I64:
                    self.nextSpanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.STRING:
                    self.destinationId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 25:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 26:
                if ftype == TType.STRUCT:
                    self.exceptionInfo = TIntStringValue()
                    self.exceptionInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 30:
                if ftype == TType.I32:
                    self.asyncId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 31:
                if ftype == TType.I32:
                    self.nextAsyncId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 32:
                if ftype == TType.I16:
                    self.asyncSequence = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpanEvent')
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 7)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.sequence is not None:
            oprot.writeFieldBegin('sequence', TType.I16, 8)
            oprot.writeI16(self.sequence)
            oprot.writeFieldEnd()
        if self.startElapsed is not None:
            oprot.writeFieldBegin('startElapsed', TType.I32, 9)
            oprot.writeI32(self.startElapsed)
            oprot.writeFieldEnd()
        if self.endElapsed is not None:
            oprot.writeFieldBegin('endElapsed', TType.I32, 10)
            oprot.writeI32(self.endElapsed)
            oprot.writeFieldEnd()
        if self.rpc is not None:
            oprot.writeFieldBegin('rpc', TType.STRING, 11)
            oprot.writeString(self.rpc.encode('utf-8') if sys.version_info[0] == 2 else self.rpc)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 12)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 13)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.annotations is not None:
            oprot.writeFieldBegin('annotations', TType.LIST, 14)
            oprot.writeListBegin(TType.STRUCT, len(self.annotations))
            for iter6 in self.annotations:
                iter6.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.depth is not None:
            oprot.writeFieldBegin('depth', TType.I32, 15)
            oprot.writeI32(self.depth)
            oprot.writeFieldEnd()
        if self.nextSpanId is not None:
            oprot.writeFieldBegin('nextSpanId', TType.I64, 16)
            oprot.writeI64(self.nextSpanId)
            oprot.writeFieldEnd()
        if self.destinationId is not None:
            oprot.writeFieldBegin('destinationId', TType.STRING, 20)
            oprot.writeString(self.destinationId.encode('utf-8') if sys.version_info[0] == 2 else self.destinationId)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 25)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.exceptionInfo is not None:
            oprot.writeFieldBegin('exceptionInfo', TType.STRUCT, 26)
            self.exceptionInfo.write(oprot)
            oprot.writeFieldEnd()
        if self.asyncId is not None:
            oprot.writeFieldBegin('asyncId', TType.I32, 30)
            oprot.writeI32(self.asyncId)
            oprot.writeFieldEnd()
        if self.nextAsyncId is not None:
            oprot.writeFieldBegin('nextAsyncId', TType.I32, 31)
            oprot.writeI32(self.nextAsyncId)
            oprot.writeFieldEnd()
        if self.asyncSequence is not None:
            oprot.writeFieldBegin('asyncSequence', TType.I16, 32)
            oprot.writeI16(self.asyncSequence)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpan(object):
    """
    Attributes:
     - agentId
     - applicationName
     - agentStartTime
     - transactionId
     - spanId
     - parentSpanId
     - startTime
     - elapsed
     - rpc
     - serviceType
     - endPoint
     - remoteAddr
     - annotations
     - flag
     - err
     - spanEventList
     - parentApplicationName
     - parentApplicationType
     - acceptorHost
     - apiId
     - exceptionInfo
     - applicationServiceType
     - loggingTransactionInfo
    """


    def __init__(self, agentId=None, applicationName=None, agentStartTime=None, transactionId=None, spanId=None, parentSpanId=-1, startTime=None, elapsed=0, rpc=None, serviceType=None, endPoint=None, remoteAddr=None, annotations=None, flag=0, err=None, spanEventList=None, parentApplicationName=None, parentApplicationType=None, acceptorHost=None, apiId=None, exceptionInfo=None, applicationServiceType=None, loggingTransactionInfo=None,):
        self.agentId = agentId
        self.applicationName = applicationName
        self.agentStartTime = agentStartTime
        self.transactionId = transactionId
        self.spanId = spanId
        self.parentSpanId = parentSpanId
        self.startTime = startTime
        self.elapsed = elapsed
        self.rpc = rpc
        self.serviceType = serviceType
        self.endPoint = endPoint
        self.remoteAddr = remoteAddr
        self.annotations = annotations
        self.flag = flag
        self.err = err
        self.spanEventList = spanEventList
        self.parentApplicationName = parentApplicationName
        self.parentApplicationType = parentApplicationType
        self.acceptorHost = acceptorHost
        self.apiId = apiId
        self.exceptionInfo = exceptionInfo
        self.applicationServiceType = applicationServiceType
        self.loggingTransactionInfo = loggingTransactionInfo

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.applicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.transactionId = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.parentSpanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I64:
                    self.startTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.elapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.rpc = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.STRING:
                    self.remoteAddr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.LIST:
                    self.annotations = []
                    (_etype10, _size7) = iprot.readListBegin()
                    for _i11 in range(_size7):
                        _elem12 = TAnnotation()
                        _elem12.read(iprot)
                        self.annotations.append(_elem12)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.I16:
                    self.flag = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 17:
                if ftype == TType.I32:
                    self.err = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 18:
                if ftype == TType.LIST:
                    self.spanEventList = []
                    (_etype16, _size13) = iprot.readListBegin()
                    for _i17 in range(_size13):
                        _elem18 = TSpanEvent()
                        _elem18.read(iprot)
                        self.spanEventList.append(_elem18)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 19:
                if ftype == TType.STRING:
                    self.parentApplicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.I16:
                    self.parentApplicationType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 21:
                if ftype == TType.STRING:
                    self.acceptorHost = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 25:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 26:
                if ftype == TType.STRUCT:
                    self.exceptionInfo = TIntStringValue()
                    self.exceptionInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 30:
                if ftype == TType.I16:
                    self.applicationServiceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 31:
                if ftype == TType.BYTE:
                    self.loggingTransactionInfo = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpan')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.applicationName is not None:
            oprot.writeFieldBegin('applicationName', TType.STRING, 2)
            oprot.writeString(self.applicationName.encode('utf-8') if sys.version_info[0] == 2 else self.applicationName)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 3)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.transactionId is not None:
            oprot.writeFieldBegin('transactionId', TType.STRING, 4)
            oprot.writeBinary(self.transactionId)
            oprot.writeFieldEnd()
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 7)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.parentSpanId is not None:
            oprot.writeFieldBegin('parentSpanId', TType.I64, 8)
            oprot.writeI64(self.parentSpanId)
            oprot.writeFieldEnd()
        if self.startTime is not None:
            oprot.writeFieldBegin('startTime', TType.I64, 9)
            oprot.writeI64(self.startTime)
            oprot.writeFieldEnd()
        if self.elapsed is not None:
            oprot.writeFieldBegin('elapsed', TType.I32, 10)
            oprot.writeI32(self.elapsed)
            oprot.writeFieldEnd()
        if self.rpc is not None:
            oprot.writeFieldBegin('rpc', TType.STRING, 11)
            oprot.writeString(self.rpc.encode('utf-8') if sys.version_info[0] == 2 else self.rpc)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 12)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 13)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.remoteAddr is not None:
            oprot.writeFieldBegin('remoteAddr', TType.STRING, 14)
            oprot.writeString(self.remoteAddr.encode('utf-8') if sys.version_info[0] == 2 else self.remoteAddr)
            oprot.writeFieldEnd()
        if self.annotations is not None:
            oprot.writeFieldBegin('annotations', TType.LIST, 15)
            oprot.writeListBegin(TType.STRUCT, len(self.annotations))
            for iter19 in self.annotations:
                iter19.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.flag is not None:
            oprot.writeFieldBegin('flag', TType.I16, 16)
            oprot.writeI16(self.flag)
            oprot.writeFieldEnd()
        if self.err is not None:
            oprot.writeFieldBegin('err', TType.I32, 17)
            oprot.writeI32(self.err)
            oprot.writeFieldEnd()
        if self.spanEventList is not None:
            oprot.writeFieldBegin('spanEventList', TType.LIST, 18)
            oprot.writeListBegin(TType.STRUCT, len(self.spanEventList))
            for iter20 in self.spanEventList:
                iter20.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.parentApplicationName is not None:
            oprot.writeFieldBegin('parentApplicationName', TType.STRING, 19)
            oprot.writeString(self.parentApplicationName.encode('utf-8') if sys.version_info[0] == 2 else self.parentApplicationName)
            oprot.writeFieldEnd()
        if self.parentApplicationType is not None:
            oprot.writeFieldBegin('parentApplicationType', TType.I16, 20)
            oprot.writeI16(self.parentApplicationType)
            oprot.writeFieldEnd()
        if self.acceptorHost is not None:
            oprot.writeFieldBegin('acceptorHost', TType.STRING, 21)
            oprot.writeString(self.acceptorHost.encode('utf-8') if sys.version_info[0] == 2 else self.acceptorHost)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 25)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.exceptionInfo is not None:
            oprot.writeFieldBegin('exceptionInfo', TType.STRUCT, 26)
            self.exceptionInfo.write(oprot)
            oprot.writeFieldEnd()
        if self.applicationServiceType is not None:
            oprot.writeFieldBegin('applicationServiceType', TType.I16, 30)
            oprot.writeI16(self.applicationServiceType)
            oprot.writeFieldEnd()
        if self.loggingTransactionInfo is not None:
            oprot.writeFieldBegin('loggingTransactionInfo', TType.BYTE, 31)
            oprot.writeByte(self.loggingTransactionInfo)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpanChunk(object):
    """
    Attributes:
     - agentId
     - applicationName
     - agentStartTime
     - serviceType
     - transactionId
     - spanId
     - endPoint
     - spanEventList
     - applicationServiceType
    """


    def __init__(self, agentId=None, applicationName=None, agentStartTime=None, serviceType=None, transactionId=None, spanId=None, endPoint=None, spanEventList=None, applicationServiceType=None,):
        self.agentId = agentId
        self.applicationName = applicationName
        self.agentStartTime = agentStartTime
        self.serviceType = serviceType
        self.transactionId = transactionId
        self.spanId = spanId
        self.endPoint = endPoint
        self.spanEventList = spanEventList
        self.applicationServiceType = applicationServiceType

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.applicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.transactionId = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.LIST:
                    self.spanEventList = []
                    (_etype24, _size21) = iprot.readListBegin()
                    for _i25 in range(_size21):
                        _elem26 = TSpanEvent()
                        _elem26.read(iprot)
                        self.spanEventList.append(_elem26)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.I16:
                    self.applicationServiceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpanChunk')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.applicationName is not None:
            oprot.writeFieldBegin('applicationName', TType.STRING, 2)
            oprot.writeString(self.applicationName.encode('utf-8') if sys.version_info[0] == 2 else self.applicationName)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 3)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 4)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.transactionId is not None:
            oprot.writeFieldBegin('transactionId', TType.STRING, 5)
            oprot.writeBinary(self.transactionId)
            oprot.writeFieldEnd()
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 8)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 9)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.spanEventList is not None:
            oprot.writeFieldBegin('spanEventList', TType.LIST, 10)
            oprot.writeListBegin(TType.STRUCT, len(self.spanEventList))
            for iter27 in self.spanEventList:
                iter27.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.applicationServiceType is not None:
            oprot.writeFieldBegin('applicationServiceType', TType.I16, 11)
            oprot.writeI16(self.applicationServiceType)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TStringMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - stringId
     - stringValue
    """


    def __init__(self, agentId=None, agentStartTime=None, stringId=None, stringValue=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.stringId = stringId
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.stringId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TStringMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.stringId is not None:
            oprot.writeFieldBegin('stringId', TType.I32, 4)
            oprot.writeI32(self.stringId)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 5)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSqlMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - sqlId
     - sql
    """


    def __init__(self, agentId=None, agentStartTime=None, sqlId=None, sql=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.sqlId = sqlId
        self.sql = sql

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.sqlId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.sql = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSqlMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.sqlId is not None:
            oprot.writeFieldBegin('sqlId', TType.I32, 4)
            oprot.writeI32(self.sqlId)
            oprot.writeFieldEnd()
        if self.sql is not None:
            oprot.writeFieldBegin('sql', TType.STRING, 5)
            oprot.writeString(self.sql.encode('utf-8') if sys.version_info[0] == 2 else self.sql)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TApiMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - apiId
     - apiInfo
     - line
     - type
    """


    def __init__(self, agentId=None, agentStartTime=None, apiId=None, apiInfo=None, line=None, type=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.apiId = apiId
        self.apiInfo = apiInfo
        self.line = line
        self.type = type

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.apiInfo = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I32:
                    self.line = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.type = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TApiMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 4)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.apiInfo is not None:
            oprot.writeFieldBegin('apiInfo', TType.STRING, 5)
            oprot.writeString(self.apiInfo.encode('utf-8') if sys.version_info[0] == 2 else self.apiInfo)
            oprot.writeFieldEnd()
        if self.line is not None:
            oprot.writeFieldBegin('line', TType.I32, 6)
            oprot.writeI32(self.line)
            oprot.writeFieldEnd()
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 10)
            oprot.writeI32(self.type)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TResult(object):
    """
    Attributes:
     - success
     - message
    """


    def __init__(self, success=None, message=None,):
        self.success = success
        self.message = message

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TResult')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 1)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin('message', TType.STRING, 2)
            oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)
all_structs.append(TIntStringValue)
TIntStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue', None, None, ),  # 1
    (2, TType.STRING, 'stringValue', 'UTF8', None, ),  # 2
)
all_structs.append(TIntStringStringValue)
TIntStringStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue', None, None, ),  # 1
    (2, TType.STRING, 'stringValue1', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'stringValue2', 'UTF8', None, ),  # 3
)
all_structs.append(TLongIntIntByteByteStringValue)
TLongIntIntByteByteStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'longValue', None, None, ),  # 1
    (2, TType.I32, 'intValue1', None, None, ),  # 2
    (3, TType.I32, 'intValue2', None, None, ),  # 3
    (4, TType.BYTE, 'byteValue1', None, None, ),  # 4
    (5, TType.BYTE, 'byteValue2', None, None, ),  # 5
    (6, TType.STRING, 'stringValue', 'UTF8', None, ),  # 6
)
all_structs.append(TIntBooleanIntBooleanValue)
TIntBooleanIntBooleanValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue1', None, None, ),  # 1
    (2, TType.BOOL, 'boolValue1', None, None, ),  # 2
    (3, TType.I32, 'intValue2', None, None, ),  # 3
    (4, TType.BOOL, 'boolValue2', None, None, ),  # 4
)
all_structs.append(TAnnotationValue)
TAnnotationValue.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'stringValue', 'UTF8', None, ),  # 1
    (2, TType.BOOL, 'boolValue', None, None, ),  # 2
    (3, TType.I32, 'intValue', None, None, ),  # 3
    (4, TType.I64, 'longValue', None, None, ),  # 4
    (5, TType.I16, 'shortValue', None, None, ),  # 5
    (6, TType.DOUBLE, 'doubleValue', None, None, ),  # 6
    (7, TType.STRING, 'binaryValue', 'BINARY', None, ),  # 7
    (8, TType.BYTE, 'byteValue', None, None, ),  # 8
    (9, TType.STRUCT, 'intStringValue', [TIntStringValue, None], None, ),  # 9
    (10, TType.STRUCT, 'intStringStringValue', [TIntStringStringValue, None], None, ),  # 10
    (11, TType.STRUCT, 'longIntIntByteByteStringValue', [TLongIntIntByteByteStringValue, None], None, ),  # 11
    (12, TType.STRUCT, 'intBooleanIntBooleanValue', [TIntBooleanIntBooleanValue, None], None, ),  # 12
)
all_structs.append(TAnnotation)
TAnnotation.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'key', None, None, ),  # 1
    (2, TType.STRUCT, 'value', [TAnnotationValue, None], None, ),  # 2
)
all_structs.append(TSpanEvent)
TSpanEvent.thrift_spec = (
    None,  # 0
    None,  # 1
    None,  # 2
    None,  # 3
    None,  # 4
    None,  # 5
    None,  # 6
    (7, TType.I64, 'spanId', None, None, ),  # 7
    (8, TType.I16, 'sequence', None, None, ),  # 8
    (9, TType.I32, 'startElapsed', None, None, ),  # 9
    (10, TType.I32, 'endElapsed', None, 0, ),  # 10
    (11, TType.STRING, 'rpc', 'UTF8', None, ),  # 11
    (12, TType.I16, 'serviceType', None, None, ),  # 12
    (13, TType.STRING, 'endPoint', 'UTF8', None, ),  # 13
    (14, TType.LIST, 'annotations', (TType.STRUCT, [TAnnotation, None], False), None, ),  # 14
    (15, TType.I32, 'depth', None, -1, ),  # 15
    (16, TType.I64, 'nextSpanId', None, -1, ),  # 16
    None,  # 17
    None,  # 18
    None,  # 19
    (20, TType.STRING, 'destinationId', 'UTF8', None, ),  # 20
    None,  # 21
    None,  # 22
    None,  # 23
    None,  # 24
    (25, TType.I32, 'apiId', None, None, ),  # 25
    (26, TType.STRUCT, 'exceptionInfo', [TIntStringValue, None], None, ),  # 26
    None,  # 27
    None,  # 28
    None,  # 29
    (30, TType.I32, 'asyncId', None, None, ),  # 30
    (31, TType.I32, 'nextAsyncId', None, None, ),  # 31
    (32, TType.I16, 'asyncSequence', None, None, ),  # 32
)
all_structs.append(TSpan)
TSpan.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'applicationName', 'UTF8', None, ),  # 2
    (3, TType.I64, 'agentStartTime', None, None, ),  # 3
    (4, TType.STRING, 'transactionId', 'BINARY', None, ),  # 4
    None,  # 5
    None,  # 6
    (7, TType.I64, 'spanId', None, None, ),  # 7
    (8, TType.I64, 'parentSpanId', None, -1, ),  # 8
    (9, TType.I64, 'startTime', None, None, ),  # 9
    (10, TType.I32, 'elapsed', None, 0, ),  # 10
    (11, TType.STRING, 'rpc', 'UTF8', None, ),  # 11
    (12, TType.I16, 'serviceType', None, None, ),  # 12
    (13, TType.STRING, 'endPoint', 'UTF8', None, ),  # 13
    (14, TType.STRING, 'remoteAddr', 'UTF8', None, ),  # 14
    (15, TType.LIST, 'annotations', (TType.STRUCT, [TAnnotation, None], False), None, ),  # 15
    (16, TType.I16, 'flag', None, 0, ),  # 16
    (17, TType.I32, 'err', None, None, ),  # 17
    (18, TType.LIST, 'spanEventList', (TType.STRUCT, [TSpanEvent, None], False), None, ),  # 18
    (19, TType.STRING, 'parentApplicationName', 'UTF8', None, ),  # 19
    (20, TType.I16, 'parentApplicationType', None, None, ),  # 20
    (21, TType.STRING, 'acceptorHost', 'UTF8', None, ),  # 21
    None,  # 22
    None,  # 23
    None,  # 24
    (25, TType.I32, 'apiId', None, None, ),  # 25
    (26, TType.STRUCT, 'exceptionInfo', [TIntStringValue, None], None, ),  # 26
    None,  # 27
    None,  # 28
    None,  # 29
    (30, TType.I16, 'applicationServiceType', None, None, ),  # 30
    (31, TType.BYTE, 'loggingTransactionInfo', None, None, ),  # 31
)
all_structs.append(TSpanChunk)
TSpanChunk.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'applicationName', 'UTF8', None, ),  # 2
    (3, TType.I64, 'agentStartTime', None, None, ),  # 3
    (4, TType.I16, 'serviceType', None, None, ),  # 4
    (5, TType.STRING, 'transactionId', 'BINARY', None, ),  # 5
    None,  # 6
    None,  # 7
    (8, TType.I64, 'spanId', None, None, ),  # 8
    (9, TType.STRING, 'endPoint', 'UTF8', None, ),  # 9
    (10, TType.LIST, 'spanEventList', (TType.STRUCT, [TSpanEvent, None], False), None, ),  # 10
    (11, TType.I16, 'applicationServiceType', None, None, ),  # 11
)
all_structs.append(TStringMetaData)
TStringMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'stringId', None, None, ),  # 4
    (5, TType.STRING, 'stringValue', 'UTF8', None, ),  # 5
)
all_structs.append(TSqlMetaData)
TSqlMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'sqlId', None, None, ),  # 4
    (5, TType.STRING, 'sql', 'UTF8', None, ),  # 5
)
all_structs.append(TApiMetaData)
TApiMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'apiId', None, None, ),  # 4
    (5, TType.STRING, 'apiInfo', 'UTF8', None, ),  # 5
    (6, TType.I32, 'line', None, None, ),  # 6
    None,  # 7
    None,  # 8
    None,  # 9
    (10, TType.I32, 'type', None, None, ),  # 10
)
all_structs.append(TResult)
TResult.thrift_spec = (
    None,  # 0
    (1, TType.BOOL, 'success', None, None, ),  # 1
    (2, TType.STRING, 'message', 'UTF8', None, ),  # 2
)
fix_spec(all_structs)
del all_structs

#
# Autogenerated by Thrift Compiler (0.11.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys

from thrift.transport import TTransport
all_structs = []


class TIntStringValue(object):
    """
    Attributes:
     - intValue
     - stringValue
    """


    def __init__(self, intValue=None, stringValue=None,):
        self.intValue = intValue
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntStringValue')
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 1)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 2)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TIntStringStringValue(object):
    """
    Attributes:
     - intValue
     - stringValue1
     - stringValue2
    """


    def __init__(self, intValue=None, stringValue1=None, stringValue2=None,):
        self.intValue = intValue
        self.stringValue1 = stringValue1
        self.stringValue2 = stringValue2

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.stringValue1 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.stringValue2 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntStringStringValue')
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 1)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.stringValue1 is not None:
            oprot.writeFieldBegin('stringValue1', TType.STRING, 2)
            oprot.writeString(self.stringValue1.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue1)
            oprot.writeFieldEnd()
        if self.stringValue2 is not None:
            oprot.writeFieldBegin('stringValue2', TType.STRING, 3)
            oprot.writeString(self.stringValue2.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue2)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TLongIntIntByteByteStringValue(object):
    """
    Attributes:
     - longValue
     - intValue1
     - intValue2
     - byteValue1
     - byteValue2
     - stringValue
    """


    def __init__(self, longValue=None, intValue1=None, intValue2=None, byteValue1=None, byteValue2=None, stringValue=None,):
        self.longValue = longValue
        self.intValue1 = intValue1
        self.intValue2 = intValue2
        self.byteValue1 = byteValue1
        self.byteValue2 = byteValue2
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.longValue = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.intValue1 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue2 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BYTE:
                    self.byteValue1 = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BYTE:
                    self.byteValue2 = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TLongIntIntByteByteStringValue')
        if self.longValue is not None:
            oprot.writeFieldBegin('longValue', TType.I64, 1)
            oprot.writeI64(self.longValue)
            oprot.writeFieldEnd()
        if self.intValue1 is not None:
            oprot.writeFieldBegin('intValue1', TType.I32, 2)
            oprot.writeI32(self.intValue1)
            oprot.writeFieldEnd()
        if self.intValue2 is not None:
            oprot.writeFieldBegin('intValue2', TType.I32, 3)
            oprot.writeI32(self.intValue2)
            oprot.writeFieldEnd()
        if self.byteValue1 is not None:
            oprot.writeFieldBegin('byteValue1', TType.BYTE, 4)
            oprot.writeByte(self.byteValue1)
            oprot.writeFieldEnd()
        if self.byteValue2 is not None:
            oprot.writeFieldBegin('byteValue2', TType.BYTE, 5)
            oprot.writeByte(self.byteValue2)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 6)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TIntBooleanIntBooleanValue(object):
    """
    Attributes:
     - intValue1
     - boolValue1
     - intValue2
     - boolValue2
    """


    def __init__(self, intValue1=None, boolValue1=None, intValue2=None, boolValue2=None,):
        self.intValue1 = intValue1
        self.boolValue1 = boolValue1
        self.intValue2 = intValue2
        self.boolValue2 = boolValue2

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.intValue1 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.boolValue1 = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue2 = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.boolValue2 = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TIntBooleanIntBooleanValue')
        if self.intValue1 is not None:
            oprot.writeFieldBegin('intValue1', TType.I32, 1)
            oprot.writeI32(self.intValue1)
            oprot.writeFieldEnd()
        if self.boolValue1 is not None:
            oprot.writeFieldBegin('boolValue1', TType.BOOL, 2)
            oprot.writeBool(self.boolValue1)
            oprot.writeFieldEnd()
        if self.intValue2 is not None:
            oprot.writeFieldBegin('intValue2', TType.I32, 3)
            oprot.writeI32(self.intValue2)
            oprot.writeFieldEnd()
        if self.boolValue2 is not None:
            oprot.writeFieldBegin('boolValue2', TType.BOOL, 4)
            oprot.writeBool(self.boolValue2)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TAnnotationValue(object):
    """
    Attributes:
     - stringValue
     - boolValue
     - intValue
     - longValue
     - shortValue
     - doubleValue
     - binaryValue
     - byteValue
     - intStringValue
     - intStringStringValue
     - longIntIntByteByteStringValue
     - intBooleanIntBooleanValue
    """


    def __init__(self, stringValue=None, boolValue=None, intValue=None, longValue=None, shortValue=None, doubleValue=None, binaryValue=None, byteValue=None, intStringValue=None, intStringStringValue=None, longIntIntByteByteStringValue=None, intBooleanIntBooleanValue=None,):
        self.stringValue = stringValue
        self.boolValue = boolValue
        self.intValue = intValue
        self.longValue = longValue
        self.shortValue = shortValue
        self.doubleValue = doubleValue
        self.binaryValue = binaryValue
        self.byteValue = byteValue
        self.intStringValue = intStringValue
        self.intStringStringValue = intStringStringValue
        self.longIntIntByteByteStringValue = longIntIntByteByteStringValue
        self.intBooleanIntBooleanValue = intBooleanIntBooleanValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.boolValue = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.intValue = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.longValue = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I16:
                    self.shortValue = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.DOUBLE:
                    self.doubleValue = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.binaryValue = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BYTE:
                    self.byteValue = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.STRUCT:
                    self.intStringValue = TIntStringValue()
                    self.intStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.STRUCT:
                    self.intStringStringValue = TIntStringStringValue()
                    self.intStringStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRUCT:
                    self.longIntIntByteByteStringValue = TLongIntIntByteByteStringValue()
                    self.longIntIntByteByteStringValue.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.STRUCT:
                    self.intBooleanIntBooleanValue = TIntBooleanIntBooleanValue()
                    self.intBooleanIntBooleanValue.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TAnnotationValue')
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 1)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        if self.boolValue is not None:
            oprot.writeFieldBegin('boolValue', TType.BOOL, 2)
            oprot.writeBool(self.boolValue)
            oprot.writeFieldEnd()
        if self.intValue is not None:
            oprot.writeFieldBegin('intValue', TType.I32, 3)
            oprot.writeI32(self.intValue)
            oprot.writeFieldEnd()
        if self.longValue is not None:
            oprot.writeFieldBegin('longValue', TType.I64, 4)
            oprot.writeI64(self.longValue)
            oprot.writeFieldEnd()
        if self.shortValue is not None:
            oprot.writeFieldBegin('shortValue', TType.I16, 5)
            oprot.writeI16(self.shortValue)
            oprot.writeFieldEnd()
        if self.doubleValue is not None:
            oprot.writeFieldBegin('doubleValue', TType.DOUBLE, 6)
            oprot.writeDouble(self.doubleValue)
            oprot.writeFieldEnd()
        if self.binaryValue is not None:
            oprot.writeFieldBegin('binaryValue', TType.STRING, 7)
            oprot.writeBinary(self.binaryValue)
            oprot.writeFieldEnd()
        if self.byteValue is not None:
            oprot.writeFieldBegin('byteValue', TType.BYTE, 8)
            oprot.writeByte(self.byteValue)
            oprot.writeFieldEnd()
        if self.intStringValue is not None:
            oprot.writeFieldBegin('intStringValue', TType.STRUCT, 9)
            self.intStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.intStringStringValue is not None:
            oprot.writeFieldBegin('intStringStringValue', TType.STRUCT, 10)
            self.intStringStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.longIntIntByteByteStringValue is not None:
            oprot.writeFieldBegin('longIntIntByteByteStringValue', TType.STRUCT, 11)
            self.longIntIntByteByteStringValue.write(oprot)
            oprot.writeFieldEnd()
        if self.intBooleanIntBooleanValue is not None:
            oprot.writeFieldBegin('intBooleanIntBooleanValue', TType.STRUCT, 12)
            self.intBooleanIntBooleanValue.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TAnnotation(object):
    """
    Attributes:
     - key
     - value
    """


    def __init__(self, key=None, value=None,):
        self.key = key
        self.value = value

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.key = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.value = TAnnotationValue()
                    self.value.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TAnnotation')
        if self.key is not None:
            oprot.writeFieldBegin('key', TType.I32, 1)
            oprot.writeI32(self.key)
            oprot.writeFieldEnd()
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRUCT, 2)
            self.value.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpanEvent(object):
    """
    Attributes:
     - spanId
     - sequence
     - startElapsed
     - endElapsed
     - rpc
     - serviceType
     - endPoint
     - annotations
     - depth
     - nextSpanId
     - destinationId
     - apiId
     - exceptionInfo
     - asyncId
     - nextAsyncId
     - asyncSequence
    """


    def __init__(self, spanId=None, sequence=None, startElapsed=None, endElapsed=0, rpc=None, serviceType=None, endPoint=None, annotations=None, depth=-1, nextSpanId=-1, destinationId=None, apiId=None, exceptionInfo=None, asyncId=None, nextAsyncId=None, asyncSequence=None,):
        self.spanId = spanId
        self.sequence = sequence
        self.startElapsed = startElapsed
        self.endElapsed = endElapsed
        self.rpc = rpc
        self.serviceType = serviceType
        self.endPoint = endPoint
        self.annotations = annotations
        self.depth = depth
        self.nextSpanId = nextSpanId
        self.destinationId = destinationId
        self.apiId = apiId
        self.exceptionInfo = exceptionInfo
        self.asyncId = asyncId
        self.nextAsyncId = nextAsyncId
        self.asyncSequence = asyncSequence

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 7:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I16:
                    self.sequence = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I32:
                    self.startElapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.endElapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.rpc = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.LIST:
                    self.annotations = []
                    (_etype3, _size0) = iprot.readListBegin()
                    for _i4 in range(_size0):
                        _elem5 = TAnnotation()
                        _elem5.read(iprot)
                        self.annotations.append(_elem5)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.I32:
                    self.depth = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.I64:
                    self.nextSpanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.STRING:
                    self.destinationId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 25:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 26:
                if ftype == TType.STRUCT:
                    self.exceptionInfo = TIntStringValue()
                    self.exceptionInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 30:
                if ftype == TType.I32:
                    self.asyncId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 31:
                if ftype == TType.I32:
                    self.nextAsyncId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 32:
                if ftype == TType.I16:
                    self.asyncSequence = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpanEvent')
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 7)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.sequence is not None:
            oprot.writeFieldBegin('sequence', TType.I16, 8)
            oprot.writeI16(self.sequence)
            oprot.writeFieldEnd()
        if self.startElapsed is not None:
            oprot.writeFieldBegin('startElapsed', TType.I32, 9)
            oprot.writeI32(self.startElapsed)
            oprot.writeFieldEnd()
        if self.endElapsed is not None:
            oprot.writeFieldBegin('endElapsed', TType.I32, 10)
            oprot.writeI32(self.endElapsed)
            oprot.writeFieldEnd()
        if self.rpc is not None:
            oprot.writeFieldBegin('rpc', TType.STRING, 11)
            oprot.writeString(self.rpc.encode('utf-8') if sys.version_info[0] == 2 else self.rpc)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 12)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 13)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.annotations is not None:
            oprot.writeFieldBegin('annotations', TType.LIST, 14)
            oprot.writeListBegin(TType.STRUCT, len(self.annotations))
            for iter6 in self.annotations:
                iter6.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.depth is not None:
            oprot.writeFieldBegin('depth', TType.I32, 15)
            oprot.writeI32(self.depth)
            oprot.writeFieldEnd()
        if self.nextSpanId is not None:
            oprot.writeFieldBegin('nextSpanId', TType.I64, 16)
            oprot.writeI64(self.nextSpanId)
            oprot.writeFieldEnd()
        if self.destinationId is not None:
            oprot.writeFieldBegin('destinationId', TType.STRING, 20)
            oprot.writeString(self.destinationId.encode('utf-8') if sys.version_info[0] == 2 else self.destinationId)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 25)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.exceptionInfo is not None:
            oprot.writeFieldBegin('exceptionInfo', TType.STRUCT, 26)
            self.exceptionInfo.write(oprot)
            oprot.writeFieldEnd()
        if self.asyncId is not None:
            oprot.writeFieldBegin('asyncId', TType.I32, 30)
            oprot.writeI32(self.asyncId)
            oprot.writeFieldEnd()
        if self.nextAsyncId is not None:
            oprot.writeFieldBegin('nextAsyncId', TType.I32, 31)
            oprot.writeI32(self.nextAsyncId)
            oprot.writeFieldEnd()
        if self.asyncSequence is not None:
            oprot.writeFieldBegin('asyncSequence', TType.I16, 32)
            oprot.writeI16(self.asyncSequence)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpan(object):
    """
    Attributes:
     - agentId
     - applicationName
     - agentStartTime
     - transactionId
     - spanId
     - parentSpanId
     - startTime
     - elapsed
     - rpc
     - serviceType
     - endPoint
     - remoteAddr
     - annotations
     - flag
     - err
     - spanEventList
     - parentApplicationName
     - parentApplicationType
     - acceptorHost
     - apiId
     - exceptionInfo
     - applicationServiceType
     - loggingTransactionInfo
    """


    def __init__(self, agentId=None, applicationName=None, agentStartTime=None, transactionId=None, spanId=None, parentSpanId=-1, startTime=None, elapsed=0, rpc=None, serviceType=None, endPoint=None, remoteAddr=None, annotations=None, flag=0, err=None, spanEventList=None, parentApplicationName=None, parentApplicationType=None, acceptorHost=None, apiId=None, exceptionInfo=None, applicationServiceType=None, loggingTransactionInfo=None,):
        self.agentId = agentId
        self.applicationName = applicationName
        self.agentStartTime = agentStartTime
        self.transactionId = transactionId
        self.spanId = spanId
        self.parentSpanId = parentSpanId
        self.startTime = startTime
        self.elapsed = elapsed
        self.rpc = rpc
        self.serviceType = serviceType
        self.endPoint = endPoint
        self.remoteAddr = remoteAddr
        self.annotations = annotations
        self.flag = flag
        self.err = err
        self.spanEventList = spanEventList
        self.parentApplicationName = parentApplicationName
        self.parentApplicationType = parentApplicationType
        self.acceptorHost = acceptorHost
        self.apiId = apiId
        self.exceptionInfo = exceptionInfo
        self.applicationServiceType = applicationServiceType
        self.loggingTransactionInfo = loggingTransactionInfo

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.applicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.transactionId = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.parentSpanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I64:
                    self.startTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.elapsed = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.rpc = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.STRING:
                    self.remoteAddr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.LIST:
                    self.annotations = []
                    (_etype10, _size7) = iprot.readListBegin()
                    for _i11 in range(_size7):
                        _elem12 = TAnnotation()
                        _elem12.read(iprot)
                        self.annotations.append(_elem12)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.I16:
                    self.flag = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 17:
                if ftype == TType.I32:
                    self.err = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 18:
                if ftype == TType.LIST:
                    self.spanEventList = []
                    (_etype16, _size13) = iprot.readListBegin()
                    for _i17 in range(_size13):
                        _elem18 = TSpanEvent()
                        _elem18.read(iprot)
                        self.spanEventList.append(_elem18)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 19:
                if ftype == TType.STRING:
                    self.parentApplicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.I16:
                    self.parentApplicationType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 21:
                if ftype == TType.STRING:
                    self.acceptorHost = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 25:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 26:
                if ftype == TType.STRUCT:
                    self.exceptionInfo = TIntStringValue()
                    self.exceptionInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 30:
                if ftype == TType.I16:
                    self.applicationServiceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 31:
                if ftype == TType.BYTE:
                    self.loggingTransactionInfo = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpan')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.applicationName is not None:
            oprot.writeFieldBegin('applicationName', TType.STRING, 2)
            oprot.writeString(self.applicationName.encode('utf-8') if sys.version_info[0] == 2 else self.applicationName)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 3)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.transactionId is not None:
            oprot.writeFieldBegin('transactionId', TType.STRING, 4)
            oprot.writeBinary(self.transactionId)
            oprot.writeFieldEnd()
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 7)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.parentSpanId is not None:
            oprot.writeFieldBegin('parentSpanId', TType.I64, 8)
            oprot.writeI64(self.parentSpanId)
            oprot.writeFieldEnd()
        if self.startTime is not None:
            oprot.writeFieldBegin('startTime', TType.I64, 9)
            oprot.writeI64(self.startTime)
            oprot.writeFieldEnd()
        if self.elapsed is not None:
            oprot.writeFieldBegin('elapsed', TType.I32, 10)
            oprot.writeI32(self.elapsed)
            oprot.writeFieldEnd()
        if self.rpc is not None:
            oprot.writeFieldBegin('rpc', TType.STRING, 11)
            oprot.writeString(self.rpc.encode('utf-8') if sys.version_info[0] == 2 else self.rpc)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 12)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 13)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.remoteAddr is not None:
            oprot.writeFieldBegin('remoteAddr', TType.STRING, 14)
            oprot.writeString(self.remoteAddr.encode('utf-8') if sys.version_info[0] == 2 else self.remoteAddr)
            oprot.writeFieldEnd()
        if self.annotations is not None:
            oprot.writeFieldBegin('annotations', TType.LIST, 15)
            oprot.writeListBegin(TType.STRUCT, len(self.annotations))
            for iter19 in self.annotations:
                iter19.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.flag is not None:
            oprot.writeFieldBegin('flag', TType.I16, 16)
            oprot.writeI16(self.flag)
            oprot.writeFieldEnd()
        if self.err is not None:
            oprot.writeFieldBegin('err', TType.I32, 17)
            oprot.writeI32(self.err)
            oprot.writeFieldEnd()
        if self.spanEventList is not None:
            oprot.writeFieldBegin('spanEventList', TType.LIST, 18)
            oprot.writeListBegin(TType.STRUCT, len(self.spanEventList))
            for iter20 in self.spanEventList:
                iter20.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.parentApplicationName is not None:
            oprot.writeFieldBegin('parentApplicationName', TType.STRING, 19)
            oprot.writeString(self.parentApplicationName.encode('utf-8') if sys.version_info[0] == 2 else self.parentApplicationName)
            oprot.writeFieldEnd()
        if self.parentApplicationType is not None:
            oprot.writeFieldBegin('parentApplicationType', TType.I16, 20)
            oprot.writeI16(self.parentApplicationType)
            oprot.writeFieldEnd()
        if self.acceptorHost is not None:
            oprot.writeFieldBegin('acceptorHost', TType.STRING, 21)
            oprot.writeString(self.acceptorHost.encode('utf-8') if sys.version_info[0] == 2 else self.acceptorHost)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 25)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.exceptionInfo is not None:
            oprot.writeFieldBegin('exceptionInfo', TType.STRUCT, 26)
            self.exceptionInfo.write(oprot)
            oprot.writeFieldEnd()
        if self.applicationServiceType is not None:
            oprot.writeFieldBegin('applicationServiceType', TType.I16, 30)
            oprot.writeI16(self.applicationServiceType)
            oprot.writeFieldEnd()
        if self.loggingTransactionInfo is not None:
            oprot.writeFieldBegin('loggingTransactionInfo', TType.BYTE, 31)
            oprot.writeByte(self.loggingTransactionInfo)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSpanChunk(object):
    """
    Attributes:
     - agentId
     - applicationName
     - agentStartTime
     - serviceType
     - transactionId
     - spanId
     - endPoint
     - spanEventList
     - applicationServiceType
    """


    def __init__(self, agentId=None, applicationName=None, agentStartTime=None, serviceType=None, transactionId=None, spanId=None, endPoint=None, spanEventList=None, applicationServiceType=None,):
        self.agentId = agentId
        self.applicationName = applicationName
        self.agentStartTime = agentStartTime
        self.serviceType = serviceType
        self.transactionId = transactionId
        self.spanId = spanId
        self.endPoint = endPoint
        self.spanEventList = spanEventList
        self.applicationServiceType = applicationServiceType

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.applicationName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I16:
                    self.serviceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.transactionId = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.spanId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.STRING:
                    self.endPoint = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.LIST:
                    self.spanEventList = []
                    (_etype24, _size21) = iprot.readListBegin()
                    for _i25 in range(_size21):
                        _elem26 = TSpanEvent()
                        _elem26.read(iprot)
                        self.spanEventList.append(_elem26)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.I16:
                    self.applicationServiceType = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSpanChunk')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.applicationName is not None:
            oprot.writeFieldBegin('applicationName', TType.STRING, 2)
            oprot.writeString(self.applicationName.encode('utf-8') if sys.version_info[0] == 2 else self.applicationName)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 3)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.serviceType is not None:
            oprot.writeFieldBegin('serviceType', TType.I16, 4)
            oprot.writeI16(self.serviceType)
            oprot.writeFieldEnd()
        if self.transactionId is not None:
            oprot.writeFieldBegin('transactionId', TType.STRING, 5)
            oprot.writeBinary(self.transactionId)
            oprot.writeFieldEnd()
        if self.spanId is not None:
            oprot.writeFieldBegin('spanId', TType.I64, 8)
            oprot.writeI64(self.spanId)
            oprot.writeFieldEnd()
        if self.endPoint is not None:
            oprot.writeFieldBegin('endPoint', TType.STRING, 9)
            oprot.writeString(self.endPoint.encode('utf-8') if sys.version_info[0] == 2 else self.endPoint)
            oprot.writeFieldEnd()
        if self.spanEventList is not None:
            oprot.writeFieldBegin('spanEventList', TType.LIST, 10)
            oprot.writeListBegin(TType.STRUCT, len(self.spanEventList))
            for iter27 in self.spanEventList:
                iter27.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.applicationServiceType is not None:
            oprot.writeFieldBegin('applicationServiceType', TType.I16, 11)
            oprot.writeI16(self.applicationServiceType)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TStringMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - stringId
     - stringValue
    """


    def __init__(self, agentId=None, agentStartTime=None, stringId=None, stringValue=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.stringId = stringId
        self.stringValue = stringValue

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.stringId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TStringMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.stringId is not None:
            oprot.writeFieldBegin('stringId', TType.I32, 4)
            oprot.writeI32(self.stringId)
            oprot.writeFieldEnd()
        if self.stringValue is not None:
            oprot.writeFieldBegin('stringValue', TType.STRING, 5)
            oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TSqlMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - sqlId
     - sql
    """


    def __init__(self, agentId=None, agentStartTime=None, sqlId=None, sql=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.sqlId = sqlId
        self.sql = sql

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.sqlId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.sql = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSqlMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.sqlId is not None:
            oprot.writeFieldBegin('sqlId', TType.I32, 4)
            oprot.writeI32(self.sqlId)
            oprot.writeFieldEnd()
        if self.sql is not None:
            oprot.writeFieldBegin('sql', TType.STRING, 5)
            oprot.writeString(self.sql.encode('utf-8') if sys.version_info[0] == 2 else self.sql)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TApiMetaData(object):
    """
    Attributes:
     - agentId
     - agentStartTime
     - apiId
     - apiInfo
     - line
     - type
    """


    def __init__(self, agentId=None, agentStartTime=None, apiId=None, apiInfo=None, line=None, type=None,):
        self.agentId = agentId
        self.agentStartTime = agentStartTime
        self.apiId = apiId
        self.apiInfo = apiInfo
        self.line = line
        self.type = type

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.agentId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.agentStartTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.apiId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.apiInfo = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I32:
                    self.line = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.type = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TApiMetaData')
        if self.agentId is not None:
            oprot.writeFieldBegin('agentId', TType.STRING, 1)
            oprot.writeString(self.agentId.encode('utf-8') if sys.version_info[0] == 2 else self.agentId)
            oprot.writeFieldEnd()
        if self.agentStartTime is not None:
            oprot.writeFieldBegin('agentStartTime', TType.I64, 2)
            oprot.writeI64(self.agentStartTime)
            oprot.writeFieldEnd()
        if self.apiId is not None:
            oprot.writeFieldBegin('apiId', TType.I32, 4)
            oprot.writeI32(self.apiId)
            oprot.writeFieldEnd()
        if self.apiInfo is not None:
            oprot.writeFieldBegin('apiInfo', TType.STRING, 5)
            oprot.writeString(self.apiInfo.encode('utf-8') if sys.version_info[0] == 2 else self.apiInfo)
            oprot.writeFieldEnd()
        if self.line is not None:
            oprot.writeFieldBegin('line', TType.I32, 6)
            oprot.writeI32(self.line)
            oprot.writeFieldEnd()
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 10)
            oprot.writeI32(self.type)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TResult(object):
    """
    Attributes:
     - success
     - message
    """


    def __init__(self, success=None, message=None,):
        self.success = success
        self.message = message

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TResult')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 1)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin('message', TType.STRING, 2)
            oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)
all_structs.append(TIntStringValue)
TIntStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue', None, None, ),  # 1
    (2, TType.STRING, 'stringValue', 'UTF8', None, ),  # 2
)
all_structs.append(TIntStringStringValue)
TIntStringStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue', None, None, ),  # 1
    (2, TType.STRING, 'stringValue1', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'stringValue2', 'UTF8', None, ),  # 3
)
all_structs.append(TLongIntIntByteByteStringValue)
TLongIntIntByteByteStringValue.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'longValue', None, None, ),  # 1
    (2, TType.I32, 'intValue1', None, None, ),  # 2
    (3, TType.I32, 'intValue2', None, None, ),  # 3
    (4, TType.BYTE, 'byteValue1', None, None, ),  # 4
    (5, TType.BYTE, 'byteValue2', None, None, ),  # 5
    (6, TType.STRING, 'stringValue', 'UTF8', None, ),  # 6
)
all_structs.append(TIntBooleanIntBooleanValue)
TIntBooleanIntBooleanValue.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'intValue1', None, None, ),  # 1
    (2, TType.BOOL, 'boolValue1', None, None, ),  # 2
    (3, TType.I32, 'intValue2', None, None, ),  # 3
    (4, TType.BOOL, 'boolValue2', None, None, ),  # 4
)
all_structs.append(TAnnotationValue)
TAnnotationValue.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'stringValue', 'UTF8', None, ),  # 1
    (2, TType.BOOL, 'boolValue', None, None, ),  # 2
    (3, TType.I32, 'intValue', None, None, ),  # 3
    (4, TType.I64, 'longValue', None, None, ),  # 4
    (5, TType.I16, 'shortValue', None, None, ),  # 5
    (6, TType.DOUBLE, 'doubleValue', None, None, ),  # 6
    (7, TType.STRING, 'binaryValue', 'BINARY', None, ),  # 7
    (8, TType.BYTE, 'byteValue', None, None, ),  # 8
    (9, TType.STRUCT, 'intStringValue', [TIntStringValue, None], None, ),  # 9
    (10, TType.STRUCT, 'intStringStringValue', [TIntStringStringValue, None], None, ),  # 10
    (11, TType.STRUCT, 'longIntIntByteByteStringValue', [TLongIntIntByteByteStringValue, None], None, ),  # 11
    (12, TType.STRUCT, 'intBooleanIntBooleanValue', [TIntBooleanIntBooleanValue, None], None, ),  # 12
)
all_structs.append(TAnnotation)
TAnnotation.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'key', None, None, ),  # 1
    (2, TType.STRUCT, 'value', [TAnnotationValue, None], None, ),  # 2
)
all_structs.append(TSpanEvent)
TSpanEvent.thrift_spec = (
    None,  # 0
    None,  # 1
    None,  # 2
    None,  # 3
    None,  # 4
    None,  # 5
    None,  # 6
    (7, TType.I64, 'spanId', None, None, ),  # 7
    (8, TType.I16, 'sequence', None, None, ),  # 8
    (9, TType.I32, 'startElapsed', None, None, ),  # 9
    (10, TType.I32, 'endElapsed', None, 0, ),  # 10
    (11, TType.STRING, 'rpc', 'UTF8', None, ),  # 11
    (12, TType.I16, 'serviceType', None, None, ),  # 12
    (13, TType.STRING, 'endPoint', 'UTF8', None, ),  # 13
    (14, TType.LIST, 'annotations', (TType.STRUCT, [TAnnotation, None], False), None, ),  # 14
    (15, TType.I32, 'depth', None, -1, ),  # 15
    (16, TType.I64, 'nextSpanId', None, -1, ),  # 16
    None,  # 17
    None,  # 18
    None,  # 19
    (20, TType.STRING, 'destinationId', 'UTF8', None, ),  # 20
    None,  # 21
    None,  # 22
    None,  # 23
    None,  # 24
    (25, TType.I32, 'apiId', None, None, ),  # 25
    (26, TType.STRUCT, 'exceptionInfo', [TIntStringValue, None], None, ),  # 26
    None,  # 27
    None,  # 28
    None,  # 29
    (30, TType.I32, 'asyncId', None, None, ),  # 30
    (31, TType.I32, 'nextAsyncId', None, None, ),  # 31
    (32, TType.I16, 'asyncSequence', None, None, ),  # 32
)
all_structs.append(TSpan)
TSpan.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'applicationName', 'UTF8', None, ),  # 2
    (3, TType.I64, 'agentStartTime', None, None, ),  # 3
    (4, TType.STRING, 'transactionId', 'BINARY', None, ),  # 4
    None,  # 5
    None,  # 6
    (7, TType.I64, 'spanId', None, None, ),  # 7
    (8, TType.I64, 'parentSpanId', None, -1, ),  # 8
    (9, TType.I64, 'startTime', None, None, ),  # 9
    (10, TType.I32, 'elapsed', None, 0, ),  # 10
    (11, TType.STRING, 'rpc', 'UTF8', None, ),  # 11
    (12, TType.I16, 'serviceType', None, None, ),  # 12
    (13, TType.STRING, 'endPoint', 'UTF8', None, ),  # 13
    (14, TType.STRING, 'remoteAddr', 'UTF8', None, ),  # 14
    (15, TType.LIST, 'annotations', (TType.STRUCT, [TAnnotation, None], False), None, ),  # 15
    (16, TType.I16, 'flag', None, 0, ),  # 16
    (17, TType.I32, 'err', None, None, ),  # 17
    (18, TType.LIST, 'spanEventList', (TType.STRUCT, [TSpanEvent, None], False), None, ),  # 18
    (19, TType.STRING, 'parentApplicationName', 'UTF8', None, ),  # 19
    (20, TType.I16, 'parentApplicationType', None, None, ),  # 20
    (21, TType.STRING, 'acceptorHost', 'UTF8', None, ),  # 21
    None,  # 22
    None,  # 23
    None,  # 24
    (25, TType.I32, 'apiId', None, None, ),  # 25
    (26, TType.STRUCT, 'exceptionInfo', [TIntStringValue, None], None, ),  # 26
    None,  # 27
    None,  # 28
    None,  # 29
    (30, TType.I16, 'applicationServiceType', None, None, ),  # 30
    (31, TType.BYTE, 'loggingTransactionInfo', None, None, ),  # 31
)
all_structs.append(TSpanChunk)
TSpanChunk.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'applicationName', 'UTF8', None, ),  # 2
    (3, TType.I64, 'agentStartTime', None, None, ),  # 3
    (4, TType.I16, 'serviceType', None, None, ),  # 4
    (5, TType.STRING, 'transactionId', 'BINARY', None, ),  # 5
    None,  # 6
    None,  # 7
    (8, TType.I64, 'spanId', None, None, ),  # 8
    (9, TType.STRING, 'endPoint', 'UTF8', None, ),  # 9
    (10, TType.LIST, 'spanEventList', (TType.STRUCT, [TSpanEvent, None], False), None, ),  # 10
    (11, TType.I16, 'applicationServiceType', None, None, ),  # 11
)
all_structs.append(TStringMetaData)
TStringMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'stringId', None, None, ),  # 4
    (5, TType.STRING, 'stringValue', 'UTF8', None, ),  # 5
)
all_structs.append(TSqlMetaData)
TSqlMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'sqlId', None, None, ),  # 4
    (5, TType.STRING, 'sql', 'UTF8', None, ),  # 5
)
all_structs.append(TApiMetaData)
TApiMetaData.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'agentId', 'UTF8', None, ),  # 1
    (2, TType.I64, 'agentStartTime', None, None, ),  # 2
    None,  # 3
    (4, TType.I32, 'apiId', None, None, ),  # 4
    (5, TType.STRING, 'apiInfo', 'UTF8', None, ),  # 5
    (6, TType.I32, 'line', None, None, ),  # 6
    None,  # 7
    None,  # 8
    None,  # 9
    (10, TType.I32, 'type', None, None, ),  # 10
)
all_structs.append(TResult)
TResult.thrift_spec = (
    None,  # 0
    (1, TType.BOOL, 'success', None, None, ),  # 1
    (2, TType.STRING, 'message', 'UTF8', None, ),  # 2
)
fix_spec(all_structs)
del all_structs
# # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # #  options string: py # Attributes:      - intValue      - stringValue Attributes:      - intValue      - stringValue1      - stringValue2 Attributes:      - longValue      - intValue1      - intValue2      - byteValue1      - byteValue2      - stringValue Attributes:      - intValue1      - boolValue1      - intValue2      - boolValue2 Attributes:      - stringValue      - boolValue      - intValue      - longValue      - shortValue      - doubleValue      - binaryValue      - byteValue      - intStringValue      - intStringStringValue      - longIntIntByteByteStringValue      - intBooleanIntBooleanValue Attributes:      - key      - value Attributes:      - spanId      - sequence      - startElapsed      - endElapsed      - rpc      - serviceType      - endPoint      - annotations      - depth      - nextSpanId      - destinationId      - apiId      - exceptionInfo      - asyncId      - nextAsyncId      - asyncSequence Attributes:      - agentId      - applicationName      - agentStartTime      - transactionId      - spanId      - parentSpanId      - startTime      - elapsed      - rpc      - serviceType      - endPoint      - remoteAddr      - annotations      - flag      - err      - spanEventList      - parentApplicationName      - parentApplicationType      - acceptorHost      - apiId      - exceptionInfo      - applicationServiceType      - loggingTransactionInfo Attributes:      - agentId      - applicationName      - agentStartTime      - serviceType      - transactionId      - spanId      - endPoint      - spanEventList      - applicationServiceType Attributes:      - agentId      - agentStartTime      - stringId      - stringValue Attributes:      - agentId      - agentStartTime      - sqlId      - sql Attributes:      - agentId      - agentStartTime      - apiId      - apiInfo      - line      - type Attributes:      - success      - message # 0 # 1 # 2 # 0 # 1 # 2 # 3 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 0 # 1 # 2 # 3 # 4 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 0 # 1 # 2 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 26 # 27 # 28 # 29 # 30 # 31 # 32 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 26 # 27 # 28 # 29 # 30 # 31 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 0 # 1 # 2 # 3 # 4 # 5 # 0 # 1 # 2 # 3 # 4 # 5 # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 0 # 1 # 2