#
# 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 talos.thrift.Thrift import TType, TMessageType, TException, TApplicationException
import talos.thrift.common.ttypes
import talos.thrift.topic.ttypes


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



class ConsumeUnit:
  """
  Attributes:
   - consumerGroup: consumerGroup name

   - topicTalosResourceName: consuming topic resource name

   - partitionIdList: consuming partitionId list

   - workerId: consuming worker identifier

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroup', None, None, ), # 1
    (2, TType.STRUCT, 'topicTalosResourceName', (talos.thrift.topic.ttypes.TopicTalosResourceName, talos.thrift.topic.ttypes.TopicTalosResourceName.thrift_spec), None, ), # 2
    (3, TType.LIST, 'partitionIdList', (TType.I32,None), None, ), # 3
    (4, TType.STRING, 'workerId', None, None, ), # 4
  )

  def __init__(self, consumerGroup=None, topicTalosResourceName=None, partitionIdList=None, workerId=None,):
    self.consumerGroup = consumerGroup
    self.topicTalosResourceName = topicTalosResourceName
    self.partitionIdList = partitionIdList
    self.workerId = workerId

  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.consumerGroup = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicTalosResourceName = talos.thrift.topic.ttypes.TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.partitionIdList = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in range(_size0):
            _elem5 = iprot.readI32()
            self.partitionIdList.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.workerId = 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('ConsumeUnit')
    if self.consumerGroup is not None:
      oprot.writeFieldBegin('consumerGroup', TType.STRING, 1)
      oprot.writeString(self.consumerGroup)
      oprot.writeFieldEnd()
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 2)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.partitionIdList is not None:
      oprot.writeFieldBegin('partitionIdList', TType.LIST, 3)
      oprot.writeListBegin(TType.I32, len(self.partitionIdList))
      for iter6 in self.partitionIdList:
        oprot.writeI32(iter6)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.workerId is not None:
      oprot.writeFieldBegin('workerId', TType.STRING, 4)
      oprot.writeString(self.workerId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroup is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroup is unset!')
    if self.topicTalosResourceName is None:
      raise TProtocol.TProtocolException(message='Required field topicTalosResourceName is unset!')
    if self.partitionIdList is None:
      raise TProtocol.TProtocolException(message='Required field partitionIdList is unset!')
    if self.workerId is None:
      raise TProtocol.TProtocolException(message='Required field workerId is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.consumerGroup)
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.partitionIdList)
    value = (value * 31) ^ hash(self.workerId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class CheckPoint:
  """
  Attributes:
   - consumerGroup: consumerGroup name

   - topicAndPartition: topicAndPartition

   - msgOffset: message offset

   - workerId: worker id

   - lastCommitOffset: last commit offset

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroup', None, None, ), # 1
    (2, TType.STRUCT, 'topicAndPartition', (talos.thrift.topic.ttypes.TopicAndPartition, talos.thrift.topic.ttypes.TopicAndPartition.thrift_spec), None, ), # 2
    (3, TType.I64, 'msgOffset', None, None, ), # 3
    (4, TType.STRING, 'workerId', None, None, ), # 4
    (5, TType.I64, 'lastCommitOffset', None, None, ), # 5
  )

  def __init__(self, consumerGroup=None, topicAndPartition=None, msgOffset=None, workerId=None, lastCommitOffset=None,):
    self.consumerGroup = consumerGroup
    self.topicAndPartition = topicAndPartition
    self.msgOffset = msgOffset
    self.workerId = workerId
    self.lastCommitOffset = lastCommitOffset

  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.consumerGroup = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAndPartition = talos.thrift.topic.ttypes.TopicAndPartition()
          self.topicAndPartition.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.msgOffset = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.workerId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.lastCommitOffset = 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('CheckPoint')
    if self.consumerGroup is not None:
      oprot.writeFieldBegin('consumerGroup', TType.STRING, 1)
      oprot.writeString(self.consumerGroup)
      oprot.writeFieldEnd()
    if self.topicAndPartition is not None:
      oprot.writeFieldBegin('topicAndPartition', TType.STRUCT, 2)
      self.topicAndPartition.write(oprot)
      oprot.writeFieldEnd()
    if self.msgOffset is not None:
      oprot.writeFieldBegin('msgOffset', TType.I64, 3)
      oprot.writeI64(self.msgOffset)
      oprot.writeFieldEnd()
    if self.workerId is not None:
      oprot.writeFieldBegin('workerId', TType.STRING, 4)
      oprot.writeString(self.workerId)
      oprot.writeFieldEnd()
    if self.lastCommitOffset is not None:
      oprot.writeFieldBegin('lastCommitOffset', TType.I64, 5)
      oprot.writeI64(self.lastCommitOffset)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroup is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroup is unset!')
    if self.topicAndPartition is None:
      raise TProtocol.TProtocolException(message='Required field topicAndPartition is unset!')
    if self.msgOffset is None:
      raise TProtocol.TProtocolException(message='Required field msgOffset is unset!')
    if self.workerId is None:
      raise TProtocol.TProtocolException(message='Required field workerId is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.consumerGroup)
    value = (value * 31) ^ hash(self.topicAndPartition)
    value = (value * 31) ^ hash(self.msgOffset)
    value = (value * 31) ^ hash(self.workerId)
    value = (value * 31) ^ hash(self.lastCommitOffset)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class LockPartitionRequest:
  """
  Attributes:
   - consumeUnit: consumeUnit instance

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'consumeUnit', (ConsumeUnit, ConsumeUnit.thrift_spec), None, ), # 1
  )

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

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

  def validate(self):
    if self.consumeUnit is None:
      raise TProtocol.TProtocolException(message='Required field consumeUnit is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class LockPartitionResponse:
  """
  Attributes:
   - successPartitions: success lock partition list

   - failedPartitions: failed lock partition list

  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'successPartitions', (TType.I32,None), None, ), # 1
    (2, TType.LIST, 'failedPartitions', (TType.I32,None), None, ), # 2
  )

  def __init__(self, successPartitions=None, failedPartitions=None,):
    self.successPartitions = successPartitions
    self.failedPartitions = failedPartitions

  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.successPartitions = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in range(_size7):
            _elem12 = iprot.readI32()
            self.successPartitions.append(_elem12)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.failedPartitions = []
          (_etype16, _size13) = iprot.readListBegin()
          for _i17 in range(_size13):
            _elem18 = iprot.readI32()
            self.failedPartitions.append(_elem18)
          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('LockPartitionResponse')
    if self.successPartitions is not None:
      oprot.writeFieldBegin('successPartitions', TType.LIST, 1)
      oprot.writeListBegin(TType.I32, len(self.successPartitions))
      for iter19 in self.successPartitions:
        oprot.writeI32(iter19)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.failedPartitions is not None:
      oprot.writeFieldBegin('failedPartitions', TType.LIST, 2)
      oprot.writeListBegin(TType.I32, len(self.failedPartitions))
      for iter20 in self.failedPartitions:
        oprot.writeI32(iter20)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.successPartitions is None:
      raise TProtocol.TProtocolException(message='Required field successPartitions is unset!')
    if self.failedPartitions is None:
      raise TProtocol.TProtocolException(message='Required field failedPartitions is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class LockWorkerRequest:
  """
  Attributes:
   - consumeUnit: consumeUnit instance

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'consumeUnit', (ConsumeUnit, ConsumeUnit.thrift_spec), None, ), # 1
  )

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

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

  def validate(self):
    if self.consumeUnit is None:
      raise TProtocol.TProtocolException(message='Required field consumeUnit is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class LockWorkerResponse:
  """
  Attributes:
   - registerSuccess: lock worker heartbeat result
  """

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

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

  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.BOOL:
          self.registerSuccess = 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('LockWorkerResponse')
    if self.registerSuccess is not None:
      oprot.writeFieldBegin('registerSuccess', TType.BOOL, 1)
      oprot.writeBool(self.registerSuccess)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.registerSuccess is None:
      raise TProtocol.TProtocolException(message='Required field registerSuccess is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class UnlockPartitionRequest:
  """
  Attributes:
   - consumeUnit: consumeUnit instance

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'consumeUnit', (ConsumeUnit, ConsumeUnit.thrift_spec), None, ), # 1
  )

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

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

  def validate(self):
    if self.consumeUnit is None:
      raise TProtocol.TProtocolException(message='Required field consumeUnit is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class RenewRequest:
  """
  Attributes:
   - consumeUnit: consumeUnit instance

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'consumeUnit', (ConsumeUnit, ConsumeUnit.thrift_spec), None, ), # 1
  )

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

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

  def validate(self):
    if self.consumeUnit is None:
      raise TProtocol.TProtocolException(message='Required field consumeUnit is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class RenewResponse:
  """
  Attributes:
   - heartbeatSuccess: renew worker heartbeat result

   - failedPartitionList: renew serving partitions failed

  """

  thrift_spec = (
    None, # 0
    (1, TType.BOOL, 'heartbeatSuccess', None, None, ), # 1
    (2, TType.LIST, 'failedPartitionList', (TType.I32,None), None, ), # 2
  )

  def __init__(self, heartbeatSuccess=None, failedPartitionList=None,):
    self.heartbeatSuccess = heartbeatSuccess
    self.failedPartitionList = failedPartitionList

  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.BOOL:
          self.heartbeatSuccess = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.failedPartitionList = []
          (_etype24, _size21) = iprot.readListBegin()
          for _i25 in range(_size21):
            _elem26 = iprot.readI32()
            self.failedPartitionList.append(_elem26)
          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('RenewResponse')
    if self.heartbeatSuccess is not None:
      oprot.writeFieldBegin('heartbeatSuccess', TType.BOOL, 1)
      oprot.writeBool(self.heartbeatSuccess)
      oprot.writeFieldEnd()
    if self.failedPartitionList is not None:
      oprot.writeFieldBegin('failedPartitionList', TType.LIST, 2)
      oprot.writeListBegin(TType.I32, len(self.failedPartitionList))
      for iter27 in self.failedPartitionList:
        oprot.writeI32(iter27)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.heartbeatSuccess is None:
      raise TProtocol.TProtocolException(message='Required field heartbeatSuccess is unset!')
    if self.failedPartitionList is None:
      raise TProtocol.TProtocolException(message='Required field failedPartitionList is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class UpdateOffsetRequest:
  """
  Attributes:
   - checkpoint: CheckPoint instance

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'checkpoint', (CheckPoint, CheckPoint.thrift_spec), None, ), # 1
  )

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

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

  def validate(self):
    if self.checkpoint is None:
      raise TProtocol.TProtocolException(message='Required field checkpoint is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class UpdateOffsetResponse:
  """
  Attributes:
   - success: update offset success

  """

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

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

  def validate(self):
    if self.success is None:
      raise TProtocol.TProtocolException(message='Required field success is unset!')
    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__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryOffsetRequest:
  """
  Attributes:
   - consumerGroup: consumer group name

   - topicAndPartition: topicAndPartition

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroup', None, None, ), # 1
    (2, TType.STRUCT, 'topicAndPartition', (talos.thrift.topic.ttypes.TopicAndPartition, talos.thrift.topic.ttypes.TopicAndPartition.thrift_spec), None, ), # 2
  )

  def __init__(self, consumerGroup=None, topicAndPartition=None,):
    self.consumerGroup = consumerGroup
    self.topicAndPartition = topicAndPartition

  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.consumerGroup = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAndPartition = talos.thrift.topic.ttypes.TopicAndPartition()
          self.topicAndPartition.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('QueryOffsetRequest')
    if self.consumerGroup is not None:
      oprot.writeFieldBegin('consumerGroup', TType.STRING, 1)
      oprot.writeString(self.consumerGroup)
      oprot.writeFieldEnd()
    if self.topicAndPartition is not None:
      oprot.writeFieldBegin('topicAndPartition', TType.STRUCT, 2)
      self.topicAndPartition.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroup is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroup is unset!')
    if self.topicAndPartition is None:
      raise TProtocol.TProtocolException(message='Required field topicAndPartition is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryOffsetResponse:
  """
  Attributes:
   - msgOffset: consumed offset

  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'msgOffset', None, None, ), # 1
  )

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

  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.msgOffset = 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('QueryOffsetResponse')
    if self.msgOffset is not None:
      oprot.writeFieldBegin('msgOffset', TType.I64, 1)
      oprot.writeI64(self.msgOffset)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.msgOffset is None:
      raise TProtocol.TProtocolException(message='Required field msgOffset is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryWorkerRequest:
  """
  Attributes:
   - consumerGroup: consumer group name

   - topicTalosResourceName: topicTalosResourceName

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroup', None, None, ), # 1
    (2, TType.STRUCT, 'topicTalosResourceName', (talos.thrift.topic.ttypes.TopicTalosResourceName, talos.thrift.topic.ttypes.TopicTalosResourceName.thrift_spec), None, ), # 2
  )

  def __init__(self, consumerGroup=None, topicTalosResourceName=None,):
    self.consumerGroup = consumerGroup
    self.topicTalosResourceName = topicTalosResourceName

  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.consumerGroup = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicTalosResourceName = talos.thrift.topic.ttypes.TopicTalosResourceName()
          self.topicTalosResourceName.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('QueryWorkerRequest')
    if self.consumerGroup is not None:
      oprot.writeFieldBegin('consumerGroup', TType.STRING, 1)
      oprot.writeString(self.consumerGroup)
      oprot.writeFieldEnd()
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 2)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroup is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroup is unset!')
    if self.topicTalosResourceName is None:
      raise TProtocol.TProtocolException(message='Required field topicTalosResourceName is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryWorkerResponse:
  """
  Attributes:
   - workerMap: alived worker and corresponding serving partitions id list

  """

  thrift_spec = (
    None, # 0
    (1, TType.MAP, 'workerMap', (TType.STRING,None,TType.LIST,(TType.I32,None)), None, ), # 1
  )

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

  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.MAP:
          self.workerMap = {}
          (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin()
          for _i32 in range(_size28):
            _key33 = iprot.readString()
            _val34 = []
            (_etype38, _size35) = iprot.readListBegin()
            for _i39 in range(_size35):
              _elem40 = iprot.readI32()
              _val34.append(_elem40)
            iprot.readListEnd()
            self.workerMap[_key33] = _val34
          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('QueryWorkerResponse')
    if self.workerMap is not None:
      oprot.writeFieldBegin('workerMap', TType.MAP, 1)
      oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.workerMap))
      for kiter41,viter42 in self.workerMap.items():
        oprot.writeString(kiter41)
        oprot.writeListBegin(TType.I32, len(viter42))
        for iter43 in viter42:
          oprot.writeI32(iter43)
        oprot.writeListEnd()
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.workerMap is None:
      raise TProtocol.TProtocolException(message='Required field workerMap is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ConsumerGroupAndPartition:
  """
  Attributes:
   - consumerGroupName: The specified ConsumerGroupName

   - topicTalosResourceName: The specified topic

   - partitionId: The specified partitionId

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroupName', None, None, ), # 1
    (2, TType.STRUCT, 'topicTalosResourceName', (talos.thrift.topic.ttypes.TopicTalosResourceName, talos.thrift.topic.ttypes.TopicTalosResourceName.thrift_spec), None, ), # 2
    (3, TType.I32, 'partitionId', None, None, ), # 3
  )

  def __init__(self, consumerGroupName=None, topicTalosResourceName=None, partitionId=None,):
    self.consumerGroupName = consumerGroupName
    self.topicTalosResourceName = topicTalosResourceName
    self.partitionId = partitionId

  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.consumerGroupName = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicTalosResourceName = talos.thrift.topic.ttypes.TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.partitionId = 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('ConsumerGroupAndPartition')
    if self.consumerGroupName is not None:
      oprot.writeFieldBegin('consumerGroupName', TType.STRING, 1)
      oprot.writeString(self.consumerGroupName)
      oprot.writeFieldEnd()
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 2)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.partitionId is not None:
      oprot.writeFieldBegin('partitionId', TType.I32, 3)
      oprot.writeI32(self.partitionId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroupName is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroupName is unset!')
    if self.topicTalosResourceName is None:
      raise TProtocol.TProtocolException(message='Required field topicTalosResourceName is unset!')
    if self.partitionId is None:
      raise TProtocol.TProtocolException(message='Required field partitionId is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.consumerGroupName)
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.partitionId)
    return value

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryOrgOffsetRequest:
  """
  Attributes:
   - consumerGroupPrefix: ConsumerGroupPrefix

   - orgId: OrgId

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'consumerGroupPrefix', None, None, ), # 1
    (2, TType.STRING, 'orgId', None, None, ), # 2
  )

  def __init__(self, consumerGroupPrefix=None, orgId=None,):
    self.consumerGroupPrefix = consumerGroupPrefix
    self.orgId = orgId

  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.consumerGroupPrefix = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.orgId = 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('QueryOrgOffsetRequest')
    if self.consumerGroupPrefix is not None:
      oprot.writeFieldBegin('consumerGroupPrefix', TType.STRING, 1)
      oprot.writeString(self.consumerGroupPrefix)
      oprot.writeFieldEnd()
    if self.orgId is not None:
      oprot.writeFieldBegin('orgId', TType.STRING, 2)
      oprot.writeString(self.orgId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroupPrefix is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroupPrefix is unset!')
    if self.orgId is None:
      raise TProtocol.TProtocolException(message='Required field orgId is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class QueryOrgOffsetResponse:
  """
  Attributes:
   - consumerGroupOffsetMap: The ConsumerGroupInfo and OffsetLag of specified consumerGroupPrefix and orgId

  """

  thrift_spec = (
    None, # 0
    (1, TType.MAP, 'consumerGroupOffsetMap', (TType.STRUCT,(ConsumerGroupAndPartition, ConsumerGroupAndPartition.thrift_spec),TType.I64,None), None, ), # 1
  )

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

  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.MAP:
          self.consumerGroupOffsetMap = {}
          (_ktype45, _vtype46, _size44 ) = iprot.readMapBegin()
          for _i48 in range(_size44):
            _key49 = ConsumerGroupAndPartition()
            _key49.read(iprot)
            _val50 = iprot.readI64()
            self.consumerGroupOffsetMap[_key49] = _val50
          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('QueryOrgOffsetResponse')
    if self.consumerGroupOffsetMap is not None:
      oprot.writeFieldBegin('consumerGroupOffsetMap', TType.MAP, 1)
      oprot.writeMapBegin(TType.STRUCT, TType.I64, len(self.consumerGroupOffsetMap))
      for kiter51,viter52 in self.consumerGroupOffsetMap.items():
        kiter51.write(oprot)
        oprot.writeI64(viter52)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.consumerGroupOffsetMap is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroupOffsetMap is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class GetWorkerIdRequest:
  """
  Attributes:
   - topicAndPartition: The topicAndPartition

   - consumerGroup: The consumerGroup

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicAndPartition', (talos.thrift.topic.ttypes.TopicAndPartition, talos.thrift.topic.ttypes.TopicAndPartition.thrift_spec), None, ), # 1
    (2, TType.STRING, 'consumerGroup', None, None, ), # 2
  )

  def __init__(self, topicAndPartition=None, consumerGroup=None,):
    self.topicAndPartition = topicAndPartition
    self.consumerGroup = consumerGroup

  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.topicAndPartition = talos.thrift.topic.ttypes.TopicAndPartition()
          self.topicAndPartition.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.consumerGroup = 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('GetWorkerIdRequest')
    if self.topicAndPartition is not None:
      oprot.writeFieldBegin('topicAndPartition', TType.STRUCT, 1)
      self.topicAndPartition.write(oprot)
      oprot.writeFieldEnd()
    if self.consumerGroup is not None:
      oprot.writeFieldBegin('consumerGroup', TType.STRING, 2)
      oprot.writeString(self.consumerGroup)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.topicAndPartition is None:
      raise TProtocol.TProtocolException(message='Required field topicAndPartition is unset!')
    if self.consumerGroup is None:
      raise TProtocol.TProtocolException(message='Required field consumerGroup is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class GetWorkerIdResponse:
  """
  Attributes:
   - workerId: The WorkerId

  """

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

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

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

  def validate(self):
    if self.workerId is None:
      raise TProtocol.TProtocolException(message='Required field workerId is unset!')
    return


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

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.items()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)
