#
# 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 storeImportSample(self, auth, sample, importFlowId):
    """
    Parameters:
     - auth
     - sample
     - importFlowId
    """
    pass

  def updateImportState(self, auth, importFlowId, key, values, operator):
    """
    Parameters:
     - auth
     - importFlowId
     - key
     - values
     - operator
    """
    pass

  def getImportState(self, auth, importFlowId, key):
    """
    Parameters:
     - auth
     - importFlowId
     - key
    """
    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 storeImportSample(self, auth, sample, importFlowId):
    """
    Parameters:
     - auth
     - sample
     - importFlowId
    """
    self.send_storeImportSample(auth, sample, importFlowId)
    self.recv_storeImportSample()

  def send_storeImportSample(self, auth, sample, importFlowId):
    self._oprot.writeMessageBegin('storeImportSample', TMessageType.CALL, self._seqid)
    args = storeImportSample_args()
    args.auth = auth
    args.sample = sample
    args.importFlowId = importFlowId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_storeImportSample(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = storeImportSample_result()
    result.read(iprot)
    iprot.readMessageEnd()
    return

  def updateImportState(self, auth, importFlowId, key, values, operator):
    """
    Parameters:
     - auth
     - importFlowId
     - key
     - values
     - operator
    """
    self.send_updateImportState(auth, importFlowId, key, values, operator)
    self.recv_updateImportState()

  def send_updateImportState(self, auth, importFlowId, key, values, operator):
    self._oprot.writeMessageBegin('updateImportState', TMessageType.CALL, self._seqid)
    args = updateImportState_args()
    args.auth = auth
    args.importFlowId = importFlowId
    args.key = key
    args.values = values
    args.operator = operator
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def getImportState(self, auth, importFlowId, key):
    """
    Parameters:
     - auth
     - importFlowId
     - key
    """
    self.send_getImportState(auth, importFlowId, key)
    return self.recv_getImportState()

  def send_getImportState(self, auth, importFlowId, key):
    self._oprot.writeMessageBegin('getImportState', TMessageType.CALL, self._seqid)
    args = getImportState_args()
    args.auth = auth
    args.importFlowId = importFlowId
    args.key = key
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getImportState(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getImportState_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, "getImportState failed: unknown result")


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["storeImportSample"] = Processor.process_storeImportSample
    self._processMap["updateImportState"] = Processor.process_updateImportState
    self._processMap["getImportState"] = Processor.process_getImportState

  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_storeImportSample(self, seqid, iprot, oprot):
    args = storeImportSample_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = storeImportSample_result()
    try:
      self._handler.storeImportSample(args.auth, args.sample, args.importFlowId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("storeImportSample", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateImportState(self, seqid, iprot, oprot):
    args = updateImportState_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateImportState_result()
    try:
      self._handler.updateImportState(args.auth, args.importFlowId, args.key, args.values, args.operator)
      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("updateImportState", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getImportState(self, seqid, iprot, oprot):
    args = getImportState_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getImportState_result()
    try:
      result.success = self._handler.getImportState(args.auth, args.importFlowId, args.key)
      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("getImportState", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class storeImportSample_args:
  """
  Attributes:
   - auth
   - sample
   - importFlowId
  """

  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, 'sample', (koverse.thriftgen.dataflow.ttypes.TImportSample, koverse.thriftgen.dataflow.ttypes.TImportSample.thrift_spec), None, ), # 2
    (3, TType.I64, 'importFlowId', None, None, ), # 3
  )

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

  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.sample = koverse.thriftgen.dataflow.ttypes.TImportSample()
          self.sample.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.importFlowId = 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('storeImportSample_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.sample is not None:
      oprot.writeFieldBegin('sample', TType.STRUCT, 2)
      self.sample.write(oprot)
      oprot.writeFieldEnd()
    if self.importFlowId is not None:
      oprot.writeFieldBegin('importFlowId', TType.I64, 3)
      oprot.writeI64(self.importFlowId)
      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.sample)
    value = (value * 31) ^ hash(self.importFlowId)
    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 storeImportSample_result:

  thrift_spec = (
  )

  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
      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('storeImportSample_result')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    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 updateImportState_args:
  """
  Attributes:
   - auth
   - importFlowId
   - key
   - values
   - operator
  """

  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, 'importFlowId', None, None, ), # 2
    (3, TType.STRING, 'key', None, None, ), # 3
    (4, TType.LIST, 'values', (TType.STRING,None), None, ), # 4
    (5, TType.STRING, 'operator', None, None, ), # 5
  )

  def __init__(self, auth=None, importFlowId=None, key=None, values=None, operator=None,):
    self.auth = auth
    self.importFlowId = importFlowId
    self.key = key
    self.values = values
    self.operator = operator

  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.importFlowId = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.key = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.values = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = iprot.readString()
            self.values.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.operator = 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('updateImportState_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.importFlowId is not None:
      oprot.writeFieldBegin('importFlowId', TType.I64, 2)
      oprot.writeI64(self.importFlowId)
      oprot.writeFieldEnd()
    if self.key is not None:
      oprot.writeFieldBegin('key', TType.STRING, 3)
      oprot.writeString(self.key)
      oprot.writeFieldEnd()
    if self.values is not None:
      oprot.writeFieldBegin('values', TType.LIST, 4)
      oprot.writeListBegin(TType.STRING, len(self.values))
      for iter6 in self.values:
        oprot.writeString(iter6)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.operator is not None:
      oprot.writeFieldBegin('operator', TType.STRING, 5)
      oprot.writeString(self.operator)
      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.importFlowId)
    value = (value * 31) ^ hash(self.key)
    value = (value * 31) ^ hash(self.values)
    value = (value * 31) ^ hash(self.operator)
    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 updateImportState_result:
  """
  Attributes:
   - ke
   - ae
  """

  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, ke=None, ae=None,):
    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 == 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('updateImportState_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()
    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)
    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 getImportState_args:
  """
  Attributes:
   - auth
   - importFlowId
   - key
  """

  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, 'importFlowId', None, None, ), # 2
    (3, TType.STRING, 'key', None, None, ), # 3
  )

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

  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.importFlowId = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.key = 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('getImportState_args')
    if self.auth is not None:
      oprot.writeFieldBegin('auth', TType.STRUCT, 1)
      self.auth.write(oprot)
      oprot.writeFieldEnd()
    if self.importFlowId is not None:
      oprot.writeFieldBegin('importFlowId', TType.I64, 2)
      oprot.writeI64(self.importFlowId)
      oprot.writeFieldEnd()
    if self.key is not None:
      oprot.writeFieldBegin('key', TType.STRING, 3)
      oprot.writeString(self.key)
      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.importFlowId)
    value = (value * 31) ^ hash(self.key)
    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 getImportState_result:
  """
  Attributes:
   - success
   - ke
   - ae
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRING,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
  )

  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 = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in xrange(_size7):
            _elem12 = iprot.readString()
            self.success.append(_elem12)
          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('getImportState_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRING, len(self.success))
      for iter13 in self.success:
        oprot.writeString(iter13)
      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)
