#
# 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 HaveRideRelationship(self, driver_user_id, initiator_user_id):
    """
    Parameters:
     - driver_user_id
     - initiator_user_id
    """
    pass

  def GetRideRelationshipCount(self, driver_user_id, initiator_user_id):
    """
    Parameters:
     - driver_user_id
     - initiator_user_id
    """
    pass

  def HaveRideRelationshipBatch(self, driver_user_id, initiator_user_ids):
    """
    Parameters:
     - driver_user_id
     - initiator_user_ids
    """
    pass

  def GetRideRelationshipBatchCount(self, driver_user_id, initiator_user_ids):
    """
    Parameters:
     - driver_user_id
     - initiator_user_ids
    """
    pass

  def GiveReviewSubsidy(self, driver_user_id):
    """
    Parameters:
     - driver_user_id
    """
    pass

  def GetReviewSubsidyCount(self, driver_user_id):
    """
    Parameters:
     - driver_user_id
    """
    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 HaveRideRelationship(self, driver_user_id, initiator_user_id):
    """
    Parameters:
     - driver_user_id
     - initiator_user_id
    """
    self.send_HaveRideRelationship(driver_user_id, initiator_user_id)
    return self.recv_HaveRideRelationship()

  def send_HaveRideRelationship(self, driver_user_id, initiator_user_id):
    self._oprot.writeMessageBegin('HaveRideRelationship', TMessageType.CALL, self._seqid)
    args = HaveRideRelationship_args()
    args.driver_user_id = driver_user_id
    args.initiator_user_id = initiator_user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def GetRideRelationshipCount(self, driver_user_id, initiator_user_id):
    """
    Parameters:
     - driver_user_id
     - initiator_user_id
    """
    self.send_GetRideRelationshipCount(driver_user_id, initiator_user_id)
    return self.recv_GetRideRelationshipCount()

  def send_GetRideRelationshipCount(self, driver_user_id, initiator_user_id):
    self._oprot.writeMessageBegin('GetRideRelationshipCount', TMessageType.CALL, self._seqid)
    args = GetRideRelationshipCount_args()
    args.driver_user_id = driver_user_id
    args.initiator_user_id = initiator_user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def HaveRideRelationshipBatch(self, driver_user_id, initiator_user_ids):
    """
    Parameters:
     - driver_user_id
     - initiator_user_ids
    """
    self.send_HaveRideRelationshipBatch(driver_user_id, initiator_user_ids)
    return self.recv_HaveRideRelationshipBatch()

  def send_HaveRideRelationshipBatch(self, driver_user_id, initiator_user_ids):
    self._oprot.writeMessageBegin('HaveRideRelationshipBatch', TMessageType.CALL, self._seqid)
    args = HaveRideRelationshipBatch_args()
    args.driver_user_id = driver_user_id
    args.initiator_user_ids = initiator_user_ids
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def GetRideRelationshipBatchCount(self, driver_user_id, initiator_user_ids):
    """
    Parameters:
     - driver_user_id
     - initiator_user_ids
    """
    self.send_GetRideRelationshipBatchCount(driver_user_id, initiator_user_ids)
    return self.recv_GetRideRelationshipBatchCount()

  def send_GetRideRelationshipBatchCount(self, driver_user_id, initiator_user_ids):
    self._oprot.writeMessageBegin('GetRideRelationshipBatchCount', TMessageType.CALL, self._seqid)
    args = GetRideRelationshipBatchCount_args()
    args.driver_user_id = driver_user_id
    args.initiator_user_ids = initiator_user_ids
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def GiveReviewSubsidy(self, driver_user_id):
    """
    Parameters:
     - driver_user_id
    """
    self.send_GiveReviewSubsidy(driver_user_id)
    return self.recv_GiveReviewSubsidy()

  def send_GiveReviewSubsidy(self, driver_user_id):
    self._oprot.writeMessageBegin('GiveReviewSubsidy', TMessageType.CALL, self._seqid)
    args = GiveReviewSubsidy_args()
    args.driver_user_id = driver_user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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

  def GetReviewSubsidyCount(self, driver_user_id):
    """
    Parameters:
     - driver_user_id
    """
    self.send_GetReviewSubsidyCount(driver_user_id)
    return self.recv_GetReviewSubsidyCount()

  def send_GetReviewSubsidyCount(self, driver_user_id):
    self._oprot.writeMessageBegin('GetReviewSubsidyCount', TMessageType.CALL, self._seqid)
    args = GetReviewSubsidyCount_args()
    args.driver_user_id = driver_user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

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


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["HaveRideRelationship"] = Processor.process_HaveRideRelationship
    self._processMap["GetRideRelationshipCount"] = Processor.process_GetRideRelationshipCount
    self._processMap["HaveRideRelationshipBatch"] = Processor.process_HaveRideRelationshipBatch
    self._processMap["GetRideRelationshipBatchCount"] = Processor.process_GetRideRelationshipBatchCount
    self._processMap["GiveReviewSubsidy"] = Processor.process_GiveReviewSubsidy
    self._processMap["GetReviewSubsidyCount"] = Processor.process_GetReviewSubsidyCount

  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_HaveRideRelationship(self, seqid, iprot, oprot):
    args = HaveRideRelationship_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = HaveRideRelationship_result()
    try:
      result.success = self._handler.HaveRideRelationship(args.driver_user_id, args.initiator_user_id)
      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("HaveRideRelationship", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_GetRideRelationshipCount(self, seqid, iprot, oprot):
    args = GetRideRelationshipCount_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = GetRideRelationshipCount_result()
    try:
      result.success = self._handler.GetRideRelationshipCount(args.driver_user_id, args.initiator_user_id)
      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("GetRideRelationshipCount", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_HaveRideRelationshipBatch(self, seqid, iprot, oprot):
    args = HaveRideRelationshipBatch_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = HaveRideRelationshipBatch_result()
    try:
      result.success = self._handler.HaveRideRelationshipBatch(args.driver_user_id, args.initiator_user_ids)
      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("HaveRideRelationshipBatch", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_GetRideRelationshipBatchCount(self, seqid, iprot, oprot):
    args = GetRideRelationshipBatchCount_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = GetRideRelationshipBatchCount_result()
    try:
      result.success = self._handler.GetRideRelationshipBatchCount(args.driver_user_id, args.initiator_user_ids)
      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("GetRideRelationshipBatchCount", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_GiveReviewSubsidy(self, seqid, iprot, oprot):
    args = GiveReviewSubsidy_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = GiveReviewSubsidy_result()
    try:
      result.success = self._handler.GiveReviewSubsidy(args.driver_user_id)
      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("GiveReviewSubsidy", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_GetReviewSubsidyCount(self, seqid, iprot, oprot):
    args = GetReviewSubsidyCount_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = GetReviewSubsidyCount_result()
    try:
      result.success = self._handler.GetReviewSubsidyCount(args.driver_user_id)
      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("GetReviewSubsidyCount", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class HaveRideRelationship_args:
  """
  Attributes:
   - driver_user_id
   - initiator_user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
    (2, TType.I32, 'initiator_user_id', None, None, ), # 2
  )

  def __init__(self, driver_user_id=None, initiator_user_id=None,):
    self.driver_user_id = driver_user_id
    self.initiator_user_id = initiator_user_id

  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.driver_user_id = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.initiator_user_id = 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('HaveRideRelationship_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    if self.initiator_user_id is not None:
      oprot.writeFieldBegin('initiator_user_id', TType.I32, 2)
      oprot.writeI32(self.initiator_user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    value = (value * 31) ^ hash(self.initiator_user_id)
    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 HaveRideRelationship_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
  )

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

  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.BOOL:
          self.success = iprot.readBool()
        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('HaveRideRelationship_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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 GetRideRelationshipCount_args:
  """
  Attributes:
   - driver_user_id
   - initiator_user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
    (2, TType.I32, 'initiator_user_id', None, None, ), # 2
  )

  def __init__(self, driver_user_id=None, initiator_user_id=None,):
    self.driver_user_id = driver_user_id
    self.initiator_user_id = initiator_user_id

  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.driver_user_id = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.initiator_user_id = 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('GetRideRelationshipCount_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    if self.initiator_user_id is not None:
      oprot.writeFieldBegin('initiator_user_id', TType.I32, 2)
      oprot.writeI32(self.initiator_user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    value = (value * 31) ^ hash(self.initiator_user_id)
    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 GetRideRelationshipCount_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.I32, 'success', None, None, ), # 0
  )

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

  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.I32:
          self.success = 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('GetRideRelationshipCount_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.I32, 0)
      oprot.writeI32(self.success)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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 HaveRideRelationshipBatch_args:
  """
  Attributes:
   - driver_user_id
   - initiator_user_ids
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
    (2, TType.SET, 'initiator_user_ids', (TType.I32,None), None, ), # 2
  )

  def __init__(self, driver_user_id=None, initiator_user_ids=None,):
    self.driver_user_id = driver_user_id
    self.initiator_user_ids = initiator_user_ids

  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.driver_user_id = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.SET:
          self.initiator_user_ids = set()
          (_etype3, _size0) = iprot.readSetBegin()
          for _i4 in xrange(_size0):
            _elem5 = iprot.readI32()
            self.initiator_user_ids.add(_elem5)
          iprot.readSetEnd()
        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('HaveRideRelationshipBatch_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    if self.initiator_user_ids is not None:
      oprot.writeFieldBegin('initiator_user_ids', TType.SET, 2)
      oprot.writeSetBegin(TType.I32, len(self.initiator_user_ids))
      for iter6 in self.initiator_user_ids:
        oprot.writeI32(iter6)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    value = (value * 31) ^ hash(self.initiator_user_ids)
    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 HaveRideRelationshipBatch_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.I32,None,TType.BOOL,None), None, ), # 0
  )

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

  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.MAP:
          self.success = {}
          (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin()
          for _i11 in xrange(_size7):
            _key12 = iprot.readI32()
            _val13 = iprot.readBool()
            self.success[_key12] = _val13
          iprot.readMapEnd()
        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('HaveRideRelationshipBatch_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.MAP, 0)
      oprot.writeMapBegin(TType.I32, TType.BOOL, len(self.success))
      for kiter14,viter15 in self.success.items():
        oprot.writeI32(kiter14)
        oprot.writeBool(viter15)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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 GetRideRelationshipBatchCount_args:
  """
  Attributes:
   - driver_user_id
   - initiator_user_ids
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
    (2, TType.SET, 'initiator_user_ids', (TType.I32,None), None, ), # 2
  )

  def __init__(self, driver_user_id=None, initiator_user_ids=None,):
    self.driver_user_id = driver_user_id
    self.initiator_user_ids = initiator_user_ids

  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.driver_user_id = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.SET:
          self.initiator_user_ids = set()
          (_etype19, _size16) = iprot.readSetBegin()
          for _i20 in xrange(_size16):
            _elem21 = iprot.readI32()
            self.initiator_user_ids.add(_elem21)
          iprot.readSetEnd()
        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('GetRideRelationshipBatchCount_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    if self.initiator_user_ids is not None:
      oprot.writeFieldBegin('initiator_user_ids', TType.SET, 2)
      oprot.writeSetBegin(TType.I32, len(self.initiator_user_ids))
      for iter22 in self.initiator_user_ids:
        oprot.writeI32(iter22)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    value = (value * 31) ^ hash(self.initiator_user_ids)
    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 GetRideRelationshipBatchCount_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.I32,None,TType.I32,None), None, ), # 0
  )

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

  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.MAP:
          self.success = {}
          (_ktype24, _vtype25, _size23 ) = iprot.readMapBegin()
          for _i27 in xrange(_size23):
            _key28 = iprot.readI32()
            _val29 = iprot.readI32()
            self.success[_key28] = _val29
          iprot.readMapEnd()
        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('GetRideRelationshipBatchCount_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.MAP, 0)
      oprot.writeMapBegin(TType.I32, TType.I32, len(self.success))
      for kiter30,viter31 in self.success.items():
        oprot.writeI32(kiter30)
        oprot.writeI32(viter31)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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 GiveReviewSubsidy_args:
  """
  Attributes:
   - driver_user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
  )

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

  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.driver_user_id = 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('GiveReviewSubsidy_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    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 GiveReviewSubsidy_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
  )

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

  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.BOOL:
          self.success = iprot.readBool()
        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('GiveReviewSubsidy_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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 GetReviewSubsidyCount_args:
  """
  Attributes:
   - driver_user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'driver_user_id', None, None, ), # 1
  )

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

  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.driver_user_id = 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('GetReviewSubsidyCount_args')
    if self.driver_user_id is not None:
      oprot.writeFieldBegin('driver_user_id', TType.I32, 1)
      oprot.writeI32(self.driver_user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.driver_user_id)
    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 GetReviewSubsidyCount_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.I32, 'success', None, None, ), # 0
  )

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

  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.I32:
          self.success = 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('GetReviewSubsidyCount_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.I32, 0)
      oprot.writeI32(self.success)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    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)
