#
# 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
import koverse.thriftgen.ttypes
import koverse.thriftgen.security.ttypes

from thrift.transport import TTransport
all_structs = []


class TQueryErrorType(object):
    UNKNOWN = 0
    INCORRECT_SYNTAX = 1
    NEEDS_COMPOSITE_INDEX = 2
    NOT_SUPPORTED = 3

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "INCORRECT_SYNTAX",
        2: "NEEDS_COMPOSITE_INDEX",
        3: "NOT_SUPPORTED",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "INCORRECT_SYNTAX": 1,
        "NEEDS_COMPOSITE_INDEX": 2,
        "NOT_SUPPORTED": 3,
    }


class TSqlSchemaScalarType(object):
    UNKNOWN = 0
    STRING = 1
    INTEGER = 2
    FLOATING_POINT = 3
    BLOB = 4
    DATE = 5
    BOOLEAN = 6
    TIMESTAMP = 7

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "STRING",
        2: "INTEGER",
        3: "FLOATING_POINT",
        4: "BLOB",
        5: "DATE",
        6: "BOOLEAN",
        7: "TIMESTAMP",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "STRING": 1,
        "INTEGER": 2,
        "FLOATING_POINT": 3,
        "BLOB": 4,
        "DATE": 5,
        "BOOLEAN": 6,
        "TIMESTAMP": 7,
    }


class TMimeValue(object):
    """
    Attributes:
     - type
     - data
    """


    def __init__(self, type=None, data=None,):
        self.type = type
        self.data = data

    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.type = 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.data = iprot.readBinary()
                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('TMimeValue')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.STRING, 1)
            oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type)
            oprot.writeFieldEnd()
        if self.data is not None:
            oprot.writeFieldBegin('data', TType.STRING, 2)
            oprot.writeBinary(self.data)
            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 TQueryError(object):
    """
    Attributes:
     - type
     - query
     - message
    """


    def __init__(self, type=None, query=None, message=None,):
        self.type = type
        self.query = query
        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.I32:
                    self.type = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.query = 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.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('TQueryError')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 1)
            oprot.writeI32(self.type)
            oprot.writeFieldEnd()
        if self.query is not None:
            oprot.writeFieldBegin('query', TType.STRING, 2)
            oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin('message', TType.STRING, 3)
            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)


