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

from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import logging
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class Iface:
  def autoSuggestByName(self, auth, query, dataSetNames):
    """
    Parameters:
     - auth
     - query
     - dataSetNames
    """
    pass

  def fieldAutoSuggest(self, auth, query, field, dataSetIds):
    """
    Parameters:
     - auth
     - query
     - field
     - dataSetIds
    """
    pass

  def luceneQuery(self, auth, query, dataSets, auths, numRecords, recordOffset, fieldsToReturn, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - dataSets
     - auths
     - numRecords
     - recordOffset
     - fieldsToReturn
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    pass

  def commonQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    pass

  def objectQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    pass

  def objectQueryByName(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    pass

  def readBytes(self, auth, dataSetId, recordId):
    """
    Parameters:
     - auth
     - dataSetId
     - recordId
    """
    pass

  def getRecord(self, auth, recordId, dataSetId):
    """
    Parameters:
     - auth
     - recordId
     - dataSetId
    """
    pass

  def aggregateQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    pass

  def search(self, auth, query, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    pass

  def searchDataSet(self, auth, query, dataSetId, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - dataSetId
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    pass

  def getRecentUserQueries(self, auth):
    """
    Parameters:
     - auth
    """
    pass

  def autoSuggest(self, auth, query, dataSetIds):
    """
    Parameters:
     - auth
     - query
     - dataSetIds
    """
    pass

  def autoSuggestDataSet(self, auth, query, dataSetId):
    """
    Parameters:
     - auth
     - query
     - dataSetId
    """
    pass

  def startDownloadSearchRecords(self, auth, dataSetId, query):
    """
    Parameters:
     - auth
     - dataSetId
     - query
    """
    pass

  def downloadMoreSearchRecords(self, auth, downloadId, maxToReturn):
    """
    Parameters:
     - auth
     - downloadId
     - maxToReturn
    """
    pass

  def stopDownloadSearchRecords(self, auth, downloadId):
    """
    Parameters:
     - auth
     - downloadId
    """
    pass

  def executeSql(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    pass

  def getCursor(self, auth, cursorId):
    """
    Parameters:
     - auth
     - cursorId
    """
    pass

  def fetchSqlResults(self, auth, cursorId, batchSize):
    """
    Parameters:
     - auth
     - cursorId
     - batchSize
    """
    pass


class Client(Iface):
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot is not None:
      self._oprot = oprot
    self._seqid = 0

  def autoSuggestByName(self, auth, query, dataSetNames):
    """
    Parameters:
     - auth
     - query
     - dataSetNames
    """
    self.send_autoSuggestByName(auth, query, dataSetNames)
    return self.recv_autoSuggestByName()

  def send_autoSuggestByName(self, auth, query, dataSetNames):
    self._oprot.writeMessageBegin('autoSuggestByName', TMessageType.CALL, self._seqid)
    args = autoSuggestByName_args()
    args.auth = auth
    args.query = query
    args.dataSetNames = dataSetNames
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_autoSuggestByName(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = autoSuggestByName_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "autoSuggestByName failed: unknown result")

  def fieldAutoSuggest(self, auth, query, field, dataSetIds):
    """
    Parameters:
     - auth
     - query
     - field
     - dataSetIds
    """
    self.send_fieldAutoSuggest(auth, query, field, dataSetIds)
    return self.recv_fieldAutoSuggest()

  def send_fieldAutoSuggest(self, auth, query, field, dataSetIds):
    self._oprot.writeMessageBegin('fieldAutoSuggest', TMessageType.CALL, self._seqid)
    args = fieldAutoSuggest_args()
    args.auth = auth
    args.query = query
    args.field = field
    args.dataSetIds = dataSetIds
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_fieldAutoSuggest(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = fieldAutoSuggest_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "fieldAutoSuggest failed: unknown result")

  def luceneQuery(self, auth, query, dataSets, auths, numRecords, recordOffset, fieldsToReturn, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - dataSets
     - auths
     - numRecords
     - recordOffset
     - fieldsToReturn
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    self.send_luceneQuery(auth, query, dataSets, auths, numRecords, recordOffset, fieldsToReturn, removeByteArrayFieldValues, maxStringValueLength)
    return self.recv_luceneQuery()

  def send_luceneQuery(self, auth, query, dataSets, auths, numRecords, recordOffset, fieldsToReturn, removeByteArrayFieldValues, maxStringValueLength):
    self._oprot.writeMessageBegin('luceneQuery', TMessageType.CALL, self._seqid)
    args = luceneQuery_args()
    args.auth = auth
    args.query = query
    args.dataSets = dataSets
    args.auths = auths
    args.numRecords = numRecords
    args.recordOffset = recordOffset
    args.fieldsToReturn = fieldsToReturn
    args.removeByteArrayFieldValues = removeByteArrayFieldValues
    args.maxStringValueLength = maxStringValueLength
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_luceneQuery(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = luceneQuery_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "luceneQuery failed: unknown result")

  def commonQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    self.send_commonQuery(auth, query)
    return self.recv_commonQuery()

  def send_commonQuery(self, auth, query):
    self._oprot.writeMessageBegin('commonQuery', TMessageType.CALL, self._seqid)
    args = commonQuery_args()
    args.auth = auth
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_commonQuery(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = commonQuery_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "commonQuery failed: unknown result")

  def objectQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    self.send_objectQuery(auth, query)
    return self.recv_objectQuery()

  def send_objectQuery(self, auth, query):
    self._oprot.writeMessageBegin('objectQuery', TMessageType.CALL, self._seqid)
    args = objectQuery_args()
    args.auth = auth
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_objectQuery(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = objectQuery_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "objectQuery failed: unknown result")

  def objectQueryByName(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    self.send_objectQueryByName(auth, query)
    return self.recv_objectQueryByName()

  def send_objectQueryByName(self, auth, query):
    self._oprot.writeMessageBegin('objectQueryByName', TMessageType.CALL, self._seqid)
    args = objectQueryByName_args()
    args.auth = auth
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_objectQueryByName(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = objectQueryByName_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "objectQueryByName failed: unknown result")

  def readBytes(self, auth, dataSetId, recordId):
    """
    Parameters:
     - auth
     - dataSetId
     - recordId
    """
    self.send_readBytes(auth, dataSetId, recordId)
    return self.recv_readBytes()

  def send_readBytes(self, auth, dataSetId, recordId):
    self._oprot.writeMessageBegin('readBytes', TMessageType.CALL, self._seqid)
    args = readBytes_args()
    args.auth = auth
    args.dataSetId = dataSetId
    args.recordId = recordId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_readBytes(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = readBytes_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "readBytes failed: unknown result")

  def getRecord(self, auth, recordId, dataSetId):
    """
    Parameters:
     - auth
     - recordId
     - dataSetId
    """
    self.send_getRecord(auth, recordId, dataSetId)
    return self.recv_getRecord()

  def send_getRecord(self, auth, recordId, dataSetId):
    self._oprot.writeMessageBegin('getRecord', TMessageType.CALL, self._seqid)
    args = getRecord_args()
    args.auth = auth
    args.recordId = recordId
    args.dataSetId = dataSetId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getRecord(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getRecord_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRecord failed: unknown result")

  def aggregateQuery(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    self.send_aggregateQuery(auth, query)
    return self.recv_aggregateQuery()

  def send_aggregateQuery(self, auth, query):
    self._oprot.writeMessageBegin('aggregateQuery', TMessageType.CALL, self._seqid)
    args = aggregateQuery_args()
    args.auth = auth
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_aggregateQuery(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = aggregateQuery_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "aggregateQuery failed: unknown result")

  def search(self, auth, query, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    self.send_search(auth, query, removeByteArrayFieldValues, maxStringValueLength)
    return self.recv_search()

  def send_search(self, auth, query, removeByteArrayFieldValues, maxStringValueLength):
    self._oprot.writeMessageBegin('search', TMessageType.CALL, self._seqid)
    args = search_args()
    args.auth = auth
    args.query = query
    args.removeByteArrayFieldValues = removeByteArrayFieldValues
    args.maxStringValueLength = maxStringValueLength
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_search(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = search_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    raise TApplicationException(TApplicationException.MISSING_RESULT, "search failed: unknown result")

  def searchDataSet(self, auth, query, dataSetId, removeByteArrayFieldValues, maxStringValueLength):
    """
    Parameters:
     - auth
     - query
     - dataSetId
     - removeByteArrayFieldValues
     - maxStringValueLength
    """
    self.send_searchDataSet(auth, query, dataSetId, removeByteArrayFieldValues, maxStringValueLength)
    return self.recv_searchDataSet()

  def send_searchDataSet(self, auth, query, dataSetId, removeByteArrayFieldValues, maxStringValueLength):
    self._oprot.writeMessageBegin('searchDataSet', TMessageType.CALL, self._seqid)
    args = searchDataSet_args()
    args.auth = auth
    args.query = query
    args.dataSetId = dataSetId
    args.removeByteArrayFieldValues = removeByteArrayFieldValues
    args.maxStringValueLength = maxStringValueLength
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_searchDataSet(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = searchDataSet_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.qee is not None:
      raise result.qee
    raise TApplicationException(TApplicationException.MISSING_RESULT, "searchDataSet failed: unknown result")

  def getRecentUserQueries(self, auth):
    """
    Parameters:
     - auth
    """
    self.send_getRecentUserQueries(auth)
    return self.recv_getRecentUserQueries()

  def send_getRecentUserQueries(self, auth):
    self._oprot.writeMessageBegin('getRecentUserQueries', TMessageType.CALL, self._seqid)
    args = getRecentUserQueries_args()
    args.auth = auth
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getRecentUserQueries(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getRecentUserQueries_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRecentUserQueries failed: unknown result")

  def autoSuggest(self, auth, query, dataSetIds):
    """
    Parameters:
     - auth
     - query
     - dataSetIds
    """
    self.send_autoSuggest(auth, query, dataSetIds)
    return self.recv_autoSuggest()

  def send_autoSuggest(self, auth, query, dataSetIds):
    self._oprot.writeMessageBegin('autoSuggest', TMessageType.CALL, self._seqid)
    args = autoSuggest_args()
    args.auth = auth
    args.query = query
    args.dataSetIds = dataSetIds
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_autoSuggest(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = autoSuggest_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    raise TApplicationException(TApplicationException.MISSING_RESULT, "autoSuggest failed: unknown result")

  def autoSuggestDataSet(self, auth, query, dataSetId):
    """
    Parameters:
     - auth
     - query
     - dataSetId
    """
    self.send_autoSuggestDataSet(auth, query, dataSetId)
    return self.recv_autoSuggestDataSet()

  def send_autoSuggestDataSet(self, auth, query, dataSetId):
    self._oprot.writeMessageBegin('autoSuggestDataSet', TMessageType.CALL, self._seqid)
    args = autoSuggestDataSet_args()
    args.auth = auth
    args.query = query
    args.dataSetId = dataSetId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_autoSuggestDataSet(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = autoSuggestDataSet_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    raise TApplicationException(TApplicationException.MISSING_RESULT, "autoSuggestDataSet failed: unknown result")

  def startDownloadSearchRecords(self, auth, dataSetId, query):
    """
    Parameters:
     - auth
     - dataSetId
     - query
    """
    self.send_startDownloadSearchRecords(auth, dataSetId, query)
    return self.recv_startDownloadSearchRecords()

  def send_startDownloadSearchRecords(self, auth, dataSetId, query):
    self._oprot.writeMessageBegin('startDownloadSearchRecords', TMessageType.CALL, self._seqid)
    args = startDownloadSearchRecords_args()
    args.auth = auth
    args.dataSetId = dataSetId
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_startDownloadSearchRecords(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = startDownloadSearchRecords_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "startDownloadSearchRecords failed: unknown result")

  def downloadMoreSearchRecords(self, auth, downloadId, maxToReturn):
    """
    Parameters:
     - auth
     - downloadId
     - maxToReturn
    """
    self.send_downloadMoreSearchRecords(auth, downloadId, maxToReturn)
    return self.recv_downloadMoreSearchRecords()

  def send_downloadMoreSearchRecords(self, auth, downloadId, maxToReturn):
    self._oprot.writeMessageBegin('downloadMoreSearchRecords', TMessageType.CALL, self._seqid)
    args = downloadMoreSearchRecords_args()
    args.auth = auth
    args.downloadId = downloadId
    args.maxToReturn = maxToReturn
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_downloadMoreSearchRecords(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = downloadMoreSearchRecords_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "downloadMoreSearchRecords failed: unknown result")

  def stopDownloadSearchRecords(self, auth, downloadId):
    """
    Parameters:
     - auth
     - downloadId
    """
    self.send_stopDownloadSearchRecords(auth, downloadId)
    self.recv_stopDownloadSearchRecords()

  def send_stopDownloadSearchRecords(self, auth, downloadId):
    self._oprot.writeMessageBegin('stopDownloadSearchRecords', TMessageType.CALL, self._seqid)
    args = stopDownloadSearchRecords_args()
    args.auth = auth
    args.downloadId = downloadId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_stopDownloadSearchRecords(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = stopDownloadSearchRecords_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    return

  def executeSql(self, auth, query):
    """
    Parameters:
     - auth
     - query
    """
    self.send_executeSql(auth, query)
    return self.recv_executeSql()

  def send_executeSql(self, auth, query):
    self._oprot.writeMessageBegin('executeSql', TMessageType.CALL, self._seqid)
    args = executeSql_args()
    args.auth = auth
    args.query = query
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_executeSql(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = executeSql_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "executeSql failed: unknown result")

  def getCursor(self, auth, cursorId):
    """
    Parameters:
     - auth
     - cursorId
    """
    self.send_getCursor(auth, cursorId)
    return self.recv_getCursor()

  def send_getCursor(self, auth, cursorId):
    self._oprot.writeMessageBegin('getCursor', TMessageType.CALL, self._seqid)
    args = getCursor_args()
    args.auth = auth
    args.cursorId = cursorId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCursor(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getCursor_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCursor failed: unknown result")

  def fetchSqlResults(self, auth, cursorId, batchSize):
    """
    Parameters:
     - auth
     - cursorId
     - batchSize
    """
    self.send_fetchSqlResults(auth, cursorId, batchSize)
    return self.recv_fetchSqlResults()

  def send_fetchSqlResults(self, auth, cursorId, batchSize):
    self._oprot.writeMessageBegin('fetchSqlResults', TMessageType.CALL, self._seqid)
    args = fetchSqlResults_args()
    args.auth = auth
    args.cursorId = cursorId
    args.batchSize = batchSize
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_fetchSqlResults(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = fetchSqlResults_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchSqlResults failed: unknown result")


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["autoSuggestByName"] = Processor.process_autoSuggestByName
    self._processMap["fieldAutoSuggest"] = Processor.process_fieldAutoSuggest
    self._processMap["luceneQuery"] = Processor.process_luceneQuery
    self._processMap["commonQuery"] = Processor.process_commonQuery
    self._processMap["objectQuery"] = Processor.process_objectQuery
    self._processMap["objectQueryByName"] = Processor.process_objectQueryByName
    self._processMap["readBytes"] = Processor.process_readBytes
    self._processMap["getRecord"] = Processor.process_getRecord
    self._processMap["aggregateQuery"] = Processor.process_aggregateQuery
    self._processMap["search"] = Processor.process_search
    self._processMap["searchDataSet"] = Processor.process_searchDataSet
    self._processMap["getRecentUserQueries"] = Processor.process_getRecentUserQueries
    self._processMap["autoSuggest"] = Processor.process_autoSuggest
    self._processMap["autoSuggestDataSet"] = Processor.process_autoSuggestDataSet
    self._processMap["startDownloadSearchRecords"] = Processor.process_startDownloadSearchRecords
    self._processMap["downloadMoreSearchRecords"] = Processor.process_downloadMoreSearchRecords
    self._processMap["stopDownloadSearchRecords"] = Processor.process_stopDownloadSearchRecords
    self._processMap["executeSql"] = Processor.process_executeSql
    self._processMap["getCursor"] = Processor.process_getCursor
    self._processMap["fetchSqlResults"] = Processor.process_fetchSqlResults

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_autoSuggestByName(self, seqid, iprot, oprot):
    args = autoSuggestByName_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = autoSuggestByName_result()
    try:
      result.success = self._handler.autoSuggestByName(args.auth, args.query, args.dataSetNames)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("autoSuggestByName", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_fieldAutoSuggest(self, seqid, iprot, oprot):
    args = fieldAutoSuggest_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = fieldAutoSuggest_result()
    try:
      result.success = self._handler.fieldAutoSuggest(args.auth, args.query, args.field, args.dataSetIds)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("fieldAutoSuggest", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_luceneQuery(self, seqid, iprot, oprot):
    args = luceneQuery_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = luceneQuery_result()
    try:
      result.success = self._handler.luceneQuery(args.auth, args.query, args.dataSets, args.auths, args.numRecords, args.recordOffset, args.fieldsToReturn, args.removeByteArrayFieldValues, args.maxStringValueLength)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("luceneQuery", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_commonQuery(self, seqid, iprot, oprot):
    args = commonQuery_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = commonQuery_result()
    try:
      result.success = self._handler.commonQuery(args.auth, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("commonQuery", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_objectQuery(self, seqid, iprot, oprot):
    args = objectQuery_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = objectQuery_result()
    try:
      result.success = self._handler.objectQuery(args.auth, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("objectQuery", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_objectQueryByName(self, seqid, iprot, oprot):
    args = objectQueryByName_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = objectQueryByName_result()
    try:
      result.success = self._handler.objectQueryByName(args.auth, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("objectQueryByName", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_readBytes(self, seqid, iprot, oprot):
    args = readBytes_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = readBytes_result()
    try:
      result.success = self._handler.readBytes(args.auth, args.dataSetId, args.recordId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("readBytes", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getRecord(self, seqid, iprot, oprot):
    args = getRecord_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getRecord_result()
    try:
      result.success = self._handler.getRecord(args.auth, args.recordId, args.dataSetId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getRecord", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_aggregateQuery(self, seqid, iprot, oprot):
    args = aggregateQuery_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = aggregateQuery_result()
    try:
      result.success = self._handler.aggregateQuery(args.auth, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("aggregateQuery", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_search(self, seqid, iprot, oprot):
    args = search_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = search_result()
    try:
      result.success = self._handler.search(args.auth, args.query, args.removeByteArrayFieldValues, args.maxStringValueLength)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("search", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_searchDataSet(self, seqid, iprot, oprot):
    args = searchDataSet_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = searchDataSet_result()
    try:
      result.success = self._handler.searchDataSet(args.auth, args.query, args.dataSetId, args.removeByteArrayFieldValues, args.maxStringValueLength)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except TQueryErrorException as qee:
      msg_type = TMessageType.REPLY
      result.qee = qee
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("searchDataSet", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getRecentUserQueries(self, seqid, iprot, oprot):
    args = getRecentUserQueries_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getRecentUserQueries_result()
    try:
      result.success = self._handler.getRecentUserQueries(args.auth)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getRecentUserQueries", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_autoSuggest(self, seqid, iprot, oprot):
    args = autoSuggest_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = autoSuggest_result()
    try:
      result.success = self._handler.autoSuggest(args.auth, args.query, args.dataSetIds)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("autoSuggest", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_autoSuggestDataSet(self, seqid, iprot, oprot):
    args = autoSuggestDataSet_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = autoSuggestDataSet_result()
    try:
      result.success = self._handler.autoSuggestDataSet(args.auth, args.query, args.dataSetId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("autoSuggestDataSet", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_startDownloadSearchRecords(self, seqid, iprot, oprot):
    args = startDownloadSearchRecords_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = startDownloadSearchRecords_result()
    try:
      result.success = self._handler.startDownloadSearchRecords(args.auth, args.dataSetId, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("startDownloadSearchRecords", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_downloadMoreSearchRecords(self, seqid, iprot, oprot):
    args = downloadMoreSearchRecords_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = downloadMoreSearchRecords_result()
    try:
      result.success = self._handler.downloadMoreSearchRecords(args.auth, args.downloadId, args.maxToReturn)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("downloadMoreSearchRecords", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_stopDownloadSearchRecords(self, seqid, iprot, oprot):
    args = stopDownloadSearchRecords_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = stopDownloadSearchRecords_result()
    try:
      self._handler.stopDownloadSearchRecords(args.auth, args.downloadId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("stopDownloadSearchRecords", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_executeSql(self, seqid, iprot, oprot):
    args = executeSql_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = executeSql_result()
    try:
      result.success = self._handler.executeSql(args.auth, args.query)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("executeSql", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCursor(self, seqid, iprot, oprot):
    args = getCursor_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCursor_result()
    try:
      result.success = self._handler.getCursor(args.auth, args.cursorId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getCursor", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_fetchSqlResults(self, seqid, iprot, oprot):
    args = fetchSqlResults_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = fetchSqlResults_result()
    try:
      result.success = self._handler.fetchSqlResults(args.auth, args.cursorId, args.batchSize)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("fetchSqlResults", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class autoSuggestByName_args:
  """
  Attributes:
   - auth
   - query
   - dataSetNames
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.LIST, 'dataSetNames', (TType.STRING,None), None, ), # 3
  )

  def __init__(self, auth=None, query=None, dataSetNames=None,):
    self.auth = auth
    self.query = query
    self.dataSetNames = dataSetNames

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.dataSetNames = []
          (_etype59, _size56) = iprot.readListBegin()
          for _i60 in xrange(_size56):
            _elem61 = iprot.readString()
            self.dataSetNames.append(_elem61)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggestByName_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.dataSetNames is not None:
      oprot.writeFieldBegin('dataSetNames', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.dataSetNames))
      for iter62 in self.dataSetNames:
        oprot.writeString(iter62)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.dataSetNames)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 autoSuggestByName_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TSuggestion, TSuggestion.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype66, _size63) = iprot.readListBegin()
          for _i67 in xrange(_size63):
            _elem68 = TSuggestion()
            _elem68.read(iprot)
            self.success.append(_elem68)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggestByName_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter69 in self.success:
        iter69.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 fieldAutoSuggest_args:
  """
  Attributes:
   - auth
   - query
   - field
   - dataSetIds
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.STRING, 'field', None, None, ), # 3
    (4, TType.LIST, 'dataSetIds', (TType.STRING,None), None, ), # 4
  )

  def __init__(self, auth=None, query=None, field=None, dataSetIds=None,):
    self.auth = auth
    self.query = query
    self.field = field
    self.dataSetIds = dataSetIds

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.field = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.dataSetIds = []
          (_etype73, _size70) = iprot.readListBegin()
          for _i74 in xrange(_size70):
            _elem75 = iprot.readString()
            self.dataSetIds.append(_elem75)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('fieldAutoSuggest_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.field is not None:
      oprot.writeFieldBegin('field', TType.STRING, 3)
      oprot.writeString(self.field)
      oprot.writeFieldEnd()
    if self.dataSetIds is not None:
      oprot.writeFieldBegin('dataSetIds', TType.LIST, 4)
      oprot.writeListBegin(TType.STRING, len(self.dataSetIds))
      for iter76 in self.dataSetIds:
        oprot.writeString(iter76)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.field)
    value = (value * 31) ^ hash(self.dataSetIds)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 fieldAutoSuggest_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TSuggestion, TSuggestion.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype80, _size77) = iprot.readListBegin()
          for _i81 in xrange(_size77):
            _elem82 = TSuggestion()
            _elem82.read(iprot)
            self.success.append(_elem82)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('fieldAutoSuggest_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter83 in self.success:
        iter83.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 luceneQuery_args:
  """
  Attributes:
   - auth
   - query
   - dataSets
   - auths
   - numRecords
   - recordOffset
   - fieldsToReturn
   - removeByteArrayFieldValues
   - maxStringValueLength
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.LIST, 'dataSets', (TType.STRING,None), None, ), # 3
    (4, TType.LIST, 'auths', (TType.STRING,None), None, ), # 4
    (5, TType.I32, 'numRecords', None, None, ), # 5
    (6, TType.I64, 'recordOffset', None, None, ), # 6
    (7, TType.LIST, 'fieldsToReturn', (TType.STRING,None), None, ), # 7
    (8, TType.BOOL, 'removeByteArrayFieldValues', None, None, ), # 8
    (9, TType.I32, 'maxStringValueLength', None, None, ), # 9
  )

  def __init__(self, auth=None, query=None, dataSets=None, auths=None, numRecords=None, recordOffset=None, fieldsToReturn=None, removeByteArrayFieldValues=None, maxStringValueLength=None,):
    self.auth = auth
    self.query = query
    self.dataSets = dataSets
    self.auths = auths
    self.numRecords = numRecords
    self.recordOffset = recordOffset
    self.fieldsToReturn = fieldsToReturn
    self.removeByteArrayFieldValues = removeByteArrayFieldValues
    self.maxStringValueLength = maxStringValueLength

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.dataSets = []
          (_etype87, _size84) = iprot.readListBegin()
          for _i88 in xrange(_size84):
            _elem89 = iprot.readString()
            self.dataSets.append(_elem89)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.auths = []
          (_etype93, _size90) = iprot.readListBegin()
          for _i94 in xrange(_size90):
            _elem95 = iprot.readString()
            self.auths.append(_elem95)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.numRecords = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.recordOffset = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.LIST:
          self.fieldsToReturn = []
          (_etype99, _size96) = iprot.readListBegin()
          for _i100 in xrange(_size96):
            _elem101 = iprot.readString()
            self.fieldsToReturn.append(_elem101)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.BOOL:
          self.removeByteArrayFieldValues = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I32:
          self.maxStringValueLength = iprot.readI32()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('luceneQuery_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.dataSets is not None:
      oprot.writeFieldBegin('dataSets', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.dataSets))
      for iter102 in self.dataSets:
        oprot.writeString(iter102)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.auths is not None:
      oprot.writeFieldBegin('auths', TType.LIST, 4)
      oprot.writeListBegin(TType.STRING, len(self.auths))
      for iter103 in self.auths:
        oprot.writeString(iter103)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.numRecords is not None:
      oprot.writeFieldBegin('numRecords', TType.I32, 5)
      oprot.writeI32(self.numRecords)
      oprot.writeFieldEnd()
    if self.recordOffset is not None:
      oprot.writeFieldBegin('recordOffset', TType.I64, 6)
      oprot.writeI64(self.recordOffset)
      oprot.writeFieldEnd()
    if self.fieldsToReturn is not None:
      oprot.writeFieldBegin('fieldsToReturn', TType.LIST, 7)
      oprot.writeListBegin(TType.STRING, len(self.fieldsToReturn))
      for iter104 in self.fieldsToReturn:
        oprot.writeString(iter104)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.removeByteArrayFieldValues is not None:
      oprot.writeFieldBegin('removeByteArrayFieldValues', TType.BOOL, 8)
      oprot.writeBool(self.removeByteArrayFieldValues)
      oprot.writeFieldEnd()
    if self.maxStringValueLength is not None:
      oprot.writeFieldBegin('maxStringValueLength', TType.I32, 9)
      oprot.writeI32(self.maxStringValueLength)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.dataSets)
    value = (value * 31) ^ hash(self.auths)
    value = (value * 31) ^ hash(self.numRecords)
    value = (value * 31) ^ hash(self.recordOffset)
    value = (value * 31) ^ hash(self.fieldsToReturn)
    value = (value * 31) ^ hash(self.removeByteArrayFieldValues)
    value = (value * 31) ^ hash(self.maxStringValueLength)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 luceneQuery_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TDataSetResult, TDataSetResult.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype108, _size105) = iprot.readListBegin()
          for _i109 in xrange(_size105):
            _elem110 = TDataSetResult()
            _elem110.read(iprot)
            self.success.append(_elem110)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('luceneQuery_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter111 in self.success:
        iter111.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 commonQuery_args:
  """
  Attributes:
   - auth
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
  )

  def __init__(self, auth=None, query=None,):
    self.auth = auth
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('commonQuery_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 commonQuery_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TDataSetResult, TDataSetResult.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype115, _size112) = iprot.readListBegin()
          for _i116 in xrange(_size112):
            _elem117 = TDataSetResult()
            _elem117.read(iprot)
            self.success.append(_elem117)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('commonQuery_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter118 in self.success:
        iter118.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 objectQuery_args:
  """
  Attributes:
   - auth
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
  )

  def __init__(self, auth=None, query=None,):
    self.auth = auth
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('objectQuery_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 objectQuery_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TDataSetResult, TDataSetResult.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype122, _size119) = iprot.readListBegin()
          for _i123 in xrange(_size119):
            _elem124 = TDataSetResult()
            _elem124.read(iprot)
            self.success.append(_elem124)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('objectQuery_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter125 in self.success:
        iter125.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 objectQueryByName_args:
  """
  Attributes:
   - auth
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
  )

  def __init__(self, auth=None, query=None,):
    self.auth = auth
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('objectQueryByName_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 objectQueryByName_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TDataSetResult, TDataSetResult.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype129, _size126) = iprot.readListBegin()
          for _i130 in xrange(_size126):
            _elem131 = TDataSetResult()
            _elem131.read(iprot)
            self.success.append(_elem131)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('objectQueryByName_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter132 in self.success:
        iter132.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 readBytes_args:
  """
  Attributes:
   - auth
   - dataSetId
   - recordId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'dataSetId', None, None, ), # 2
    (3, TType.STRING, 'recordId', None, None, ), # 3
  )

  def __init__(self, auth=None, dataSetId=None, recordId=None,):
    self.auth = auth
    self.dataSetId = dataSetId
    self.recordId = recordId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.dataSetId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.recordId = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('readBytes_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.dataSetId is not None:
      oprot.writeFieldBegin('dataSetId', TType.STRING, 2)
      oprot.writeString(self.dataSetId)
      oprot.writeFieldEnd()
    if self.recordId is not None:
      oprot.writeFieldBegin('recordId', TType.STRING, 3)
      oprot.writeString(self.recordId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.dataSetId)
    value = (value * 31) ^ hash(self.recordId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 readBytes_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TMimeValue, TMimeValue.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TMimeValue()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('readBytes_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getRecord_args:
  """
  Attributes:
   - auth
   - recordId
   - dataSetId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'recordId', None, None, ), # 2
    (3, TType.STRING, 'dataSetId', None, None, ), # 3
  )

  def __init__(self, auth=None, recordId=None, dataSetId=None,):
    self.auth = auth
    self.recordId = recordId
    self.dataSetId = dataSetId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.recordId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.dataSetId = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRecord_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.recordId is not None:
      oprot.writeFieldBegin('recordId', TType.STRING, 2)
      oprot.writeString(self.recordId)
      oprot.writeFieldEnd()
    if self.dataSetId is not None:
      oprot.writeFieldBegin('dataSetId', TType.STRING, 3)
      oprot.writeString(self.dataSetId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.recordId)
    value = (value * 31) ^ hash(self.dataSetId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getRecord_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (koverse.thriftgen.ttypes.TSimpleRecord, koverse.thriftgen.ttypes.TSimpleRecord.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = koverse.thriftgen.ttypes.TSimpleRecord()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRecord_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 aggregateQuery_args:
  """
  Attributes:
   - auth
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'query', (TAggregateQuery, TAggregateQuery.thrift_spec), None, ), # 2
  )

  def __init__(self, auth=None, query=None,):
    self.auth = auth
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.query = TAggregateQuery()
          self.query.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('aggregateQuery_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRUCT, 2)
      self.query.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 aggregateQuery_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TAggregateQueryResult, TAggregateQueryResult.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 4
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TAggregateQueryResult()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('aggregateQuery_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 4)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 search_args:
  """
  Attributes:
   - auth
   - query
   - removeByteArrayFieldValues
   - maxStringValueLength
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.BOOL, 'removeByteArrayFieldValues', None, None, ), # 3
    (4, TType.I32, 'maxStringValueLength', None, None, ), # 4
  )

  def __init__(self, auth=None, query=None, removeByteArrayFieldValues=None, maxStringValueLength=None,):
    self.auth = auth
    self.query = query
    self.removeByteArrayFieldValues = removeByteArrayFieldValues
    self.maxStringValueLength = maxStringValueLength

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.removeByteArrayFieldValues = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.maxStringValueLength = iprot.readI32()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('search_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.removeByteArrayFieldValues is not None:
      oprot.writeFieldBegin('removeByteArrayFieldValues', TType.BOOL, 3)
      oprot.writeBool(self.removeByteArrayFieldValues)
      oprot.writeFieldEnd()
    if self.maxStringValueLength is not None:
      oprot.writeFieldBegin('maxStringValueLength', TType.I32, 4)
      oprot.writeI32(self.maxStringValueLength)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.removeByteArrayFieldValues)
    value = (value * 31) ^ hash(self.maxStringValueLength)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 search_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TSearchResults, TSearchResults.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TSearchResults()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('search_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 searchDataSet_args:
  """
  Attributes:
   - auth
   - query
   - dataSetId
   - removeByteArrayFieldValues
   - maxStringValueLength
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.STRING, 'dataSetId', None, None, ), # 3
    (4, TType.BOOL, 'removeByteArrayFieldValues', None, None, ), # 4
    (5, TType.I32, 'maxStringValueLength', None, None, ), # 5
  )

  def __init__(self, auth=None, query=None, dataSetId=None, removeByteArrayFieldValues=None, maxStringValueLength=None,):
    self.auth = auth
    self.query = query
    self.dataSetId = dataSetId
    self.removeByteArrayFieldValues = removeByteArrayFieldValues
    self.maxStringValueLength = maxStringValueLength

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.dataSetId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.BOOL:
          self.removeByteArrayFieldValues = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.maxStringValueLength = iprot.readI32()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('searchDataSet_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.dataSetId is not None:
      oprot.writeFieldBegin('dataSetId', TType.STRING, 3)
      oprot.writeString(self.dataSetId)
      oprot.writeFieldEnd()
    if self.removeByteArrayFieldValues is not None:
      oprot.writeFieldBegin('removeByteArrayFieldValues', TType.BOOL, 4)
      oprot.writeBool(self.removeByteArrayFieldValues)
      oprot.writeFieldEnd()
    if self.maxStringValueLength is not None:
      oprot.writeFieldBegin('maxStringValueLength', TType.I32, 5)
      oprot.writeI32(self.maxStringValueLength)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.dataSetId)
    value = (value * 31) ^ hash(self.removeByteArrayFieldValues)
    value = (value * 31) ^ hash(self.maxStringValueLength)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 searchDataSet_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - qee
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TDataSetResult, TDataSetResult.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'qee', (TQueryErrorException, TQueryErrorException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, qee=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.qee = qee

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TDataSetResult()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.qee = TQueryErrorException()
          self.qee.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('searchDataSet_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.qee is not None:
      oprot.writeFieldBegin('qee', TType.STRUCT, 3)
      self.qee.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.qee)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getRecentUserQueries_args:
  """
  Attributes:
   - auth
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
  )

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

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRecentUserQueries_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getRecentUserQueries_result:
  """
  Attributes:
   - success
   - ke
   - ae
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TRecentUserQuery, TRecentUserQuery.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
  )

  def __init__(self, success=None, ke=None, ae=None,):
    self.success = success
    self.ke = ke
    self.ae = ae

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype136, _size133) = iprot.readListBegin()
          for _i137 in xrange(_size133):
            _elem138 = TRecentUserQuery()
            _elem138.read(iprot)
            self.success.append(_elem138)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRecentUserQueries_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter139 in self.success:
        iter139.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 autoSuggest_args:
  """
  Attributes:
   - auth
   - query
   - dataSetIds
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.LIST, 'dataSetIds', (TType.STRING,None), None, ), # 3
  )

  def __init__(self, auth=None, query=None, dataSetIds=None,):
    self.auth = auth
    self.query = query
    self.dataSetIds = dataSetIds

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.dataSetIds = []
          (_etype143, _size140) = iprot.readListBegin()
          for _i144 in xrange(_size140):
            _elem145 = iprot.readString()
            self.dataSetIds.append(_elem145)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggest_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.dataSetIds is not None:
      oprot.writeFieldBegin('dataSetIds', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.dataSetIds))
      for iter146 in self.dataSetIds:
        oprot.writeString(iter146)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.dataSetIds)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 autoSuggest_result:
  """
  Attributes:
   - success
   - ke
   - ae
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TSuggestion, TSuggestion.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
  )

  def __init__(self, success=None, ke=None, ae=None,):
    self.success = success
    self.ke = ke
    self.ae = ae

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype150, _size147) = iprot.readListBegin()
          for _i151 in xrange(_size147):
            _elem152 = TSuggestion()
            _elem152.read(iprot)
            self.success.append(_elem152)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggest_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter153 in self.success:
        iter153.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 autoSuggestDataSet_args:
  """
  Attributes:
   - auth
   - query
   - dataSetId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
    (3, TType.STRING, 'dataSetId', None, None, ), # 3
  )

  def __init__(self, auth=None, query=None, dataSetId=None,):
    self.auth = auth
    self.query = query
    self.dataSetId = dataSetId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.dataSetId = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggestDataSet_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    if self.dataSetId is not None:
      oprot.writeFieldBegin('dataSetId', TType.STRING, 3)
      oprot.writeString(self.dataSetId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    value = (value * 31) ^ hash(self.dataSetId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 autoSuggestDataSet_result:
  """
  Attributes:
   - success
   - ke
   - ae
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TSuggestion, TSuggestion.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
  )

  def __init__(self, success=None, ke=None, ae=None,):
    self.success = success
    self.ke = ke
    self.ae = ae

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype157, _size154) = iprot.readListBegin()
          for _i158 in xrange(_size154):
            _elem159 = TSuggestion()
            _elem159.read(iprot)
            self.success.append(_elem159)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('autoSuggestDataSet_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter160 in self.success:
        iter160.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 startDownloadSearchRecords_args:
  """
  Attributes:
   - auth
   - dataSetId
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'dataSetId', None, None, ), # 2
    (3, TType.STRING, 'query', None, None, ), # 3
  )

  def __init__(self, auth=None, dataSetId=None, query=None,):
    self.auth = auth
    self.dataSetId = dataSetId
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.dataSetId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('startDownloadSearchRecords_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.dataSetId is not None:
      oprot.writeFieldBegin('dataSetId', TType.STRING, 2)
      oprot.writeString(self.dataSetId)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 3)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.dataSetId)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 startDownloadSearchRecords_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRING, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRING:
          self.success = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('startDownloadSearchRecords_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRING, 0)
      oprot.writeString(self.success)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 downloadMoreSearchRecords_args:
  """
  Attributes:
   - auth
   - downloadId
   - maxToReturn
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'downloadId', None, None, ), # 2
    (3, TType.I16, 'maxToReturn', None, None, ), # 3
  )

  def __init__(self, auth=None, downloadId=None, maxToReturn=None,):
    self.auth = auth
    self.downloadId = downloadId
    self.maxToReturn = maxToReturn

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.downloadId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I16:
          self.maxToReturn = iprot.readI16()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('downloadMoreSearchRecords_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.downloadId is not None:
      oprot.writeFieldBegin('downloadId', TType.STRING, 2)
      oprot.writeString(self.downloadId)
      oprot.writeFieldEnd()
    if self.maxToReturn is not None:
      oprot.writeFieldBegin('maxToReturn', TType.I16, 3)
      oprot.writeI16(self.maxToReturn)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.downloadId)
    value = (value * 31) ^ hash(self.maxToReturn)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 downloadMoreSearchRecords_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (koverse.thriftgen.ttypes.TDownloadRecords, koverse.thriftgen.ttypes.TDownloadRecords.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = koverse.thriftgen.ttypes.TDownloadRecords()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('downloadMoreSearchRecords_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 stopDownloadSearchRecords_args:
  """
  Attributes:
   - auth
   - downloadId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'downloadId', None, None, ), # 2
  )

  def __init__(self, auth=None, downloadId=None,):
    self.auth = auth
    self.downloadId = downloadId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.downloadId = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('stopDownloadSearchRecords_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.downloadId is not None:
      oprot.writeFieldBegin('downloadId', TType.STRING, 2)
      oprot.writeString(self.downloadId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.downloadId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 stopDownloadSearchRecords_result:
  """
  Attributes:
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, ke=None, ae=None, ce=None,):
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('stopDownloadSearchRecords_result')
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 executeSql_args:
  """
  Attributes:
   - auth
   - query
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRING, 'query', None, None, ), # 2
  )

  def __init__(self, auth=None, query=None,):
    self.auth = auth
    self.query = query

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.query = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('executeSql_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.query is not None:
      oprot.writeFieldBegin('query', TType.STRING, 2)
      oprot.writeString(self.query)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.query)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 executeSql_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('executeSql_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getCursor_args:
  """
  Attributes:
   - auth
   - cursorId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.I64, 'cursorId', None, None, ), # 2
  )

  def __init__(self, auth=None, cursorId=None,):
    self.auth = auth
    self.cursorId = cursorId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.cursorId = iprot.readI64()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCursor_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.cursorId is not None:
      oprot.writeFieldBegin('cursorId', TType.I64, 2)
      oprot.writeI64(self.cursorId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.cursorId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 getCursor_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TSqlCursor, TSqlCursor.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TSqlCursor()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCursor_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 fetchSqlResults_args:
  """
  Attributes:
   - auth
   - cursorId
   - batchSize
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'auth', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.I64, 'cursorId', None, None, ), # 2
    (3, TType.I32, 'batchSize', None, None, ), # 3
  )

  def __init__(self, auth=None, cursorId=None, batchSize=None,):
    self.auth = auth
    self.cursorId = cursorId
    self.batchSize = batchSize

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (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.auth = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.auth.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.cursorId = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.batchSize = iprot.readI32()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('fetchSqlResults_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.cursorId is not None:
      oprot.writeFieldBegin('cursorId', TType.I64, 2)
      oprot.writeI64(self.cursorId)
      oprot.writeFieldEnd()
    if self.batchSize is not None:
      oprot.writeFieldBegin('batchSize', TType.I32, 3)
      oprot.writeI32(self.batchSize)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.auth)
    value = (value * 31) ^ hash(self.cursorId)
    value = (value * 31) ^ hash(self.batchSize)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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 fetchSqlResults_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TSqlResults, TSqlResults.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = TSqlResults()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('fetchSqlResults_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    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)
