#
# 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.quota.ttypes
import talos.thrift.authorization.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 TopicStatus:
  CREATING = 0
  ACTIVE = 1
  DELETING = 2
  DELETED = 3

  _VALUES_TO_NAMES = {
    0: "CREATING",
    1: "ACTIVE",
    2: "DELETING",
    3: "DELETED",
  }

  _NAMES_TO_VALUES = {
    "CREATING": 0,
    "ACTIVE": 1,
    "DELETING": 2,
    "DELETED": 3,
  }

class Permission:
  NONE = 0
  PUT_MESSAGE = 1
  GET_MESSAGE = 2
  FULL_MESSAGE_CONTROL = 3
  DESCRIBE_TOPIC = 4
  PUT_MESSAGE_AND_DESCRIBE_TOPIC = 5
  GET_MESSAGE_AND_DESCRIBE_TOPIC = 6
  TOPIC_READ_AND_MESSAGE_FULL_CONTROL = 7
  CHANGE_TOPIC = 8
  FULL_TOPIC_CONTROL = 12
  FULL_CONTROL = 15
  CHANGE_PERMISSION = 16
  ADMIN = 31

  _VALUES_TO_NAMES = {
    0: "NONE",
    1: "PUT_MESSAGE",
    2: "GET_MESSAGE",
    3: "FULL_MESSAGE_CONTROL",
    4: "DESCRIBE_TOPIC",
    5: "PUT_MESSAGE_AND_DESCRIBE_TOPIC",
    6: "GET_MESSAGE_AND_DESCRIBE_TOPIC",
    7: "TOPIC_READ_AND_MESSAGE_FULL_CONTROL",
    8: "CHANGE_TOPIC",
    12: "FULL_TOPIC_CONTROL",
    15: "FULL_CONTROL",
    16: "CHANGE_PERMISSION",
    31: "ADMIN",
  }

  _NAMES_TO_VALUES = {
    "NONE": 0,
    "PUT_MESSAGE": 1,
    "GET_MESSAGE": 2,
    "FULL_MESSAGE_CONTROL": 3,
    "DESCRIBE_TOPIC": 4,
    "PUT_MESSAGE_AND_DESCRIBE_TOPIC": 5,
    "GET_MESSAGE_AND_DESCRIBE_TOPIC": 6,
    "TOPIC_READ_AND_MESSAGE_FULL_CONTROL": 7,
    "CHANGE_TOPIC": 8,
    "FULL_TOPIC_CONTROL": 12,
    "FULL_CONTROL": 15,
    "CHANGE_PERMISSION": 16,
    "ADMIN": 31,
  }


