#
# 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
     - datasetPermissions
    """


    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, datasetPermissions=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
        self.datasetPermissions = datasetPermissions

    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)
            elif fid == 12:
                if ftype == TType.MAP:
                    self.datasetPermissions = {}
                    (_ktype26, _vtype27, _size25) = iprot.readMapBegin()
                    for _i29 in range(_size25):
                        _key30 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val31 = []
                        (_etype35, _size32) = iprot.readListBegin()
                        for _i36 in range(_size32):
                            _elem37 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                            _val31.append(_elem37)
                        iprot.readListEnd()
                        self.datasetPermissions[_key30] = _val31
                    iprot.readMapEnd()
                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 iter38 in self.groupIds:
                oprot.writeI64(iter38)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.tokens is not None:
            oprot.writeFieldBegin('tokens', TType.SET, 6)
            oprot.writeSetBegin(TType.STRING, len(self.tokens))
            for iter39 in self.tokens:
                oprot.writeString(iter39.encode('utf-8') if sys.version_info[0] == 2 else iter39)
            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 iter40 in self.externalGroupIds:
                oprot.writeI64(iter40)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.datasetPermissions is not None:
            oprot.writeFieldBegin('datasetPermissions', TType.MAP, 12)
            oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.datasetPermissions))
            for kiter41, viter42 in self.datasetPermissions.items():
                oprot.writeString(kiter41.encode('utf-8') if sys.version_info[0] == 2 else kiter41)
                oprot.writeListBegin(TType.STRING, len(viter42))
                for iter43 in viter42:
                    oprot.writeString(iter43.encode('utf-8') if sys.version_info[0] == 2 else iter43)
                oprot.writeListEnd()
            oprot.writeMapEnd()
            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 = []
                    (_etype47, _size44) = iprot.readListBegin()
                    for _i48 in range(_size44):
                        _elem49 = koverse.thriftgen.ttypes.TParameter()
                        _elem49.read(iprot)
                        self.parameters.append(_elem49)
                    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 iter50 in self.parameters:
                iter50.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 = []
                    (_etype54, _size51) = iprot.readListBegin()
                    for _i55 in range(_size51):
                        _elem56 = koverse.thriftgen.ttypes.TParameter()
                        _elem56.read(iprot)
                        self.configurationParameters.append(_elem56)
                    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 iter57 in self.configurationParameters:
                iter57.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 = []
                    (_etype61, _size58) = iprot.readListBegin()
                    for _i62 in range(_size58):
                        _elem63 = koverse.thriftgen.ttypes.TParameter()
                        _elem63.read(iprot)
                        self.configurationParameters.append(_elem63)
                    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 iter64 in self.configurationParameters:
                iter64.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 = []
                    (_etype68, _size65) = iprot.readListBegin()
                    for _i69 in range(_size65):
                        _elem70 = iprot.readI64()
                        self.groupIds.append(_elem70)
                    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 iter71 in self.groupIds:
                oprot.writeI64(iter71)
            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)


class TApplication(object):
    """
    Attributes:
     - id
     - clientName
     - clientSecret
     - singleUser
     - enabled
     - websiteUrl
     - redirectUrl
     - apiTokenId
    """


    def __init__(self, id=None, clientName=None, clientSecret=None, singleUser=None, enabled=None, websiteUrl=None, redirectUrl=None, apiTokenId=None,):
        self.id = id
        self.clientName = clientName
        self.clientSecret = clientSecret
        self.singleUser = singleUser
        self.enabled = enabled
        self.websiteUrl = websiteUrl
        self.redirectUrl = redirectUrl
        self.apiTokenId = apiTokenId

    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.clientName = 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.clientSecret = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.singleUser = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.enabled = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.websiteUrl = 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.redirectUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRING:
                    self.apiTokenId = 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('TApplication')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.clientName is not None:
            oprot.writeFieldBegin('clientName', TType.STRING, 2)
            oprot.writeString(self.clientName.encode('utf-8') if sys.version_info[0] == 2 else self.clientName)
            oprot.writeFieldEnd()
        if self.clientSecret is not None:
            oprot.writeFieldBegin('clientSecret', TType.STRING, 3)
            oprot.writeString(self.clientSecret.encode('utf-8') if sys.version_info[0] == 2 else self.clientSecret)
            oprot.writeFieldEnd()
        if self.singleUser is not None:
            oprot.writeFieldBegin('singleUser', TType.BOOL, 4)
            oprot.writeBool(self.singleUser)
            oprot.writeFieldEnd()
        if self.enabled is not None:
            oprot.writeFieldBegin('enabled', TType.BOOL, 5)
            oprot.writeBool(self.enabled)
            oprot.writeFieldEnd()
        if self.websiteUrl is not None:
            oprot.writeFieldBegin('websiteUrl', TType.STRING, 6)
            oprot.writeString(self.websiteUrl.encode('utf-8') if sys.version_info[0] == 2 else self.websiteUrl)
            oprot.writeFieldEnd()
        if self.redirectUrl is not None:
            oprot.writeFieldBegin('redirectUrl', TType.STRING, 7)
            oprot.writeString(self.redirectUrl.encode('utf-8') if sys.version_info[0] == 2 else self.redirectUrl)
            oprot.writeFieldEnd()
        if self.apiTokenId is not None:
            oprot.writeFieldBegin('apiTokenId', TType.STRING, 8)
            oprot.writeString(self.apiTokenId.encode('utf-8') if sys.version_info[0] == 2 else self.apiTokenId)
            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
    (12, TType.MAP, 'datasetPermissions', (TType.STRING, 'UTF8', TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 12
)
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
)
all_structs.append(TApplication)
TApplication.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.STRING, 'clientName', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'clientSecret', 'UTF8', None, ),  # 3
    (4, TType.BOOL, 'singleUser', None, None, ),  # 4
    (5, TType.BOOL, 'enabled', None, None, ),  # 5
    (6, TType.STRING, 'websiteUrl', 'UTF8', None, ),  # 6
    (7, TType.STRING, 'redirectUrl', 'UTF8', None, ),  # 7
    (8, TType.STRING, 'apiTokenId', 'UTF8', None, ),  # 8
)
fix_spec(all_structs)
del all_structs
