#
# Autogenerated by Thrift Compiler (0.9.1)
#
# 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

from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class TValueType:
  STRING = 1
  LONG = 2
  DOUBLE = 3
  DATE = 4
  URL = 5
  IPADDRESS = 6
  GEO = 7
  LIST = 8
  MAP = 9
  BYTES = 10
  BOOLEAN = 11

  _VALUES_TO_NAMES = {
    1: "STRING",
    2: "LONG",
    3: "DOUBLE",
    4: "DATE",
    5: "URL",
    6: "IPADDRESS",
    7: "GEO",
    8: "LIST",
    9: "MAP",
    10: "BYTES",
    11: "BOOLEAN",
  }

  _NAMES_TO_VALUES = {
    "STRING": 1,
    "LONG": 2,
    "DOUBLE": 3,
    "DATE": 4,
    "URL": 5,
    "IPADDRESS": 6,
    "GEO": 7,
    "LIST": 8,
    "MAP": 9,
    "BYTES": 10,
    "BOOLEAN": 11,
  }

class TConfigValueType:
  STRING = 0
  DOUBLE = 1
  LONG = 2
  STRING_LIST = 3
  DOUBLE_LIST = 4
  LONG_LIST = 5

  _VALUES_TO_NAMES = {
    0: "STRING",
    1: "DOUBLE",
    2: "LONG",
    3: "STRING_LIST",
    4: "DOUBLE_LIST",
    5: "LONG_LIST",
  }

  _NAMES_TO_VALUES = {
    "STRING": 0,
    "DOUBLE": 1,
    "LONG": 2,
    "STRING_LIST": 3,
    "DOUBLE_LIST": 4,
    "LONG_LIST": 5,
  }