class TopicTalosResourceName:
  """
  Attributes:
   - topicTalosResourceName: The Talos Resource Name for the topic;

  """

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

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

  def validate(self):
    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.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 TopicAndPartition:
  """
  Attributes:
   - topicName: The name for the topic;

   - topicTalosResourceName: The Talos Resource Name for the topic;

   - partitionId: The PartitionId;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'topicName', None, None, ), # 1
    (2, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 2
    (3, TType.I32, 'partitionId', None, None, ), # 3
  )

  def __init__(self, topicName=None, topicTalosResourceName=None, partitionId=None,):
    self.topicName = topicName
    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.topicName = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicTalosResourceName = 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('TopicAndPartition')
    if self.topicName is not None:
      oprot.writeFieldBegin('topicName', TType.STRING, 1)
      oprot.writeString(self.topicName)
      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.topicName is None:
      raise TProtocol.TProtocolException(message='Required field topicName 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.topicName)
    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 TopicInfo:
  """
  Attributes:
   - topicName: The name for the topic;

   - topicTalosResourceName: The Talos Resource Name for the topic;

   - ownerId: The ownerId for the toic, stored as 'developerId' which is invisible,
  but make authorization with 'accountId';

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'topicName', None, None, ), # 1
    (2, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 2
    (3, TType.STRING, 'ownerId', None, None, ), # 3
  )

  def __init__(self, topicName=None, topicTalosResourceName=None, ownerId=None,):
    self.topicName = topicName
    self.topicTalosResourceName = topicTalosResourceName
    self.ownerId = ownerId

  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.topicName = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicTalosResourceName = TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.ownerId = 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('TopicInfo')
    if self.topicName is not None:
      oprot.writeFieldBegin('topicName', TType.STRING, 1)
      oprot.writeString(self.topicName)
      oprot.writeFieldEnd()
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 2)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.ownerId is not None:
      oprot.writeFieldBegin('ownerId', TType.STRING, 3)
      oprot.writeString(self.ownerId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.ownerId)
    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 TopicAttribute:
  """
  Attributes:
   - partitionNumber: Partition number for the topic, default 8 (1 ~ 256)

   - messageRetentionSecs: The retention time(in secs) for message in the topic, talos will make sure
  that message in this topic will be available at least messageRetentionSecs,
  default 24h (1h ~ 365d)

   - attributes: Some other attribute;

   - oldPartitionNumber: Old partition number for the topic before reduced, default 0 (1 ~ 256)

  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'partitionNumber', None, None, ), # 1
    (2, TType.I32, 'messageRetentionSecs', None, None, ), # 2
    (3, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
    (4, TType.I32, 'oldPartitionNumber', None, None, ), # 4
  )

  def __init__(self, partitionNumber=None, messageRetentionSecs=None, attributes=None, oldPartitionNumber=None,):
    self.partitionNumber = partitionNumber
    self.messageRetentionSecs = messageRetentionSecs
    self.attributes = attributes
    self.oldPartitionNumber = oldPartitionNumber

  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.partitionNumber = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.messageRetentionSecs = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.MAP:
          self.attributes = {}
          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
          for _i4 in range(_size0):
            _key5 = iprot.readString()
            _val6 = iprot.readString()
            self.attributes[_key5] = _val6
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.oldPartitionNumber = 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('TopicAttribute')
    if self.partitionNumber is not None:
      oprot.writeFieldBegin('partitionNumber', TType.I32, 1)
      oprot.writeI32(self.partitionNumber)
      oprot.writeFieldEnd()
    if self.messageRetentionSecs is not None:
      oprot.writeFieldBegin('messageRetentionSecs', TType.I32, 2)
      oprot.writeI32(self.messageRetentionSecs)
      oprot.writeFieldEnd()
    if self.attributes is not None:
      oprot.writeFieldBegin('attributes', TType.MAP, 3)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes))
      for kiter7,viter8 in self.attributes.items():
        oprot.writeString(kiter7)
        oprot.writeString(viter8)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.oldPartitionNumber is not None:
      oprot.writeFieldBegin('oldPartitionNumber', TType.I32, 4)
      oprot.writeI32(self.oldPartitionNumber)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.partitionNumber)
    value = (value * 31) ^ hash(self.messageRetentionSecs)
    value = (value * 31) ^ hash(self.attributes)
    value = (value * 31) ^ hash(self.oldPartitionNumber)
    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 PartitionState:
  """
  Attributes:
   - partitionId: Partition ID for this topic;

   - startOffset: The message start offset for this partition;

   - lastestOffset: The message lastest offset for this partition;

   - messageNumber: The message number in this partition;

   - messageBytes: The message bytes in this partition;

   - totalMessageNumber: The total message number of this partition
  optional for compatible forward

   - totalMessageBytes: The total message bytes of this partition
  optional for compatible forward

  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'partitionId', None, None, ), # 1
    (2, TType.I64, 'startOffset', None, None, ), # 2
    (3, TType.I64, 'lastestOffset', None, None, ), # 3
    (4, TType.I64, 'messageNumber', None, None, ), # 4
    (5, TType.I64, 'messageBytes', None, None, ), # 5
    (6, TType.I64, 'totalMessageNumber', None, None, ), # 6
    (7, TType.I64, 'totalMessageBytes', None, None, ), # 7
  )

  def __init__(self, partitionId=None, startOffset=None, lastestOffset=None, messageNumber=None, messageBytes=None, totalMessageNumber=None, totalMessageBytes=None,):
    self.partitionId = partitionId
    self.startOffset = startOffset
    self.lastestOffset = lastestOffset
    self.messageNumber = messageNumber
    self.messageBytes = messageBytes
    self.totalMessageNumber = totalMessageNumber
    self.totalMessageBytes = totalMessageBytes

  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.partitionId = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.startOffset = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.lastestOffset = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.messageNumber = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.messageBytes = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.totalMessageNumber = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.totalMessageBytes = 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('PartitionState')
    if self.partitionId is not None:
      oprot.writeFieldBegin('partitionId', TType.I32, 1)
      oprot.writeI32(self.partitionId)
      oprot.writeFieldEnd()
    if self.startOffset is not None:
      oprot.writeFieldBegin('startOffset', TType.I64, 2)
      oprot.writeI64(self.startOffset)
      oprot.writeFieldEnd()
    if self.lastestOffset is not None:
      oprot.writeFieldBegin('lastestOffset', TType.I64, 3)
      oprot.writeI64(self.lastestOffset)
      oprot.writeFieldEnd()
    if self.messageNumber is not None:
      oprot.writeFieldBegin('messageNumber', TType.I64, 4)
      oprot.writeI64(self.messageNumber)
      oprot.writeFieldEnd()
    if self.messageBytes is not None:
      oprot.writeFieldBegin('messageBytes', TType.I64, 5)
      oprot.writeI64(self.messageBytes)
      oprot.writeFieldEnd()
    if self.totalMessageNumber is not None:
      oprot.writeFieldBegin('totalMessageNumber', TType.I64, 6)
      oprot.writeI64(self.totalMessageNumber)
      oprot.writeFieldEnd()
    if self.totalMessageBytes is not None:
      oprot.writeFieldBegin('totalMessageBytes', TType.I64, 7)
      oprot.writeI64(self.totalMessageBytes)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.partitionId is None:
      raise TProtocol.TProtocolException(message='Required field partitionId is unset!')
    if self.startOffset is None:
      raise TProtocol.TProtocolException(message='Required field startOffset is unset!')
    if self.lastestOffset is None:
      raise TProtocol.TProtocolException(message='Required field lastestOffset is unset!')
    if self.messageNumber is None:
      raise TProtocol.TProtocolException(message='Required field messageNumber is unset!')
    if self.messageBytes is None:
      raise TProtocol.TProtocolException(message='Required field messageBytes is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.partitionId)
    value = (value * 31) ^ hash(self.startOffset)
    value = (value * 31) ^ hash(self.lastestOffset)
    value = (value * 31) ^ hash(self.messageNumber)
    value = (value * 31) ^ hash(self.messageBytes)
    value = (value * 31) ^ hash(self.totalMessageNumber)
    value = (value * 31) ^ hash(self.totalMessageBytes)
    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 TopicState:
  """
  Attributes:
   - createTimestamp: Create Timestamp for this topic;

   - topicStatus: Topic status for this topic;

   - messageNumber: The message number in this topic(include all partitions);

   - messageBytes: The message bytes in this topic(include all partitions);

   - partitionStates: All partition state for this partition;

   - totalMessageNumber: The total message number of this topic,
  optional for compatible forward

   - totalMessageBytes: The total message bytes of this topic
  optional for compatible forward

  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'createTimestamp', None, None, ), # 1
    (2, TType.I32, 'topicStatus', None, None, ), # 2
    (3, TType.I64, 'messageNumber', None, None, ), # 3
    (4, TType.I64, 'messageBytes', None, None, ), # 4
    (5, TType.LIST, 'partitionStates', (TType.STRUCT,(PartitionState, PartitionState.thrift_spec)), None, ), # 5
    (6, TType.I64, 'totalMessageNumber', None, None, ), # 6
    (7, TType.I64, 'totalMessageBytes', None, None, ), # 7
  )

  def __init__(self, createTimestamp=None, topicStatus=None, messageNumber=None, messageBytes=None, partitionStates=None, totalMessageNumber=None, totalMessageBytes=None,):
    self.createTimestamp = createTimestamp
    self.topicStatus = topicStatus
    self.messageNumber = messageNumber
    self.messageBytes = messageBytes
    self.partitionStates = partitionStates
    self.totalMessageNumber = totalMessageNumber
    self.totalMessageBytes = totalMessageBytes

  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.createTimestamp = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.topicStatus = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.messageNumber = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.messageBytes = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.partitionStates = []
          (_etype12, _size9) = iprot.readListBegin()
          for _i13 in range(_size9):
            _elem14 = PartitionState()
            _elem14.read(iprot)
            self.partitionStates.append(_elem14)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.totalMessageNumber = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.totalMessageBytes = 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('TopicState')
    if self.createTimestamp is not None:
      oprot.writeFieldBegin('createTimestamp', TType.I64, 1)
      oprot.writeI64(self.createTimestamp)
      oprot.writeFieldEnd()
    if self.topicStatus is not None:
      oprot.writeFieldBegin('topicStatus', TType.I32, 2)
      oprot.writeI32(self.topicStatus)
      oprot.writeFieldEnd()
    if self.messageNumber is not None:
      oprot.writeFieldBegin('messageNumber', TType.I64, 3)
      oprot.writeI64(self.messageNumber)
      oprot.writeFieldEnd()
    if self.messageBytes is not None:
      oprot.writeFieldBegin('messageBytes', TType.I64, 4)
      oprot.writeI64(self.messageBytes)
      oprot.writeFieldEnd()
    if self.partitionStates is not None:
      oprot.writeFieldBegin('partitionStates', TType.LIST, 5)
      oprot.writeListBegin(TType.STRUCT, len(self.partitionStates))
      for iter15 in self.partitionStates:
        iter15.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.totalMessageNumber is not None:
      oprot.writeFieldBegin('totalMessageNumber', TType.I64, 6)
      oprot.writeI64(self.totalMessageNumber)
      oprot.writeFieldEnd()
    if self.totalMessageBytes is not None:
      oprot.writeFieldBegin('totalMessageBytes', TType.I64, 7)
      oprot.writeI64(self.totalMessageBytes)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.createTimestamp is None:
      raise TProtocol.TProtocolException(message='Required field createTimestamp is unset!')
    if self.topicStatus is None:
      raise TProtocol.TProtocolException(message='Required field topicStatus is unset!')
    if self.messageNumber is None:
      raise TProtocol.TProtocolException(message='Required field messageNumber is unset!')
    if self.messageBytes is None:
      raise TProtocol.TProtocolException(message='Required field messageBytes is unset!')
    if self.partitionStates is None:
      raise TProtocol.TProtocolException(message='Required field partitionStates is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.createTimestamp)
    value = (value * 31) ^ hash(self.topicStatus)
    value = (value * 31) ^ hash(self.messageNumber)
    value = (value * 31) ^ hash(self.messageBytes)
    value = (value * 31) ^ hash(self.partitionStates)
    value = (value * 31) ^ hash(self.totalMessageNumber)
    value = (value * 31) ^ hash(self.totalMessageBytes)
    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 Topic:
  """
  Attributes:
   - topicInfo: TopicInfo for this topic;

   - topicAttribute: TopicAttribute for this topic;

   - topicState: TopicState for this topic;

   - topicQuota: TopicQuota for the topic;

   - topicAcl: TopicAcl for the topic;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicInfo', (TopicInfo, TopicInfo.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'topicAttribute', (TopicAttribute, TopicAttribute.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'topicState', (TopicState, TopicState.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'topicQuota', (talos.thrift.quota.ttypes.BaseQuota, talos.thrift.quota.ttypes.BaseQuota.thrift_spec), None, ), # 4
    (5, TType.MAP, 'topicAcl', (TType.STRING,None,TType.I32,None), None, ), # 5
  )

  def __init__(self, topicInfo=None, topicAttribute=None, topicState=None, topicQuota=None, topicAcl=None,):
    self.topicInfo = topicInfo
    self.topicAttribute = topicAttribute
    self.topicState = topicState
    self.topicQuota = topicQuota
    self.topicAcl = topicAcl

  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.topicInfo = TopicInfo()
          self.topicInfo.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAttribute = TopicAttribute()
          self.topicAttribute.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.topicState = TopicState()
          self.topicState.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.topicQuota = thrift.quota.ttypes.BaseQuota()
          self.topicQuota.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.MAP:
          self.topicAcl = {}
          (_ktype17, _vtype18, _size16 ) = iprot.readMapBegin()
          for _i20 in range(_size16):
            _key21 = iprot.readString()
            _val22 = iprot.readI32()
            self.topicAcl[_key21] = _val22
          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('Topic')
    if self.topicInfo is not None:
      oprot.writeFieldBegin('topicInfo', TType.STRUCT, 1)
      self.topicInfo.write(oprot)
      oprot.writeFieldEnd()
    if self.topicAttribute is not None:
      oprot.writeFieldBegin('topicAttribute', TType.STRUCT, 2)
      self.topicAttribute.write(oprot)
      oprot.writeFieldEnd()
    if self.topicState is not None:
      oprot.writeFieldBegin('topicState', TType.STRUCT, 3)
      self.topicState.write(oprot)
      oprot.writeFieldEnd()
    if self.topicQuota is not None:
      oprot.writeFieldBegin('topicQuota', TType.STRUCT, 4)
      self.topicQuota.write(oprot)
      oprot.writeFieldEnd()
    if self.topicAcl is not None:
      oprot.writeFieldBegin('topicAcl', TType.MAP, 5)
      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.topicAcl))
      for kiter23,viter24 in self.topicAcl.items():
        oprot.writeString(kiter23)
        oprot.writeI32(viter24)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicInfo)
    value = (value * 31) ^ hash(self.topicAttribute)
    value = (value * 31) ^ hash(self.topicState)
    value = (value * 31) ^ hash(self.topicQuota)
    value = (value * 31) ^ hash(self.topicAcl)
    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 CreateTopicRequest:
  """
  Attributes:
   - topicName: Topic name;

   - topicAttribute: TopicAttribute for the topic, partitionNumber is required;

   - topicQuota: TopicQuota for the topic

   - aclMap: TopicAcl for the topic
  Note: Grantee must specified 'GrantType' and 'identifier', specifically,
  the 'identifier' must be the 'appId'/'accountId' in openplatform of Xiaomi

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'topicName', None, None, ), # 1
    (2, TType.STRUCT, 'topicAttribute', (TopicAttribute, TopicAttribute.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'topicQuota', (talos.thrift.quota.ttypes.BaseQuota, talos.thrift.quota.ttypes.BaseQuota.thrift_spec), None, ), # 3
    (4, TType.MAP, 'aclMap', (TType.STRUCT,(talos.thrift.authorization.ttypes.Grantee, talos.thrift.authorization.ttypes.Grantee.thrift_spec),TType.I32,None), None, ), # 4
  )

  def __init__(self, topicName=None, topicAttribute=None, topicQuota=None, aclMap=None,):
    self.topicName = topicName
    self.topicAttribute = topicAttribute
    self.topicQuota = topicQuota
    self.aclMap = aclMap

  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.topicName = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAttribute = TopicAttribute()
          self.topicAttribute.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.topicQuota = talos.thrift.quota.ttypes.BaseQuota()
          self.topicQuota.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.MAP:
          self.aclMap = {}
          (_ktype26, _vtype27, _size25 ) = iprot.readMapBegin()
          for _i29 in range(_size25):
            _key30 = talos.thrift.authorization.ttypes.Grantee()
            _key30.read(iprot)
            _val31 = iprot.readI32()
            self.aclMap[_key30] = _val31
          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('CreateTopicRequest')
    if self.topicName is not None:
      oprot.writeFieldBegin('topicName', TType.STRING, 1)
      oprot.writeString(self.topicName)
      oprot.writeFieldEnd()
    if self.topicAttribute is not None:
      oprot.writeFieldBegin('topicAttribute', TType.STRUCT, 2)
      self.topicAttribute.write(oprot)
      oprot.writeFieldEnd()
    if self.topicQuota is not None:
      oprot.writeFieldBegin('topicQuota', TType.STRUCT, 3)
      self.topicQuota.write(oprot)
      oprot.writeFieldEnd()
    if self.aclMap is not None:
      oprot.writeFieldBegin('aclMap', TType.MAP, 4)
      oprot.writeMapBegin(TType.STRUCT, TType.I32, len(self.aclMap))
      for kiter32,viter33 in self.aclMap.items():
        kiter32.write(oprot)
        oprot.writeI32(viter33)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    value = (value * 31) ^ hash(self.topicAttribute)
    value = (value * 31) ^ hash(self.topicQuota)
    value = (value * 31) ^ hash(self.aclMap)
    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 CreateReplicationTopicRequest:
  """
  Attributes:
   - topicName: Topic name;

   - sourceClusterList: source cluster list;

   - sourceTopicName: source topic name

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'topicName', None, None, ), # 1
    (2, TType.STRING, 'sourceClusterList', None, None, ), # 2
    (3, TType.STRING, 'sourceTopicName', None, None, ), # 3
  )

  def __init__(self, topicName=None, sourceClusterList=None, sourceTopicName=None,):
    self.topicName = topicName
    self.sourceClusterList = sourceClusterList
    self.sourceTopicName = sourceTopicName

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    value = (value * 31) ^ hash(self.sourceClusterList)
    value = (value * 31) ^ hash(self.sourceTopicName)
    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 CreateTopicResponse:
  """
  Attributes:
   - topicInfo: TopicInfo for the created topic;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicInfo', (TopicInfo, TopicInfo.thrift_spec), None, ), # 1
  )

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicInfo)
    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 DeleteTopicRequest:
  """
  Attributes:
   - topicTalosResourceName: The topicTalosResourceName is in TopicInfo that returned by CreateTopic,
  you can also get TopicInfo by describeTopic;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
  )

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

  def validate(self):
    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.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 ChangeTopicAttributeRequest:
  """
  Attributes:
   - topicTalosResourceName: The topicTalosResourceName is in TopicInfo that returned by CreateTopic,
  you can also get TopicInfo by describeTopic;

   - topicAttribute: Topic attribute;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'topicAttribute', (TopicAttribute, TopicAttribute.thrift_spec), None, ), # 2
  )

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

  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.topicTalosResourceName = TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAttribute = TopicAttribute()
          self.topicAttribute.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('ChangeTopicAttributeRequest')
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 1)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.topicAttribute is not None:
      oprot.writeFieldBegin('topicAttribute', TType.STRUCT, 2)
      self.topicAttribute.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.topicAttribute)
    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 DescribeTopicRequest:
  """
  Attributes:
   - topicName: Topic name;

  """

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

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    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 GetDescribeInfoRequest:
  """
  Attributes:
   - topicName: Topic name;

  """

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

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    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 GetTopicAttributeRequest:
  """
  Attributes:
   - topicName: Topic name;

  """

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

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicName)
    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 AddSubResourceNameRequest:
  """
  Attributes:
   - topicTalosResourceName: Add subResourceName for specified resourceName, after 'addSubResourceName',
  one can visit topic by a Role of Cloud-Manager with specified teamId

   - orgId: OrgId which the topic transfer to, must starts with 'CL'

   - adminTeamId: TeamId which specified the admin of the topic, must starts with 'CI'

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRING, 'orgId', None, None, ), # 2
    (3, TType.STRING, 'adminTeamId', None, None, ), # 3
  )

  def __init__(self, topicTalosResourceName=None, orgId=None, adminTeamId=None,):
    self.topicTalosResourceName = topicTalosResourceName
    self.orgId = orgId
    self.adminTeamId = adminTeamId

  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.topicTalosResourceName = TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.orgId = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.adminTeamId = 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('AddSubResourceNameRequest')
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 1)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.orgId is not None:
      oprot.writeFieldBegin('orgId', TType.STRING, 2)
      oprot.writeString(self.orgId)
      oprot.writeFieldEnd()
    if self.adminTeamId is not None:
      oprot.writeFieldBegin('adminTeamId', TType.STRING, 3)
      oprot.writeString(self.adminTeamId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.orgId)
    value = (value * 31) ^ hash(self.adminTeamId)
    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 DescribeTopicResponse:
  """
  Attributes:
   - topicInfo: Topic info;

   - topicAttribute: Topic attribute;

   - topicState: Topic state;

   - topicQuota: Topic quota;

   - aclMap: Topic Acl

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicInfo', (TopicInfo, TopicInfo.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'topicAttribute', (TopicAttribute, TopicAttribute.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'topicState', (TopicState, TopicState.thrift_spec), None, ), # 3
    (4, TType.STRUCT, 'topicQuota', (talos.thrift.quota.ttypes.BaseQuota, talos.thrift.quota.ttypes.BaseQuota.thrift_spec), None, ), # 4
    (5, TType.MAP, 'aclMap', (TType.STRING,None,TType.I32,None), None, ), # 5
  )

  def __init__(self, topicInfo=None, topicAttribute=None, topicState=None, topicQuota=None, aclMap=None,):
    self.topicInfo = topicInfo
    self.topicAttribute = topicAttribute
    self.topicState = topicState
    self.topicQuota = topicQuota
    self.aclMap = aclMap

  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.topicInfo = TopicInfo()
          self.topicInfo.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAttribute = TopicAttribute()
          self.topicAttribute.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.topicState = TopicState()
          self.topicState.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.topicQuota = talos.thrift.quota.ttypes.BaseQuota()
          self.topicQuota.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.MAP:
          self.aclMap = {}
          (_ktype35, _vtype36, _size34 ) = iprot.readMapBegin()
          for _i38 in range(_size34):
            _key39 = iprot.readString()
            _val40 = iprot.readI32()
            self.aclMap[_key39] = _val40
          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('DescribeTopicResponse')
    if self.topicInfo is not None:
      oprot.writeFieldBegin('topicInfo', TType.STRUCT, 1)
      self.topicInfo.write(oprot)
      oprot.writeFieldEnd()
    if self.topicAttribute is not None:
      oprot.writeFieldBegin('topicAttribute', TType.STRUCT, 2)
      self.topicAttribute.write(oprot)
      oprot.writeFieldEnd()
    if self.topicState is not None:
      oprot.writeFieldBegin('topicState', TType.STRUCT, 3)
      self.topicState.write(oprot)
      oprot.writeFieldEnd()
    if self.topicQuota is not None:
      oprot.writeFieldBegin('topicQuota', TType.STRUCT, 4)
      self.topicQuota.write(oprot)
      oprot.writeFieldEnd()
    if self.aclMap is not None:
      oprot.writeFieldBegin('aclMap', TType.MAP, 5)
      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.aclMap))
      for kiter41,viter42 in self.aclMap.items():
        oprot.writeString(kiter41)
        oprot.writeI32(viter42)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.topicInfo is None:
      raise TProtocol.TProtocolException(message='Required field topicInfo is unset!')
    if self.topicAttribute is None:
      raise TProtocol.TProtocolException(message='Required field topicAttribute is unset!')
    if self.topicState is None:
      raise TProtocol.TProtocolException(message='Required field topicState is unset!')
    if self.topicQuota is None:
      raise TProtocol.TProtocolException(message='Required field topicQuota is unset!')
    if self.aclMap is None:
      raise TProtocol.TProtocolException(message='Required field aclMap is unset!')
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicInfo)
    value = (value * 31) ^ hash(self.topicAttribute)
    value = (value * 31) ^ hash(self.topicState)
    value = (value * 31) ^ hash(self.topicQuota)
    value = (value * 31) ^ hash(self.aclMap)
    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 GetDescribeInfoResponse:
  """
  Attributes:
   - topicTalosResourceName: Topic resourceName;

   - partitionNumber: Topic partitionNumber;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.I32, 'partitionNumber', None, None, ), # 2
  )

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

  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.topicTalosResourceName = TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.partitionNumber = 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('GetDescribeInfoResponse')
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 1)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.partitionNumber is not None:
      oprot.writeFieldBegin('partitionNumber', TType.I32, 2)
      oprot.writeI32(self.partitionNumber)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.partitionNumber)
    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 GetTopicAttributeResponse:
  """
  Attributes:
   - topicTalosResourceName: Topic resourceName;

   - topicAttribute: Topic Attribute;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicTalosResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'topicAttribute', (TopicAttribute, TopicAttribute.thrift_spec), None, ), # 2
  )

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

  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.topicTalosResourceName = TopicTalosResourceName()
          self.topicTalosResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicAttribute = TopicAttribute()
          self.topicAttribute.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('GetTopicAttributeResponse')
    if self.topicTalosResourceName is not None:
      oprot.writeFieldBegin('topicTalosResourceName', TType.STRUCT, 1)
      self.topicTalosResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.topicAttribute is not None:
      oprot.writeFieldBegin('topicAttribute', TType.STRUCT, 2)
      self.topicAttribute.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicTalosResourceName)
    value = (value * 31) ^ hash(self.topicAttribute)
    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 ListTopicsResponse:
  """
  Attributes:
   - topicInfos: The topicInfos;

  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'topicInfos', (TType.STRUCT,(TopicInfo, TopicInfo.thrift_spec)), None, ), # 1
  )

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

  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.topicInfos = []
          (_etype46, _size43) = iprot.readListBegin()
          for _i47 in range(_size43):
            _elem48 = TopicInfo()
            _elem48.read(iprot)
            self.topicInfos.append(_elem48)
          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('ListTopicsResponse')
    if self.topicInfos is not None:
      oprot.writeFieldBegin('topicInfos', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.topicInfos))
      for iter49 in self.topicInfos:
        iter49.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicInfos)
    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 ListTopicsInfoResponse:
  """
  Attributes:
   - topicList: The topics' information;

  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'topicList', (TType.STRUCT,(Topic, Topic.thrift_spec)), None, ), # 1
  )

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

  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.topicList = []
          (_etype53, _size50) = iprot.readListBegin()
          for _i54 in range(_size50):
            _elem55 = Topic()
            _elem55.read(iprot)
            self.topicList.append(_elem55)
          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('ListTopicsInfoResponse')
    if self.topicList is not None:
      oprot.writeFieldBegin('topicList', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.topicList))
      for iter56 in self.topicList:
        iter56.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicList)
    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 SetTopicQuotaRequest:
  """
  Attributes:
   - topicResourceName: The topic resource name

   - topicQuota: The topic quota

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'topicQuota', (talos.thrift.quota.ttypes.BaseQuota, talos.thrift.quota.ttypes.BaseQuota.thrift_spec), None, ), # 2
  )

  def __init__(self, topicResourceName=None, topicQuota=None,):
    self.topicResourceName = topicResourceName
    self.topicQuota = topicQuota

  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.topicResourceName = TopicTalosResourceName()
          self.topicResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.topicQuota = talos.thrift.quota.ttypes.BaseQuota()
          self.topicQuota.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('SetTopicQuotaRequest')
    if self.topicResourceName is not None:
      oprot.writeFieldBegin('topicResourceName', TType.STRUCT, 1)
      self.topicResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.topicQuota is not None:
      oprot.writeFieldBegin('topicQuota', TType.STRUCT, 2)
      self.topicQuota.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    value = (value * 31) ^ hash(self.topicQuota)
    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 QueryTopicQuotaRequest:
  """
  Attributes:
   - topicResourceName: The topic resource name

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
  )

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    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 QueryTopicQuotaResponse:
  """
  Attributes:
   - topicQuota: The topic quota

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicQuota', (talos.thrift.quota.ttypes.BaseQuota, talos.thrift.quota.ttypes.BaseQuota.thrift_spec), None, ), # 1
  )

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

  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.topicQuota = talos.thrift.quota.ttypes.BaseQuota()
          self.topicQuota.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('QueryTopicQuotaResponse')
    if self.topicQuota is not None:
      oprot.writeFieldBegin('topicQuota', TType.STRUCT, 1)
      self.topicQuota.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicQuota)
    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 DeleteTopicQuotaRequest:
  """
  Attributes:
   - topicResourceName: The topic resource name

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
  )

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    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 SetPermissionRequest:
  """
  Attributes:
   - topicResourceName: Topic resource name for which to set permission;

   - grant: The Grantee to set permission;
  the Grantee must be specified a appId or accountId.
  we support for cross-authorization based on 'accountId'

   - permission: The permission to set;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'grant', (talos.thrift.authorization.ttypes.Grantee, talos.thrift.authorization.ttypes.Grantee.thrift_spec), None, ), # 2
    (3, TType.I32, 'permission', None, None, ), # 3
  )

  def __init__(self, topicResourceName=None, grant=None, permission=None,):
    self.topicResourceName = topicResourceName
    self.grant = grant
    self.permission = permission

  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.topicResourceName = TopicTalosResourceName()
          self.topicResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.grant = talos.thrift.authorization.ttypes.Grantee()
          self.grant.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.permission = 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('SetPermissionRequest')
    if self.topicResourceName is not None:
      oprot.writeFieldBegin('topicResourceName', TType.STRUCT, 1)
      self.topicResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.grant is not None:
      oprot.writeFieldBegin('grant', TType.STRUCT, 2)
      self.grant.write(oprot)
      oprot.writeFieldEnd()
    if self.permission is not None:
      oprot.writeFieldBegin('permission', TType.I32, 3)
      oprot.writeI32(self.permission)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    value = (value * 31) ^ hash(self.grant)
    value = (value * 31) ^ hash(self.permission)
    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 RevokePermissionRequest:
  """
  Attributes:
   - topicResourceName: Topic resource name for which to revoke permission;

   - grant: The Grantee to revoke permission;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'grant', (talos.thrift.authorization.ttypes.Grantee, talos.thrift.authorization.ttypes.Grantee.thrift_spec), None, ), # 2
  )

  def __init__(self, topicResourceName=None, grant=None,):
    self.topicResourceName = topicResourceName
    self.grant = grant

  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.topicResourceName = TopicTalosResourceName()
          self.topicResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.grant = talos.thrift.authorization.ttypes.Grantee()
          self.grant.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('RevokePermissionRequest')
    if self.topicResourceName is not None:
      oprot.writeFieldBegin('topicResourceName', TType.STRUCT, 1)
      self.topicResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.grant is not None:
      oprot.writeFieldBegin('grant', TType.STRUCT, 2)
      self.grant.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    value = (value * 31) ^ hash(self.grant)
    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 ListPermissionRequest:
  """
  Attributes:
   - topicResourceName: Topic resource name for which to list permission;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
  )

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

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

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    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 ListPermissionResponse:
  """
  Attributes:
   - permissions: The principal string to permission value map;

  """

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

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

  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.permissions = {}
          (_ktype58, _vtype59, _size57 ) = iprot.readMapBegin()
          for _i61 in range(_size57):
            _key62 = iprot.readString()
            _val63 = iprot.readI32()
            self.permissions[_key62] = _val63
          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('ListPermissionResponse')
    if self.permissions is not None:
      oprot.writeFieldBegin('permissions', TType.MAP, 1)
      oprot.writeMapBegin(TType.STRING, TType.I32, len(self.permissions))
      for kiter64,viter65 in self.permissions.items():
        oprot.writeString(kiter64)
        oprot.writeI32(viter65)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.permissions)
    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 GetPermissionRequest:
  """
  Attributes:
   - topicResourceName: Topic resource name for which to get permission;

   - grant: The Grantee to get permission;

  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'topicResourceName', (TopicTalosResourceName, TopicTalosResourceName.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'grant', (talos.thrift.authorization.ttypes.Grantee, talos.thrift.authorization.ttypes.Grantee.thrift_spec), None, ), # 2
  )

  def __init__(self, topicResourceName=None, grant=None,):
    self.topicResourceName = topicResourceName
    self.grant = grant

  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.topicResourceName = TopicTalosResourceName()
          self.topicResourceName.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.grant = talos.thrift.authorization.ttypes.Grantee()
          self.grant.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('GetPermissionRequest')
    if self.topicResourceName is not None:
      oprot.writeFieldBegin('topicResourceName', TType.STRUCT, 1)
      self.topicResourceName.write(oprot)
      oprot.writeFieldEnd()
    if self.grant is not None:
      oprot.writeFieldBegin('grant', TType.STRUCT, 2)
      self.grant.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

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


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.topicResourceName)
    value = (value * 31) ^ hash(self.grant)
    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 GetPermissionResponse:
  """
  Attributes:
   - permission: The permission;

  """

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

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

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

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


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