class TQueryErrorException(TException):
    """
    Attributes:
     - queryError
    """


    def __init__(self, queryError=None,):
        self.queryError = queryError

    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.STRUCT:
                    self.queryError = TQueryError()
                    self.queryError.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('TQueryErrorException')
        if self.queryError is not None:
            oprot.writeFieldBegin('queryError', TType.STRUCT, 1)
            self.queryError.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __str__(self):
        return repr(self)

    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 TAggregateProducer(object):
    """
    Attributes:
     - type
     - relation
    """


    def __init__(self, type=None, relation=None,):
        self.type = type
        self.relation = relation

    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.type = 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.relation = 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('TAggregateProducer')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.STRING, 1)
            oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type)
            oprot.writeFieldEnd()
        if self.relation is not None:
            oprot.writeFieldBegin('relation', TType.STRING, 2)
            oprot.writeString(self.relation.encode('utf-8') if sys.version_info[0] == 2 else self.relation)
            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 TAggregateDimensionValue(object):
    """
    Attributes:
     - field
     - value
    """


    def __init__(self, field=None, value=None,):
        self.field = field
        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.STRING:
                    self.field = 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.value = 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('TAggregateDimensionValue')
        if self.field is not None:
            oprot.writeFieldBegin('field', TType.STRING, 1)
            oprot.writeString(self.field.encode('utf-8') if sys.version_info[0] == 2 else self.field)
            oprot.writeFieldEnd()
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRING, 2)
            oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
            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 TAggregateDimensionValuesProducerPair(object):
    """
    Attributes:
     - dimensionValues
     - producer
    """


    def __init__(self, dimensionValues=None, producer=None,):
        self.dimensionValues = dimensionValues
        self.producer = producer

    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.LIST:
                    self.dimensionValues = []
                    (_etype3, _size0) = iprot.readListBegin()
                    for _i4 in range(_size0):
                        _elem5 = TAggregateDimensionValue()
                        _elem5.read(iprot)
                        self.dimensionValues.append(_elem5)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.producer = TAggregateProducer()
                    self.producer.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('TAggregateDimensionValuesProducerPair')
        if self.dimensionValues is not None:
            oprot.writeFieldBegin('dimensionValues', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.dimensionValues))
            for iter6 in self.dimensionValues:
                iter6.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.producer is not None:
            oprot.writeFieldBegin('producer', TType.STRUCT, 2)
            self.producer.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 TAggregateQuery(object):
    """
    Attributes:
     - collectionId
     - dimensionValuesProducerPairs
     - generateTotal
    """


    def __init__(self, collectionId=None, dimensionValuesProducerPairs=None, generateTotal=None,):
        self.collectionId = collectionId
        self.dimensionValuesProducerPairs = dimensionValuesProducerPairs
        self.generateTotal = generateTotal

    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.collectionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.dimensionValuesProducerPairs = []
                    (_etype10, _size7) = iprot.readListBegin()
                    for _i11 in range(_size7):
                        _elem12 = TAggregateDimensionValuesProducerPair()
                        _elem12.read(iprot)
                        self.dimensionValuesProducerPairs.append(_elem12)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.generateTotal = 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('TAggregateQuery')
        if self.collectionId is not None:
            oprot.writeFieldBegin('collectionId', TType.STRING, 1)
            oprot.writeString(self.collectionId.encode('utf-8') if sys.version_info[0] == 2 else self.collectionId)
            oprot.writeFieldEnd()
        if self.dimensionValuesProducerPairs is not None:
            oprot.writeFieldBegin('dimensionValuesProducerPairs', TType.LIST, 2)
            oprot.writeListBegin(TType.STRUCT, len(self.dimensionValuesProducerPairs))
            for iter13 in self.dimensionValuesProducerPairs:
                iter13.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.generateTotal is not None:
            oprot.writeFieldBegin('generateTotal', TType.BOOL, 3)
            oprot.writeBool(self.generateTotal)
            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 TAggregateValue(object):
    """
    Attributes:
     - dimensionValuesProducerPair
     - value
    """


    def __init__(self, dimensionValuesProducerPair=None, value=None,):
        self.dimensionValuesProducerPair = dimensionValuesProducerPair
        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.STRUCT:
                    self.dimensionValuesProducerPair = TAggregateDimensionValuesProducerPair()
                    self.dimensionValuesProducerPair.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.value = 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('TAggregateValue')
        if self.dimensionValuesProducerPair is not None:
            oprot.writeFieldBegin('dimensionValuesProducerPair', TType.STRUCT, 1)
            self.dimensionValuesProducerPair.write(oprot)
            oprot.writeFieldEnd()
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRING, 2)
            oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
            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 TAggregateQueryResult(object):
    """
    Attributes:
     - collectionId
     - aggregateValues
     - total
     - lastAggregationExecuted
    """


    def __init__(self, collectionId=None, aggregateValues=None, total=None, lastAggregationExecuted=None,):
        self.collectionId = collectionId
        self.aggregateValues = aggregateValues
        self.total = total
        self.lastAggregationExecuted = lastAggregationExecuted

    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.collectionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.aggregateValues = []
                    (_etype17, _size14) = iprot.readListBegin()
                    for _i18 in range(_size14):
                        _elem19 = TAggregateValue()
                        _elem19.read(iprot)
                        self.aggregateValues.append(_elem19)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.total = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.lastAggregationExecuted = iprot.readI64()
                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('TAggregateQueryResult')
        if self.collectionId is not None:
            oprot.writeFieldBegin('collectionId', TType.STRING, 1)
            oprot.writeString(self.collectionId.encode('utf-8') if sys.version_info[0] == 2 else self.collectionId)
            oprot.writeFieldEnd()
        if self.aggregateValues is not None:
            oprot.writeFieldBegin('aggregateValues', TType.LIST, 2)
            oprot.writeListBegin(TType.STRUCT, len(self.aggregateValues))
            for iter20 in self.aggregateValues:
                iter20.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.total is not None:
            oprot.writeFieldBegin('total', TType.STRING, 3)
            oprot.writeString(self.total.encode('utf-8') if sys.version_info[0] == 2 else self.total)
            oprot.writeFieldEnd()
        if self.lastAggregationExecuted is not None:
            oprot.writeFieldBegin('lastAggregationExecuted', TType.I64, 4)
            oprot.writeI64(self.lastAggregationExecuted)
            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 TSqlSchemaScalar(object):
    """
    Attributes:
     - type
    """


    def __init__(self, type=None,):
        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.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('TSqlSchemaScalar')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 1)
            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 TSqlSchemaStructure(object):
    """
    Attributes:
     - fields
    """


    def __init__(self, fields=None,):
        self.fields = fields

    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.MAP:
                    self.fields = {}
                    (_ktype22, _vtype23, _size21) = iprot.readMapBegin()
                    for _i25 in range(_size21):
                        _key26 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val27 = TSqlSchemaType()
                        _val27.read(iprot)
                        self.fields[_key26] = _val27
                    iprot.readMapEnd()
                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('TSqlSchemaStructure')
        if self.fields is not None:
            oprot.writeFieldBegin('fields', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.fields))
            for kiter28, viter29 in self.fields.items():
                oprot.writeString(kiter28.encode('utf-8') if sys.version_info[0] == 2 else kiter28)
                viter29.write(oprot)
            oprot.writeMapEnd()
            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 TSqlSchemaArray(object):
    """
    Attributes:
     - type
    """


    def __init__(self, type=None,):
        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.STRUCT:
                    self.type = TSqlSchemaType()
                    self.type.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('TSqlSchemaArray')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.STRUCT, 1)
            self.type.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 TSqlSchemaType(object):
    """
    Attributes:
     - structure
     - array
     - scalar
    """


    def __init__(self, structure=None, array=None, scalar=None,):
        self.structure = structure
        self.array = array
        self.scalar = scalar

    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.STRUCT:
                    self.structure = TSqlSchemaStructure()
                    self.structure.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.array = TSqlSchemaArray()
                    self.array.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.scalar = TSqlSchemaScalar()
                    self.scalar.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('TSqlSchemaType')
        if self.structure is not None:
            oprot.writeFieldBegin('structure', TType.STRUCT, 1)
            self.structure.write(oprot)
            oprot.writeFieldEnd()
        if self.array is not None:
            oprot.writeFieldBegin('array', TType.STRUCT, 2)
            self.array.write(oprot)
            oprot.writeFieldEnd()
        if self.scalar is not None:
            oprot.writeFieldBegin('scalar', TType.STRUCT, 3)
            self.scalar.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 TSqlSchema(object):
    """
    Attributes:
     - root
    """


    def __init__(self, root=None,):
        self.root = root

    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.STRUCT:
                    self.root = TSqlSchemaStructure()
                    self.root.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('TSqlSchema')
        if self.root is not None:
            oprot.writeFieldBegin('root', TType.STRUCT, 1)
            self.root.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 TSqlValueScalar(object):
    """
    Attributes:
     - value
    """


    def __init__(self, value=None,):
        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.STRING:
                    self.value = 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('TSqlValueScalar')
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRING, 1)
            oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
            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 TSqlValueStructure(object):
    """
    Attributes:
     - fields
    """


    def __init__(self, fields=None,):
        self.fields = fields

    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.MAP:
                    self.fields = {}
                    (_ktype31, _vtype32, _size30) = iprot.readMapBegin()
                    for _i34 in range(_size30):
                        _key35 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val36 = TSqlValue()
                        _val36.read(iprot)
                        self.fields[_key35] = _val36
                    iprot.readMapEnd()
                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('TSqlValueStructure')
        if self.fields is not None:
            oprot.writeFieldBegin('fields', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.fields))
            for kiter37, viter38 in self.fields.items():
                oprot.writeString(kiter37.encode('utf-8') if sys.version_info[0] == 2 else kiter37)
                viter38.write(oprot)
            oprot.writeMapEnd()
            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 TSqlValueArray(object):
    """
    Attributes:
     - values
    """


    def __init__(self, values=None,):
        self.values = values

    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.LIST:
                    self.values = []
                    (_etype42, _size39) = iprot.readListBegin()
                    for _i43 in range(_size39):
                        _elem44 = TSqlValue()
                        _elem44.read(iprot)
                        self.values.append(_elem44)
                    iprot.readListEnd()
                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('TSqlValueArray')
        if self.values is not None:
            oprot.writeFieldBegin('values', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.values))
            for iter45 in self.values:
                iter45.write(oprot)
            oprot.writeListEnd()
            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 TSqlValue(object):
    """
    Attributes:
     - structure
     - array
     - scalar
    """


    def __init__(self, structure=None, array=None, scalar=None,):
        self.structure = structure
        self.array = array
        self.scalar = scalar

    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.STRUCT:
                    self.structure = TSqlValueStructure()
                    self.structure.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.array = TSqlValueArray()
                    self.array.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.scalar = TSqlValueScalar()
                    self.scalar.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('TSqlValue')
        if self.structure is not None:
            oprot.writeFieldBegin('structure', TType.STRUCT, 1)
            self.structure.write(oprot)
            oprot.writeFieldEnd()
        if self.array is not None:
            oprot.writeFieldBegin('array', TType.STRUCT, 2)
            self.array.write(oprot)
            oprot.writeFieldEnd()
        if self.scalar is not None:
            oprot.writeFieldBegin('scalar', TType.STRUCT, 3)
            self.scalar.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 TSqlCursor(object):
    """
    Attributes:
     - cursorId
     - ownerId
     - numResults
     - expiration
     - resultsRemaining
    """


    def __init__(self, cursorId=None, ownerId=None, numResults=None, expiration=None, resultsRemaining=None,):
        self.cursorId = cursorId
        self.ownerId = ownerId
        self.numResults = numResults
        self.expiration = expiration
        self.resultsRemaining = resultsRemaining

    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.cursorId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.ownerId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.numResults = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.expiration = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.resultsRemaining = iprot.readI64()
                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('TSqlCursor')
        if self.cursorId is not None:
            oprot.writeFieldBegin('cursorId', TType.I64, 1)
            oprot.writeI64(self.cursorId)
            oprot.writeFieldEnd()
        if self.ownerId is not None:
            oprot.writeFieldBegin('ownerId', TType.I64, 2)
            oprot.writeI64(self.ownerId)
            oprot.writeFieldEnd()
        if self.numResults is not None:
            oprot.writeFieldBegin('numResults', TType.I64, 3)
            oprot.writeI64(self.numResults)
            oprot.writeFieldEnd()
        if self.expiration is not None:
            oprot.writeFieldBegin('expiration', TType.I64, 4)
            oprot.writeI64(self.expiration)
            oprot.writeFieldEnd()
        if self.resultsRemaining is not None:
            oprot.writeFieldBegin('resultsRemaining', TType.I64, 5)
            oprot.writeI64(self.resultsRemaining)
            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 TSqlResults(object):
    """
    Attributes:
     - cursorId
     - moreResults
     - results
    """


    def __init__(self, cursorId=None, moreResults=None, results=None,):
        self.cursorId = cursorId
        self.moreResults = moreResults
        self.results = results

    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.cursorId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.moreResults = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.results = []
                    (_etype49, _size46) = iprot.readListBegin()
                    for _i50 in range(_size46):
                        _elem51 = koverse.thriftgen.ttypes.TSimpleRecord()
                        _elem51.read(iprot)
                        self.results.append(_elem51)
                    iprot.readListEnd()
                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('TSqlResults')
        if self.cursorId is not None:
            oprot.writeFieldBegin('cursorId', TType.I64, 1)
            oprot.writeI64(self.cursorId)
            oprot.writeFieldEnd()
        if self.moreResults is not None:
            oprot.writeFieldBegin('moreResults', TType.BOOL, 2)
            oprot.writeBool(self.moreResults)
            oprot.writeFieldEnd()
        if self.results is not None:
            oprot.writeFieldBegin('results', TType.LIST, 3)
            oprot.writeListBegin(TType.STRUCT, len(self.results))
            for iter52 in self.results:
                iter52.write(oprot)
            oprot.writeListEnd()
            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 TSqlTableRow(object):
    """
    Attributes:
     - root
    """


    def __init__(self, root=None,):
        self.root = root

    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.STRUCT:
                    self.root = TSqlValueStructure()
                    self.root.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('TSqlTableRow')
        if self.root is not None:
            oprot.writeFieldBegin('root', TType.STRUCT, 1)
            self.root.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 TDataSetName(object):
    """
    Attributes:
     - id
     - name
    """


    def __init__(self, id=None, name=None,):
        self.id = id
        self.name = name

    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.id = 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.name = 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('TDataSetName')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.STRING, 1)
            oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            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 TSuggestion(object):
    """
    Attributes:
     - type
     - value
     - labelId
     - dataSetId
    """


    def __init__(self, type=None, value=None, labelId=None, dataSetId=None,):
        self.type = type
        self.value = value
        self.labelId = labelId
        self.dataSetId = dataSetId

    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.type = 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.value = 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.labelId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.dataSetId = 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('TSuggestion')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.STRING, 1)
            oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type)
            oprot.writeFieldEnd()
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRING, 2)
            oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
            oprot.writeFieldEnd()
        if self.labelId is not None:
            oprot.writeFieldBegin('labelId', TType.STRING, 3)
            oprot.writeString(self.labelId.encode('utf-8') if sys.version_info[0] == 2 else self.labelId)
            oprot.writeFieldEnd()
        if self.dataSetId is not None:
            oprot.writeFieldBegin('dataSetId', TType.STRING, 4)
            oprot.writeString(self.dataSetId.encode('utf-8') if sys.version_info[0] == 2 else self.dataSetId)
            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 TDataSetResult(object):
    """
    Attributes:
     - id
     - name
     - description
     - attributeMatchCount
     - recordMatchCount
     - recordCount
     - createdTimestamp
     - updatedTimestamp
     - flatSchema
     - labels
     - records
     - recordMatchCountLimited
     - successful
     - errorMessage
    """


    def __init__(self, id=None, name=None, description=None, attributeMatchCount=None, recordMatchCount=None, recordCount=None, createdTimestamp=None, updatedTimestamp=None, flatSchema=None, labels=None, records=None, recordMatchCountLimited=None, successful=None, errorMessage=None,):
        self.id = id
        self.name = name
        self.description = description
        self.attributeMatchCount = attributeMatchCount
        self.recordMatchCount = recordMatchCount
        self.recordCount = recordCount
        self.createdTimestamp = createdTimestamp
        self.updatedTimestamp = updatedTimestamp
        self.flatSchema = flatSchema
        self.labels = labels
        self.records = records
        self.recordMatchCountLimited = recordMatchCountLimited
        self.successful = successful
        self.errorMessage = errorMessage

    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.id = 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.name = 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.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.attributeMatchCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.recordMatchCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.recordCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.createdTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.updatedTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.BOOL:
                    self.flatSchema = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.LIST:
                    self.labels = []
                    (_etype56, _size53) = iprot.readListBegin()
                    for _i57 in range(_size53):
                        _elem58 = koverse.thriftgen.ttypes.TLabel()
                        _elem58.read(iprot)
                        self.labels.append(_elem58)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.LIST:
                    self.records = []
                    (_etype62, _size59) = iprot.readListBegin()
                    for _i63 in range(_size59):
                        _elem64 = koverse.thriftgen.ttypes.TSimpleRecord()
                        _elem64.read(iprot)
                        self.records.append(_elem64)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.BOOL:
                    self.recordMatchCountLimited = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.BOOL:
                    self.successful = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.STRING:
                    self.errorMessage = 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('TDataSetResult')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.STRING, 1)
            oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 3)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        if self.attributeMatchCount is not None:
            oprot.writeFieldBegin('attributeMatchCount', TType.I64, 4)
            oprot.writeI64(self.attributeMatchCount)
            oprot.writeFieldEnd()
        if self.recordMatchCount is not None:
            oprot.writeFieldBegin('recordMatchCount', TType.I64, 5)
            oprot.writeI64(self.recordMatchCount)
            oprot.writeFieldEnd()
        if self.recordCount is not None:
            oprot.writeFieldBegin('recordCount', TType.I64, 6)
            oprot.writeI64(self.recordCount)
            oprot.writeFieldEnd()
        if self.createdTimestamp is not None:
            oprot.writeFieldBegin('createdTimestamp', TType.I64, 7)
            oprot.writeI64(self.createdTimestamp)
            oprot.writeFieldEnd()
        if self.updatedTimestamp is not None:
            oprot.writeFieldBegin('updatedTimestamp', TType.I64, 8)
            oprot.writeI64(self.updatedTimestamp)
            oprot.writeFieldEnd()
        if self.flatSchema is not None:
            oprot.writeFieldBegin('flatSchema', TType.BOOL, 9)
            oprot.writeBool(self.flatSchema)
            oprot.writeFieldEnd()
        if self.labels is not None:
            oprot.writeFieldBegin('labels', TType.LIST, 10)
            oprot.writeListBegin(TType.STRUCT, len(self.labels))
            for iter65 in self.labels:
                iter65.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.records is not None:
            oprot.writeFieldBegin('records', TType.LIST, 11)
            oprot.writeListBegin(TType.STRUCT, len(self.records))
            for iter66 in self.records:
                iter66.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.recordMatchCountLimited is not None:
            oprot.writeFieldBegin('recordMatchCountLimited', TType.BOOL, 12)
            oprot.writeBool(self.recordMatchCountLimited)
            oprot.writeFieldEnd()
        if self.successful is not None:
            oprot.writeFieldBegin('successful', TType.BOOL, 13)
            oprot.writeBool(self.successful)
            oprot.writeFieldEnd()
        if self.errorMessage is not None:
            oprot.writeFieldBegin('errorMessage', TType.STRING, 14)
            oprot.writeString(self.errorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.errorMessage)
            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 TLabelResult(object):
    """
    Attributes:
     - labelId
     - name
     - dataSetCount
    """


    def __init__(self, labelId=None, name=None, dataSetCount=None,):
        self.labelId = labelId
        self.name = name
        self.dataSetCount = dataSetCount

    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.labelId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = 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.dataSetCount = iprot.readI64()
                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('TLabelResult')
        if self.labelId is not None:
            oprot.writeFieldBegin('labelId', TType.I64, 1)
            oprot.writeI64(self.labelId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.dataSetCount is not None:
            oprot.writeFieldBegin('dataSetCount', TType.I64, 3)
            oprot.writeI64(self.dataSetCount)
            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 TSearchResults(object):
    """
    Attributes:
     - dataSets
     - labels
    """


    def __init__(self, dataSets=None, labels=None,):
        self.dataSets = dataSets
        self.labels = labels

    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.LIST:
                    self.dataSets = []
                    (_etype70, _size67) = iprot.readListBegin()
                    for _i71 in range(_size67):
                        _elem72 = TDataSetResult()
                        _elem72.read(iprot)
                        self.dataSets.append(_elem72)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.labels = []
                    (_etype76, _size73) = iprot.readListBegin()
                    for _i77 in range(_size73):
                        _elem78 = TLabelResult()
                        _elem78.read(iprot)
                        self.labels.append(_elem78)
                    iprot.readListEnd()
                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('TSearchResults')
        if self.dataSets is not None:
            oprot.writeFieldBegin('dataSets', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.dataSets))
            for iter79 in self.dataSets:
                iter79.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.labels is not None:
            oprot.writeFieldBegin('labels', TType.LIST, 2)
            oprot.writeListBegin(TType.STRUCT, len(self.labels))
            for iter80 in self.labels:
                iter80.write(oprot)
            oprot.writeListEnd()
            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 TRecentUserQuery(object):
    """
    Attributes:
     - id
     - userId
     - query
     - timestamp
    """


    def __init__(self, id=None, userId=None, query=None, timestamp=None,):
        self.id = id
        self.userId = userId
        self.query = query
        self.timestamp = timestamp

    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.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.userId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.timestamp = iprot.readI64()
                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('TRecentUserQuery')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.userId is not None:
            oprot.writeFieldBegin('userId', TType.I64, 2)
            oprot.writeI64(self.userId)
            oprot.writeFieldEnd()
        if self.query is not None:
            oprot.writeFieldBegin('query', TType.STRING, 3)
            oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query)
            oprot.writeFieldEnd()
        if self.timestamp is not None:
            oprot.writeFieldBegin('timestamp', TType.I64, 4)
            oprot.writeI64(self.timestamp)
            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(TMimeValue)