class TParameter:
  """
  Attributes:
   - parameterId
   - displayName
   - parameterName
   - parameterType
   - enumerations
   - defaultValue
   - requiredParameter
   - hint
   - referenceParameterNames
   - hideInput
   - javascriptClassName
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'parameterId', None, None, ), # 1
    (2, TType.STRING, 'displayName', None, None, ), # 2
    (3, TType.STRING, 'parameterName', None, None, ), # 3
    (4, TType.STRING, 'parameterType', None, None, ), # 4
    (5, TType.LIST, 'enumerations', (TType.STRING,None), None, ), # 5
    (6, TType.STRING, 'defaultValue', None, None, ), # 6
    (7, TType.BOOL, 'requiredParameter', None, None, ), # 7
    (8, TType.STRING, 'hint', None, None, ), # 8
    (9, TType.STRING, 'referenceParameterNames', None, None, ), # 9
    (10, TType.BOOL, 'hideInput', None, None, ), # 10
    (11, TType.STRING, 'javascriptClassName', None, None, ), # 11
  )

  def __init__(self, parameterId=None, displayName=None, parameterName=None, parameterType=None, enumerations=None, defaultValue=None, requiredParameter=None, hint=None, referenceParameterNames=None, hideInput=None, javascriptClassName=None,):
    self.parameterId = parameterId
    self.displayName = displayName
    self.parameterName = parameterName
    self.parameterType = parameterType
    self.enumerations = enumerations
    self.defaultValue = defaultValue
    self.requiredParameter = requiredParameter
    self.hint = hint
    self.referenceParameterNames = referenceParameterNames
    self.hideInput = hideInput
    self.javascriptClassName = javascriptClassName

  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.I64:
          self.parameterId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.displayName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.parameterName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.parameterType = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.enumerations = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = iprot.readString();
            self.enumerations.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.defaultValue = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.requiredParameter = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.hint = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.referenceParameterNames = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.BOOL:
          self.hideInput = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.javascriptClassName = 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('TParameter')
    if self.parameterId is not None:
      oprot.writeFieldBegin('parameterId', TType.I64, 1)
      oprot.writeI64(self.parameterId)
      oprot.writeFieldEnd()
    if self.displayName is not None:
      oprot.writeFieldBegin('displayName', TType.STRING, 2)
      oprot.writeString(self.displayName)
      oprot.writeFieldEnd()
    if self.parameterName is not None:
      oprot.writeFieldBegin('parameterName', TType.STRING, 3)
      oprot.writeString(self.parameterName)
      oprot.writeFieldEnd()
    if self.parameterType is not None:
      oprot.writeFieldBegin('parameterType', TType.STRING, 4)
      oprot.writeString(self.parameterType)
      oprot.writeFieldEnd()
    if self.enumerations is not None:
      oprot.writeFieldBegin('enumerations', TType.LIST, 5)
      oprot.writeListBegin(TType.STRING, len(self.enumerations))
      for iter6 in self.enumerations:
        oprot.writeString(iter6)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.defaultValue is not None:
      oprot.writeFieldBegin('defaultValue', TType.STRING, 6)
      oprot.writeString(self.defaultValue)
      oprot.writeFieldEnd()
    if self.requiredParameter is not None:
      oprot.writeFieldBegin('requiredParameter', TType.BOOL, 7)
      oprot.writeBool(self.requiredParameter)
      oprot.writeFieldEnd()
    if self.hint is not None:
      oprot.writeFieldBegin('hint', TType.STRING, 8)
      oprot.writeString(self.hint)
      oprot.writeFieldEnd()
    if self.referenceParameterNames is not None:
      oprot.writeFieldBegin('referenceParameterNames', TType.STRING, 9)
      oprot.writeString(self.referenceParameterNames)
      oprot.writeFieldEnd()
    if self.hideInput is not None:
      oprot.writeFieldBegin('hideInput', TType.BOOL, 10)
      oprot.writeBool(self.hideInput)
      oprot.writeFieldEnd()
    if self.javascriptClassName is not None:
      oprot.writeFieldBegin('javascriptClassName', TType.STRING, 11)
      oprot.writeString(self.javascriptClassName)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  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 TValue:
  """
  Attributes:
   - type
   - longValue
   - doubleValue
   - stringValue
   - geoValue
   - listValue
   - mapValue
   - bytesValue
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'type', None, None, ), # 1
    (2, TType.I64, 'longValue', None, None, ), # 2
    (3, TType.DOUBLE, 'doubleValue', None, None, ), # 3
    (4, TType.STRING, 'stringValue', None, None, ), # 4
    (5, TType.LIST, 'geoValue', (TType.DOUBLE,None), None, ), # 5
    (6, TType.LIST, 'listValue', (TType.I32,None), None, ), # 6
    (7, TType.MAP, 'mapValue', (TType.STRING,None,TType.I32,None), None, ), # 7
    (8, TType.STRING, 'bytesValue', None, None, ), # 8
  )

  def __init__(self, type=None, longValue=None, doubleValue=None, stringValue=None, geoValue=None, listValue=None, mapValue=None, bytesValue=None,):
    self.type = type
    self.longValue = longValue
    self.doubleValue = doubleValue
    self.stringValue = stringValue
    self.geoValue = geoValue
    self.listValue = listValue
    self.mapValue = mapValue
    self.bytesValue = bytesValue

  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.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.longValue = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.doubleValue = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.stringValue = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.geoValue = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in xrange(_size7):
            _elem12 = iprot.readDouble();
            self.geoValue.append(_elem12)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.LIST:
          self.listValue = []
          (_etype16, _size13) = iprot.readListBegin()
          for _i17 in xrange(_size13):
            _elem18 = iprot.readI32();
            self.listValue.append(_elem18)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.MAP:
          self.mapValue = {}
          (_ktype20, _vtype21, _size19 ) = iprot.readMapBegin()
          for _i23 in xrange(_size19):
            _key24 = iprot.readString();
            _val25 = iprot.readI32();
            self.mapValue[_key24] = _val25
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.bytesValue = 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('TValue')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.longValue is not None:
      oprot.writeFieldBegin('longValue', TType.I64, 2)
      oprot.writeI64(self.longValue)
      oprot.writeFieldEnd()
    if self.doubleValue is not None:
      oprot.writeFieldBegin('doubleValue', TType.DOUBLE, 3)
      oprot.writeDouble(self.doubleValue)
      oprot.writeFieldEnd()
    if self.stringValue is not None:
      oprot.writeFieldBegin('stringValue', TType.STRING, 4)
      oprot.writeString(self.stringValue)
      oprot.writeFieldEnd()
    if self.geoValue is not None:
      oprot.writeFieldBegin('geoValue', TType.LIST, 5)
      oprot.writeListBegin(TType.DOUBLE, len(self.geoValue))
      for iter26 in self.geoValue:
        oprot.writeDouble(iter26)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.listValue is not None:
      oprot.writeFieldBegin('listValue', TType.LIST, 6)
      oprot.writeListBegin(TType.I32, len(self.listValue))
      for iter27 in self.listValue:
        oprot.writeI32(iter27)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.mapValue is not None:
      oprot.writeFieldBegin('mapValue', TType.MAP, 7)
      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.mapValue))
      for kiter28,viter29 in self.mapValue.items():
        oprot.writeString(kiter28)
        oprot.writeI32(viter29)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.bytesValue is not None:
      oprot.writeFieldBegin('bytesValue', TType.STRING, 8)
      oprot.writeString(self.bytesValue)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  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 TConfigValue:
  """
  Attributes:
   - type
   - stringValue
   - doubleValue
   - longValue
   - stringList
   - doubleList
   - longList
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'type', None, None, ), # 1
    (2, TType.STRING, 'stringValue', None, None, ), # 2
    (3, TType.DOUBLE, 'doubleValue', None, None, ), # 3
    (4, TType.I64, 'longValue', None, None, ), # 4
    (5, TType.LIST, 'stringList', (TType.STRING,None), None, ), # 5
    (6, TType.LIST, 'doubleList', (TType.DOUBLE,None), None, ), # 6
    (7, TType.LIST, 'longList', (TType.I64,None), None, ), # 7
  )

  def __init__(self, type=None, stringValue=None, doubleValue=None, longValue=None, stringList=None, doubleList=None, longList=None,):
    self.type = type
    self.stringValue = stringValue
    self.doubleValue = doubleValue
    self.longValue = longValue
    self.stringList = stringList
    self.doubleList = doubleList
    self.longList = longList

  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.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stringValue = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.doubleValue = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.longValue = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.stringList = []
          (_etype33, _size30) = iprot.readListBegin()
          for _i34 in xrange(_size30):
            _elem35 = iprot.readString();
            self.stringList.append(_elem35)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.LIST:
          self.doubleList = []
          (_etype39, _size36) = iprot.readListBegin()
          for _i40 in xrange(_size36):
            _elem41 = iprot.readDouble();
            self.doubleList.append(_elem41)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.LIST:
          self.longList = []
          (_etype45, _size42) = iprot.readListBegin()
          for _i46 in xrange(_size42):
            _elem47 = iprot.readI64();
            self.longList.append(_elem47)
          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('TConfigValue')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.stringValue is not None:
      oprot.writeFieldBegin('stringValue', TType.STRING, 2)
      oprot.writeString(self.stringValue)
      oprot.writeFieldEnd()
    if self.doubleValue is not None:
      oprot.writeFieldBegin('doubleValue', TType.DOUBLE, 3)
      oprot.writeDouble(self.doubleValue)
      oprot.writeFieldEnd()
    if self.longValue is not None:
      oprot.writeFieldBegin('longValue', TType.I64, 4)
      oprot.writeI64(self.longValue)
      oprot.writeFieldEnd()
    if self.stringList is not None:
      oprot.writeFieldBegin('stringList', TType.LIST, 5)
      oprot.writeListBegin(TType.STRING, len(self.stringList))
      for iter48 in self.stringList:
        oprot.writeString(iter48)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.doubleList is not None:
      oprot.writeFieldBegin('doubleList', TType.LIST, 6)
      oprot.writeListBegin(TType.DOUBLE, len(self.doubleList))
      for iter49 in self.doubleList:
        oprot.writeDouble(iter49)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.longList is not None:
      oprot.writeFieldBegin('longList', TType.LIST, 7)
      oprot.writeListBegin(TType.I64, len(self.longList))
      for iter50 in self.longList:
        oprot.writeI64(iter50)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.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 TSimpleRecord:
  """
  Attributes:
   - allValues
   - collectionId
   - securityLabel
  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'allValues', (TType.STRUCT,(TValue, TValue.thrift_spec)), None, ), # 1
    (2, TType.STRING, 'collectionId', None, None, ), # 2
    (3, TType.STRING, 'securityLabel', None, None, ), # 3
  )

  def __init__(self, allValues=None, collectionId=None, securityLabel=None,):
    self.allValues = allValues
    self.collectionId = collectionId
    self.securityLabel = securityLabel

  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.LIST:
          self.allValues = []
          (_etype54, _size51) = iprot.readListBegin()
          for _i55 in xrange(_size51):
            _elem56 = TValue()
            _elem56.read(iprot)
            self.allValues.append(_elem56)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.collectionId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.securityLabel = 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('TSimpleRecord')
    if self.allValues is not None:
      oprot.writeFieldBegin('allValues', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.allValues))
      for iter57 in self.allValues:
        iter57.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.collectionId is not None:
      oprot.writeFieldBegin('collectionId', TType.STRING, 2)
      oprot.writeString(self.collectionId)
      oprot.writeFieldEnd()
    if self.securityLabel is not None:
      oprot.writeFieldBegin('securityLabel', TType.STRING, 3)
      oprot.writeString(self.securityLabel)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  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 TFieldList:
  """
  Attributes:
   - collectionId
   - fields
   - fieldsToKeep
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'collectionId', None, None, ), # 1
    (2, TType.MAP, 'fields', (TType.STRING,None,TType.STRUCT,(TValue, TValue.thrift_spec)), None, ), # 2
    (3, TType.LIST, 'fieldsToKeep', (TType.STRING,None), None, ), # 3
  )

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

  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.STRING:
          self.collectionId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.MAP:
          self.fields = {}
          (_ktype59, _vtype60, _size58 ) = iprot.readMapBegin()
          for _i62 in xrange(_size58):
            _key63 = iprot.readString();
            _val64 = TValue()
            _val64.read(iprot)
            self.fields[_key63] = _val64
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.fieldsToKeep = []
          (_etype68, _size65) = iprot.readListBegin()
          for _i69 in xrange(_size65):
            _elem70 = iprot.readString();
            self.fieldsToKeep.append(_elem70)
          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('TFieldList')
    if self.collectionId is not None:
      oprot.writeFieldBegin('collectionId', TType.STRING, 1)
      oprot.writeString(self.collectionId)
      oprot.writeFieldEnd()
    if self.fields is not None:
      oprot.writeFieldBegin('fields', TType.MAP, 2)
      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.fields))
      for kiter71,viter72 in self.fields.items():
        oprot.writeString(kiter71)
        viter72.write(oprot)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.fieldsToKeep is not None:
      oprot.writeFieldBegin('fieldsToKeep', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.fieldsToKeep))
      for iter73 in self.fieldsToKeep:
        oprot.writeString(iter73)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
  )

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

  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.STRING:
          self.message = 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('TKoverseException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __str__(self):
    return repr(self)

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

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
  )

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

  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.STRING:
          self.message = 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('TNotFoundException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __str__(self):
    return repr(self)

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