#
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import koverse.thriftgen.security.ttypes
import koverse.thriftgen.ttypes


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



class TGroup:
  """
  Attributes:
   - id
   - name
   - disabled
   - addToNewUsers
   - permissions
   - authorizerGroupId
   - authorizerTypeId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.STRING, 'name', None, None, ), # 2
    (3, TType.BOOL, 'disabled', None, None, ), # 3
    (4, TType.BOOL, 'addToNewUsers', None, None, ), # 4
    (5, TType.SET, 'permissions', (TType.STRING,None), None, ), # 5
    (6, TType.STRING, 'authorizerGroupId', None, None, ), # 6
    (7, TType.STRING, 'authorizerTypeId', None, None, ), # 7
  )

  def __init__(self, id=None, name=None, disabled=None, addToNewUsers=None, permissions=None, authorizerGroupId=None, authorizerTypeId=None,):
    self.id = id
    self.name = name
    self.disabled = disabled
    self.addToNewUsers = addToNewUsers
    self.permissions = permissions
    self.authorizerGroupId = authorizerGroupId
    self.authorizerTypeId = authorizerTypeId

  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.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.disabled = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.BOOL:
          self.addToNewUsers = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.SET:
          self.permissions = set()
          (_etype3, _size0) = iprot.readSetBegin()
          for _i4 in xrange(_size0):
            _elem5 = iprot.readString();
            self.permissions.add(_elem5)
          iprot.readSetEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.authorizerGroupId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.authorizerTypeId = 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('TGroup')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 2)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.disabled is not None:
      oprot.writeFieldBegin('disabled', TType.BOOL, 3)
      oprot.writeBool(self.disabled)
      oprot.writeFieldEnd()
    if self.addToNewUsers is not None:
      oprot.writeFieldBegin('addToNewUsers', TType.BOOL, 4)
      oprot.writeBool(self.addToNewUsers)
      oprot.writeFieldEnd()
    if self.permissions is not None:
      oprot.writeFieldBegin('permissions', TType.SET, 5)
      oprot.writeSetBegin(TType.STRING, len(self.permissions))
      for iter6 in self.permissions:
        oprot.writeString(iter6)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    if self.authorizerGroupId is not None:
      oprot.writeFieldBegin('authorizerGroupId', TType.STRING, 6)
      oprot.writeString(self.authorizerGroupId)
      oprot.writeFieldEnd()
    if self.authorizerTypeId is not None:
      oprot.writeFieldBegin('authorizerTypeId', TType.STRING, 7)
      oprot.writeString(self.authorizerTypeId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TUser:
  """
  Attributes:
   - id
   - firstName
   - lastName
   - emailAddress
   - groupIds
   - tokens
   - disabled
   - creationTime
   - authenticatorUserId
   - authenticatorTypeId
   - externalGroupIds
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.STRING, 'firstName', None, None, ), # 2
    (3, TType.STRING, 'lastName', None, None, ), # 3
    (4, TType.STRING, 'emailAddress', None, None, ), # 4
    (5, TType.SET, 'groupIds', (TType.I64,None), None, ), # 5
    (6, TType.SET, 'tokens', (TType.STRING,None), None, ), # 6
    (7, TType.BOOL, 'disabled', None, None, ), # 7
    (8, TType.I64, 'creationTime', None, None, ), # 8
    (9, TType.STRING, 'authenticatorUserId', None, None, ), # 9
    (10, TType.STRING, 'authenticatorTypeId', None, None, ), # 10
    (11, TType.SET, 'externalGroupIds', (TType.I64,None), None, ), # 11
  )

  def __init__(self, id=None, firstName=None, lastName=None, emailAddress=None, groupIds=None, tokens=None, disabled=None, creationTime=None, authenticatorUserId=None, authenticatorTypeId=None, externalGroupIds=None,):
    self.id = id
    self.firstName = firstName
    self.lastName = lastName
    self.emailAddress = emailAddress
    self.groupIds = groupIds
    self.tokens = tokens
    self.disabled = disabled
    self.creationTime = creationTime
    self.authenticatorUserId = authenticatorUserId
    self.authenticatorTypeId = authenticatorTypeId
    self.externalGroupIds = externalGroupIds

  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.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.firstName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.lastName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.emailAddress = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.SET:
          self.groupIds = set()
          (_etype10, _size7) = iprot.readSetBegin()
          for _i11 in xrange(_size7):
            _elem12 = iprot.readI64();
            self.groupIds.add(_elem12)
          iprot.readSetEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.SET:
          self.tokens = set()
          (_etype16, _size13) = iprot.readSetBegin()
          for _i17 in xrange(_size13):
            _elem18 = iprot.readString();
            self.tokens.add(_elem18)
          iprot.readSetEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.disabled = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I64:
          self.creationTime = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.authenticatorUserId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.authenticatorTypeId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.SET:
          self.externalGroupIds = set()
          (_etype22, _size19) = iprot.readSetBegin()
          for _i23 in xrange(_size19):
            _elem24 = iprot.readI64();
            self.externalGroupIds.add(_elem24)
          iprot.readSetEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TUser')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.firstName is not None:
      oprot.writeFieldBegin('firstName', TType.STRING, 2)
      oprot.writeString(self.firstName)
      oprot.writeFieldEnd()
    if self.lastName is not None:
      oprot.writeFieldBegin('lastName', TType.STRING, 3)
      oprot.writeString(self.lastName)
      oprot.writeFieldEnd()
    if self.emailAddress is not None:
      oprot.writeFieldBegin('emailAddress', TType.STRING, 4)
      oprot.writeString(self.emailAddress)
      oprot.writeFieldEnd()
    if self.groupIds is not None:
      oprot.writeFieldBegin('groupIds', TType.SET, 5)
      oprot.writeSetBegin(TType.I64, len(self.groupIds))
      for iter25 in self.groupIds:
        oprot.writeI64(iter25)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    if self.tokens is not None:
      oprot.writeFieldBegin('tokens', TType.SET, 6)
      oprot.writeSetBegin(TType.STRING, len(self.tokens))
      for iter26 in self.tokens:
        oprot.writeString(iter26)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    if self.disabled is not None:
      oprot.writeFieldBegin('disabled', TType.BOOL, 7)
      oprot.writeBool(self.disabled)
      oprot.writeFieldEnd()
    if self.creationTime is not None:
      oprot.writeFieldBegin('creationTime', TType.I64, 8)
      oprot.writeI64(self.creationTime)
      oprot.writeFieldEnd()
    if self.authenticatorUserId is not None:
      oprot.writeFieldBegin('authenticatorUserId', TType.STRING, 9)
      oprot.writeString(self.authenticatorUserId)
      oprot.writeFieldEnd()
    if self.authenticatorTypeId is not None:
      oprot.writeFieldBegin('authenticatorTypeId', TType.STRING, 10)
      oprot.writeString(self.authenticatorTypeId)
      oprot.writeFieldEnd()
    if self.externalGroupIds is not None:
      oprot.writeFieldBegin('externalGroupIds', TType.SET, 11)
      oprot.writeSetBegin(TType.I64, len(self.externalGroupIds))
      for iter27 in self.externalGroupIds:
        oprot.writeI64(iter27)
      oprot.writeSetEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TAuthenticator:
  """
  Attributes:
   - typeId
   - displayName
   - parameters
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'typeId', None, None, ), # 1
    (2, TType.STRING, 'displayName', None, None, ), # 2
    (3, TType.LIST, 'parameters', (TType.STRUCT,(koverse.thriftgen.ttypes.TParameter, koverse.thriftgen.ttypes.TParameter.thrift_spec)), None, ), # 3
  )

  def __init__(self, typeId=None, displayName=None, parameters=None,):
    self.typeId = typeId
    self.displayName = displayName
    self.parameters = parameters

  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.typeId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.displayName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.parameters = []
          (_etype31, _size28) = iprot.readListBegin()
          for _i32 in xrange(_size28):
            _elem33 = koverse.thriftgen.ttypes.TParameter()
            _elem33.read(iprot)
            self.parameters.append(_elem33)
          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('TAuthenticator')
    if self.typeId is not None:
      oprot.writeFieldBegin('typeId', TType.STRING, 1)
      oprot.writeString(self.typeId)
      oprot.writeFieldEnd()
    if self.displayName is not None:
      oprot.writeFieldBegin('displayName', TType.STRING, 2)
      oprot.writeString(self.displayName)
      oprot.writeFieldEnd()
    if self.parameters is not None:
      oprot.writeFieldBegin('parameters', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.parameters))
      for iter34 in self.parameters:
        iter34.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TAuthenticatorDescriptor:
  """
  Attributes:
   - displayName
   - authenticatorClassName
   - typeId
   - configurationParameters
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'displayName', None, None, ), # 1
    (2, TType.STRING, 'authenticatorClassName', None, None, ), # 2
    (3, TType.STRING, 'typeId', None, None, ), # 3
    (4, TType.LIST, 'configurationParameters', (TType.STRUCT,(koverse.thriftgen.ttypes.TParameter, koverse.thriftgen.ttypes.TParameter.thrift_spec)), None, ), # 4
  )

  def __init__(self, displayName=None, authenticatorClassName=None, typeId=None, configurationParameters=None,):
    self.displayName = displayName
    self.authenticatorClassName = authenticatorClassName
    self.typeId = typeId
    self.configurationParameters = configurationParameters

  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.displayName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.authenticatorClassName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.typeId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.configurationParameters = []
          (_etype38, _size35) = iprot.readListBegin()
          for _i39 in xrange(_size35):
            _elem40 = koverse.thriftgen.ttypes.TParameter()
            _elem40.read(iprot)
            self.configurationParameters.append(_elem40)
          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('TAuthenticatorDescriptor')
    if self.displayName is not None:
      oprot.writeFieldBegin('displayName', TType.STRING, 1)
      oprot.writeString(self.displayName)
      oprot.writeFieldEnd()
    if self.authenticatorClassName is not None:
      oprot.writeFieldBegin('authenticatorClassName', TType.STRING, 2)
      oprot.writeString(self.authenticatorClassName)
      oprot.writeFieldEnd()
    if self.typeId is not None:
      oprot.writeFieldBegin('typeId', TType.STRING, 3)
      oprot.writeString(self.typeId)
      oprot.writeFieldEnd()
    if self.configurationParameters is not None:
      oprot.writeFieldBegin('configurationParameters', TType.LIST, 4)
      oprot.writeListBegin(TType.STRUCT, len(self.configurationParameters))
      for iter41 in self.configurationParameters:
        iter41.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TAuthorizationDescriptor:
  """
  Attributes:
   - displayName
   - authorizerClassName
   - typeId
   - configurationParameters
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'displayName', None, None, ), # 1
    (2, TType.STRING, 'authorizerClassName', None, None, ), # 2
    (3, TType.STRING, 'typeId', None, None, ), # 3
    (4, TType.LIST, 'configurationParameters', (TType.STRUCT,(koverse.thriftgen.ttypes.TParameter, koverse.thriftgen.ttypes.TParameter.thrift_spec)), None, ), # 4
  )

  def __init__(self, displayName=None, authorizerClassName=None, typeId=None, configurationParameters=None,):
    self.displayName = displayName
    self.authorizerClassName = authorizerClassName
    self.typeId = typeId
    self.configurationParameters = configurationParameters

  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.displayName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.authorizerClassName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.typeId = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.configurationParameters = []
          (_etype45, _size42) = iprot.readListBegin()
          for _i46 in xrange(_size42):
            _elem47 = koverse.thriftgen.ttypes.TParameter()
            _elem47.read(iprot)
            self.configurationParameters.append(_elem47)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TAuthorizationDescriptor')
    if self.displayName is not None:
      oprot.writeFieldBegin('displayName', TType.STRING, 1)
      oprot.writeString(self.displayName)
      oprot.writeFieldEnd()
    if self.authorizerClassName is not None:
      oprot.writeFieldBegin('authorizerClassName', TType.STRING, 2)
      oprot.writeString(self.authorizerClassName)
      oprot.writeFieldEnd()
    if self.typeId is not None:
      oprot.writeFieldBegin('typeId', TType.STRING, 3)
      oprot.writeString(self.typeId)
      oprot.writeFieldEnd()
    if self.configurationParameters is not None:
      oprot.writeFieldBegin('configurationParameters', TType.LIST, 4)
      oprot.writeListBegin(TType.STRUCT, len(self.configurationParameters))
      for iter48 in self.configurationParameters:
        iter48.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TGroupStaticPermission:
  """
  Attributes:
   - id
   - name
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.STRING, 'name', None, None, ), # 2
  )

  def __init__(self, id=None, name=None,):
    self.id = id
    self.name = name

  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.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.name = 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('TGroupStaticPermission')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 2)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class TAPIToken:
  """
  Attributes:
   - id
   - responsibleUserId
   - disabled
   - creationDate
   - disabledDate
   - displayName
   - groupIds
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'id', None, None, ), # 1
    (2, TType.I64, 'responsibleUserId', None, None, ), # 2
    (3, TType.BOOL, 'disabled', None, None, ), # 3
    (4, TType.I64, 'creationDate', None, None, ), # 4
    (5, TType.I64, 'disabledDate', None, None, ), # 5
    (6, TType.STRING, 'displayName', None, None, ), # 6
    (7, TType.LIST, 'groupIds', (TType.I64,None), None, ), # 7
  )

  def __init__(self, id=None, responsibleUserId=None, disabled=None, creationDate=None, disabledDate=None, displayName=None, groupIds=None,):
    self.id = id
    self.responsibleUserId = responsibleUserId
    self.disabled = disabled
    self.creationDate = creationDate
    self.disabledDate = disabledDate
    self.displayName = displayName
    self.groupIds = groupIds

  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.id = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.responsibleUserId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.disabled = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.creationDate = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.disabledDate = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.displayName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.LIST:
          self.groupIds = []
          (_etype52, _size49) = iprot.readListBegin()
          for _i53 in xrange(_size49):
            _elem54 = iprot.readI64();
            self.groupIds.append(_elem54)
          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('TAPIToken')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.STRING, 1)
      oprot.writeString(self.id)
      oprot.writeFieldEnd()
    if self.responsibleUserId is not None:
      oprot.writeFieldBegin('responsibleUserId', TType.I64, 2)
      oprot.writeI64(self.responsibleUserId)
      oprot.writeFieldEnd()
    if self.disabled is not None:
      oprot.writeFieldBegin('disabled', TType.BOOL, 3)
      oprot.writeBool(self.disabled)
      oprot.writeFieldEnd()
    if self.creationDate is not None:
      oprot.writeFieldBegin('creationDate', TType.I64, 4)
      oprot.writeI64(self.creationDate)
      oprot.writeFieldEnd()
    if self.disabledDate is not None:
      oprot.writeFieldBegin('disabledDate', TType.I64, 5)
      oprot.writeI64(self.disabledDate)
      oprot.writeFieldEnd()
    if self.displayName is not None:
      oprot.writeFieldBegin('displayName', TType.STRING, 6)
      oprot.writeString(self.displayName)
      oprot.writeFieldEnd()
    if self.groupIds is not None:
      oprot.writeFieldBegin('groupIds', TType.LIST, 7)
      oprot.writeListBegin(TType.I64, len(self.groupIds))
      for iter55 in self.groupIds:
        oprot.writeI64(iter55)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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