TMimeValue.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'type', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'data', 'BINARY', None, ),  # 2
)
all_structs.append(TQueryError)
TQueryError.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'type', None, None, ),  # 1
    (2, TType.STRING, 'query', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'message', 'UTF8', None, ),  # 3
)
all_structs.append(TQueryErrorException)
TQueryErrorException.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'queryError', [TQueryError, None], None, ),  # 1
)
all_structs.append(TAggregateProducer)
TAggregateProducer.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'type', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'relation', 'UTF8', None, ),  # 2
)
all_structs.append(TAggregateDimensionValue)
TAggregateDimensionValue.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'field', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'value', 'UTF8', None, ),  # 2
)
all_structs.append(TAggregateDimensionValuesProducerPair)
TAggregateDimensionValuesProducerPair.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'dimensionValues', (TType.STRUCT, [TAggregateDimensionValue, None], False), None, ),  # 1
    (2, TType.STRUCT, 'producer', [TAggregateProducer, None], None, ),  # 2
)
all_structs.append(TAggregateQuery)
TAggregateQuery.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'collectionId', 'UTF8', None, ),  # 1
    (2, TType.LIST, 'dimensionValuesProducerPairs', (TType.STRUCT, [TAggregateDimensionValuesProducerPair, None], False), None, ),  # 2
    (3, TType.BOOL, 'generateTotal', None, None, ),  # 3
)
all_structs.append(TAggregateValue)
TAggregateValue.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'dimensionValuesProducerPair', [TAggregateDimensionValuesProducerPair, None], None, ),  # 1
    (2, TType.STRING, 'value', 'UTF8', None, ),  # 2
)
all_structs.append(TAggregateQueryResult)
TAggregateQueryResult.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'collectionId', 'UTF8', None, ),  # 1
    (2, TType.LIST, 'aggregateValues', (TType.STRUCT, [TAggregateValue, None], False), None, ),  # 2
    (3, TType.STRING, 'total', 'UTF8', None, ),  # 3
    (4, TType.I64, 'lastAggregationExecuted', None, None, ),  # 4
)
all_structs.append(TSqlSchemaScalar)
TSqlSchemaScalar.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'type', None, None, ),  # 1
)
all_structs.append(TSqlSchemaStructure)
TSqlSchemaStructure.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'fields', (TType.STRING, 'UTF8', TType.STRUCT, [TSqlSchemaType, None], False), None, ),  # 1
)
all_structs.append(TSqlSchemaArray)
TSqlSchemaArray.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'type', [TSqlSchemaType, None], None, ),  # 1
)
all_structs.append(TSqlSchemaType)
TSqlSchemaType.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'structure', [TSqlSchemaStructure, None], None, ),  # 1
    (2, TType.STRUCT, 'array', [TSqlSchemaArray, None], None, ),  # 2
    (3, TType.STRUCT, 'scalar', [TSqlSchemaScalar, None], None, ),  # 3
)
all_structs.append(TSqlSchema)
TSqlSchema.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'root', [TSqlSchemaStructure, None], None, ),  # 1
)
all_structs.append(TSqlValueScalar)
TSqlValueScalar.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'value', 'UTF8', None, ),  # 1
)
all_structs.append(TSqlValueStructure)
TSqlValueStructure.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'fields', (TType.STRING, 'UTF8', TType.STRUCT, [TSqlValue, None], False), None, ),  # 1
)
all_structs.append(TSqlValueArray)
TSqlValueArray.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'values', (TType.STRUCT, [TSqlValue, None], False), None, ),  # 1
)
all_structs.append(TSqlValue)
TSqlValue.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'structure', [TSqlValueStructure, None], None, ),  # 1
    (2, TType.STRUCT, 'array', [TSqlValueArray, None], None, ),  # 2
    (3, TType.STRUCT, 'scalar', [TSqlValueScalar, None], None, ),  # 3
)
all_structs.append(TSqlCursor)
TSqlCursor.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'cursorId', None, None, ),  # 1
    (2, TType.I64, 'ownerId', None, None, ),  # 2
    (3, TType.I64, 'numResults', None, None, ),  # 3
    (4, TType.I64, 'expiration', None, None, ),  # 4
    (5, TType.I64, 'resultsRemaining', None, None, ),  # 5
)
all_structs.append(TSqlResults)
TSqlResults.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'cursorId', None, None, ),  # 1
    (2, TType.BOOL, 'moreResults', None, None, ),  # 2
    (3, TType.LIST, 'results', (TType.STRUCT, [koverse.thriftgen.ttypes.TSimpleRecord, None], False), None, ),  # 3
)
all_structs.append(TSqlTableRow)
TSqlTableRow.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'root', [TSqlValueStructure, None], None, ),  # 1
)
all_structs.append(TDataSetName)
TDataSetName.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'id', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
)
all_structs.append(TSuggestion)
TSuggestion.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'type', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'value', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'labelId', 'UTF8', None, ),  # 3
    (4, TType.STRING, 'dataSetId', 'UTF8', None, ),  # 4
)
all_structs.append(TDataSetResult)
TDataSetResult.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'id', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'description', 'UTF8', None, ),  # 3
    (4, TType.I64, 'attributeMatchCount', None, None, ),  # 4
    (5, TType.I64, 'recordMatchCount', None, None, ),  # 5
    (6, TType.I64, 'recordCount', None, None, ),  # 6
    (7, TType.I64, 'createdTimestamp', None, None, ),  # 7
    (8, TType.I64, 'updatedTimestamp', None, None, ),  # 8
    (9, TType.BOOL, 'flatSchema', None, None, ),  # 9
    (10, TType.LIST, 'labels', (TType.STRUCT, [koverse.thriftgen.ttypes.TLabel, None], False), None, ),  # 10
    (11, TType.LIST, 'records', (TType.STRUCT, [koverse.thriftgen.ttypes.TSimpleRecord, None], False), None, ),  # 11
    (12, TType.BOOL, 'recordMatchCountLimited', None, None, ),  # 12
    (13, TType.BOOL, 'successful', None, None, ),  # 13
    (14, TType.STRING, 'errorMessage', 'UTF8', None, ),  # 14
)
all_structs.append(TLabelResult)
TLabelResult.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'labelId', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.I64, 'dataSetCount', None, None, ),  # 3
)
all_structs.append(TSearchResults)
TSearchResults.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'dataSets', (TType.STRUCT, [TDataSetResult, None], False), None, ),  # 1
    (2, TType.LIST, 'labels', (TType.STRUCT, [TLabelResult, None], False), None, ),  # 2
)
all_structs.append(TRecentUserQuery)
TRecentUserQuery.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.I64, 'userId', None, None, ),  # 2
    (3, TType.STRING, 'query', 'UTF8', None, ),  # 3
    (4, TType.I64, 'timestamp', None, None, ),  # 4
)
fix_spec(all_structs)
del all_structs
