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

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys
import koverse.thriftgen.security.ttypes
import koverse.thriftgen.ttypes

from thrift.transport import TTransport
all_structs = []


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


    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._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else 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 range(_size0):
                        _elem5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.permissions.add(_elem5)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.authorizerGroupId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.authorizerTypeId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else 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.encode('utf-8') if sys.version_info[0] == 2 else iter6)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.authorizerGroupId is not None:
            oprot.writeFieldBegin('authorizerGroupId', TType.STRING, 6)
            oprot.writeString(self.authorizerGroupId.encode('utf-8') if sys.version_info[0] == 2 else self.authorizerGroupId)
            oprot.writeFieldEnd()
        if self.authorizerTypeId is not None:
            oprot.writeFieldBegin('authorizerTypeId', TType.STRING, 7)
            oprot.writeString(self.authorizerTypeId.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TUser(object):
    """
    Attributes:
     - id
     - firstName
     - lastName
     - emailAddress
     - groupIds
     - tokens
     - disabled
     - creationTime
     - authenticatorUserId
     - authenticatorTypeId
     - externalGroupIds
    """


    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._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.lastName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.emailAddress = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.SET:
                    self.groupIds = set()
                    (_etype10, _size7) = iprot.readSetBegin()
                    for _i11 in range(_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 range(_size13):
                        _elem18 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else 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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.STRING:
                    self.authenticatorTypeId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.SET:
                    self.externalGroupIds = set()
                    (_etype22, _size19) = iprot.readSetBegin()
                    for _i23 in range(_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._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else self.firstName)
            oprot.writeFieldEnd()
        if self.lastName is not None:
            oprot.writeFieldBegin('lastName', TType.STRING, 3)
            oprot.writeString(self.lastName.encode('utf-8') if sys.version_info[0] == 2 else self.lastName)
            oprot.writeFieldEnd()
        if self.emailAddress is not None:
            oprot.writeFieldBegin('emailAddress', TType.STRING, 4)
            oprot.writeString(self.emailAddress.encode('utf-8') if sys.version_info[0] == 2 else 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.encode('utf-8') if sys.version_info[0] == 2 else 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.encode('utf-8') if sys.version_info[0] == 2 else self.authenticatorUserId)
            oprot.writeFieldEnd()
        if self.authenticatorTypeId is not None:
            oprot.writeFieldBegin('authenticatorTypeId', TType.STRING, 10)
            oprot.writeString(self.authenticatorTypeId.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TAuthenticator(object):
    """
    Attributes:
     - typeId
     - displayName
     - parameters
    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.displayName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.parameters = []
                    (_etype31, _size28) = iprot.readListBegin()
                    for _i32 in range(_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._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else self.typeId)
            oprot.writeFieldEnd()
        if self.displayName is not None:
            oprot.writeFieldBegin('displayName', TType.STRING, 2)
            oprot.writeString(self.displayName.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TAuthenticatorDescriptor(object):
    """
    Attributes:
     - displayName
     - authenticatorClassName
     - typeId
     - configurationParameters
    """


    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._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.authenticatorClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.typeId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.configurationParameters = []
                    (_etype38, _size35) = iprot.readListBegin()
                    for _i39 in range(_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._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else self.displayName)
            oprot.writeFieldEnd()
        if self.authenticatorClassName is not None:
            oprot.writeFieldBegin('authenticatorClassName', TType.STRING, 2)
            oprot.writeString(self.authenticatorClassName.encode('utf-8') if sys.version_info[0] == 2 else self.authenticatorClassName)
            oprot.writeFieldEnd()
        if self.typeId is not None:
            oprot.writeFieldBegin('typeId', TType.STRING, 3)
            oprot.writeString(self.typeId.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TAuthorizationDescriptor(object):
    """
    Attributes:
     - displayName
     - authorizerClassName
     - typeId
     - configurationParameters
    """


    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._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.authorizerClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.typeId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.configurationParameters = []
                    (_etype45, _size42) = iprot.readListBegin()
                    for _i46 in range(_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._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else self.displayName)
            oprot.writeFieldEnd()
        if self.authorizerClassName is not None:
            oprot.writeFieldBegin('authorizerClassName', TType.STRING, 2)
            oprot.writeString(self.authorizerClassName.encode('utf-8') if sys.version_info[0] == 2 else self.authorizerClassName)
            oprot.writeFieldEnd()
        if self.typeId is not None:
            oprot.writeFieldBegin('typeId', TType.STRING, 3)
            oprot.writeString(self.typeId.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TAPIToken(object):
    """
    Attributes:
     - id
     - responsibleUserId
     - disabled
     - creationDate
     - disabledDate
     - displayName
     - groupIds
    """


    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._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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().decode('utf-8') if sys.version_info[0] == 2 else 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().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.LIST:
                    self.groupIds = []
                    (_etype52, _size49) = iprot.readListBegin()
                    for _i53 in range(_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._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(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.encode('utf-8') if sys.version_info[0] == 2 else 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.encode('utf-8') if sys.version_info[0] == 2 else 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__.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 TSystemPermission(object):
    """
    Attributes:
     - name
     - description
    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSystemPermission')
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 1)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 2)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    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)
all_structs.append(TGroup)
TGroup.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.BOOL, 'disabled', None, None, ),  # 3
    (4, TType.BOOL, 'addToNewUsers', None, None, ),  # 4
    (5, TType.SET, 'permissions', (TType.STRING, 'UTF8', False), None, ),  # 5
    (6, TType.STRING, 'authorizerGroupId', 'UTF8', None, ),  # 6
    (7, TType.STRING, 'authorizerTypeId', 'UTF8', None, ),  # 7
)
all_structs.append(TUser)
TUser.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.STRING, 'firstName', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'lastName', 'UTF8', None, ),  # 3
    (4, TType.STRING, 'emailAddress', 'UTF8', None, ),  # 4
    (5, TType.SET, 'groupIds', (TType.I64, None, False), None, ),  # 5
    (6, TType.SET, 'tokens', (TType.STRING, 'UTF8', False), None, ),  # 6
    (7, TType.BOOL, 'disabled', None, None, ),  # 7
    (8, TType.I64, 'creationTime', None, None, ),  # 8
    (9, TType.STRING, 'authenticatorUserId', 'UTF8', None, ),  # 9
    (10, TType.STRING, 'authenticatorTypeId', 'UTF8', None, ),  # 10
    (11, TType.SET, 'externalGroupIds', (TType.I64, None, False), None, ),  # 11
)
all_structs.append(TAuthenticator)
TAuthenticator.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'typeId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'displayName', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'parameters', (TType.STRUCT, [koverse.thriftgen.ttypes.TParameter, None], False), None, ),  # 3
)
all_structs.append(TAuthenticatorDescriptor)
TAuthenticatorDescriptor.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'displayName', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'authenticatorClassName', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'typeId', 'UTF8', None, ),  # 3
    (4, TType.LIST, 'configurationParameters', (TType.STRUCT, [koverse.thriftgen.ttypes.TParameter, None], False), None, ),  # 4
)
all_structs.append(TAuthorizationDescriptor)
TAuthorizationDescriptor.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'displayName', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'authorizerClassName', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'typeId', 'UTF8', None, ),  # 3
    (4, TType.LIST, 'configurationParameters', (TType.STRUCT, [koverse.thriftgen.ttypes.TParameter, None], False), None, ),  # 4
)
all_structs.append(TAPIToken)
TAPIToken.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'id', 'UTF8', 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', 'UTF8', None, ),  # 6
    (7, TType.LIST, 'groupIds', (TType.I64, None, False), None, ),  # 7
)
all_structs.append(TSystemPermission)
TSystemPermission.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'name', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'description', 'UTF8', None, ),  # 2
)
fix_spec(all_structs)
del all_structs
