blob: 168037c4fdd7f25e4cd0180f40826004d18e7b77 [file] [log] [blame]
#
# Autogenerated by Thrift Compiler (0.18.1)
#
# 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 airavata.base.api.BaseAPI
import logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []
class Iface(airavata.base.api.BaseAPI.Iface):
def initializeUserProfile(self, authzToken):
"""
Create an initial UserProfile based on information in the IAM service for this user.
Parameters:
- authzToken
"""
pass
def addUserProfile(self, authzToken, userProfile):
"""
This method is deprecated and will be removed in future versions of Airavata. Please use
the initializeUserProfile method which fetches the information about the user profile from
IAM service - @Deprecated
Parameters:
- authzToken
- userProfile
"""
pass
def updateUserProfile(self, authzToken, userProfile):
"""
Parameters:
- authzToken
- userProfile
"""
pass
def getUserProfileById(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
pass
def deleteUserProfile(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
pass
def getAllUserProfilesInGateway(self, authzToken, gatewayId, offset, limit):
"""
Parameters:
- authzToken
- gatewayId
- offset
- limit
"""
pass
def doesUserExist(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
pass
class Client(airavata.base.api.BaseAPI.Client, Iface):
def __init__(self, iprot, oprot=None):
airavata.base.api.BaseAPI.Client.__init__(self, iprot, oprot)
def initializeUserProfile(self, authzToken):
"""
Create an initial UserProfile based on information in the IAM service for this user.
Parameters:
- authzToken
"""
self.send_initializeUserProfile(authzToken)
return self.recv_initializeUserProfile()
def send_initializeUserProfile(self, authzToken):
self._oprot.writeMessageBegin('initializeUserProfile', TMessageType.CALL, self._seqid)
args = initializeUserProfile_args()
args.authzToken = authzToken
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_initializeUserProfile(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = initializeUserProfile_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "initializeUserProfile failed: unknown result")
def addUserProfile(self, authzToken, userProfile):
"""
This method is deprecated and will be removed in future versions of Airavata. Please use
the initializeUserProfile method which fetches the information about the user profile from
IAM service - @Deprecated
Parameters:
- authzToken
- userProfile
"""
self.send_addUserProfile(authzToken, userProfile)
return self.recv_addUserProfile()
def send_addUserProfile(self, authzToken, userProfile):
self._oprot.writeMessageBegin('addUserProfile', TMessageType.CALL, self._seqid)
args = addUserProfile_args()
args.authzToken = authzToken
args.userProfile = userProfile
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_addUserProfile(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = addUserProfile_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "addUserProfile failed: unknown result")
def updateUserProfile(self, authzToken, userProfile):
"""
Parameters:
- authzToken
- userProfile
"""
self.send_updateUserProfile(authzToken, userProfile)
return self.recv_updateUserProfile()
def send_updateUserProfile(self, authzToken, userProfile):
self._oprot.writeMessageBegin('updateUserProfile', TMessageType.CALL, self._seqid)
args = updateUserProfile_args()
args.authzToken = authzToken
args.userProfile = userProfile
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_updateUserProfile(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = updateUserProfile_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "updateUserProfile failed: unknown result")
def getUserProfileById(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
self.send_getUserProfileById(authzToken, userId, gatewayId)
return self.recv_getUserProfileById()
def send_getUserProfileById(self, authzToken, userId, gatewayId):
self._oprot.writeMessageBegin('getUserProfileById', TMessageType.CALL, self._seqid)
args = getUserProfileById_args()
args.authzToken = authzToken
args.userId = userId
args.gatewayId = gatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_getUserProfileById(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = getUserProfileById_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserProfileById failed: unknown result")
def deleteUserProfile(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
self.send_deleteUserProfile(authzToken, userId, gatewayId)
return self.recv_deleteUserProfile()
def send_deleteUserProfile(self, authzToken, userId, gatewayId):
self._oprot.writeMessageBegin('deleteUserProfile', TMessageType.CALL, self._seqid)
args = deleteUserProfile_args()
args.authzToken = authzToken
args.userId = userId
args.gatewayId = gatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_deleteUserProfile(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = deleteUserProfile_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteUserProfile failed: unknown result")
def getAllUserProfilesInGateway(self, authzToken, gatewayId, offset, limit):
"""
Parameters:
- authzToken
- gatewayId
- offset
- limit
"""
self.send_getAllUserProfilesInGateway(authzToken, gatewayId, offset, limit)
return self.recv_getAllUserProfilesInGateway()
def send_getAllUserProfilesInGateway(self, authzToken, gatewayId, offset, limit):
self._oprot.writeMessageBegin('getAllUserProfilesInGateway', TMessageType.CALL, self._seqid)
args = getAllUserProfilesInGateway_args()
args.authzToken = authzToken
args.gatewayId = gatewayId
args.offset = offset
args.limit = limit
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_getAllUserProfilesInGateway(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = getAllUserProfilesInGateway_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUserProfilesInGateway failed: unknown result")
def doesUserExist(self, authzToken, userId, gatewayId):
"""
Parameters:
- authzToken
- userId
- gatewayId
"""
self.send_doesUserExist(authzToken, userId, gatewayId)
return self.recv_doesUserExist()
def send_doesUserExist(self, authzToken, userId, gatewayId):
self._oprot.writeMessageBegin('doesUserExist', TMessageType.CALL, self._seqid)
args = doesUserExist_args()
args.authzToken = authzToken
args.userId = userId
args.gatewayId = gatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_doesUserExist(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = doesUserExist_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.upe is not None:
raise result.upe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "doesUserExist failed: unknown result")
class Processor(airavata.base.api.BaseAPI.Processor, Iface, TProcessor):
def __init__(self, handler):
airavata.base.api.BaseAPI.Processor.__init__(self, handler)
self._processMap["initializeUserProfile"] = Processor.process_initializeUserProfile
self._processMap["addUserProfile"] = Processor.process_addUserProfile
self._processMap["updateUserProfile"] = Processor.process_updateUserProfile
self._processMap["getUserProfileById"] = Processor.process_getUserProfileById
self._processMap["deleteUserProfile"] = Processor.process_deleteUserProfile
self._processMap["getAllUserProfilesInGateway"] = Processor.process_getAllUserProfilesInGateway
self._processMap["doesUserExist"] = Processor.process_doesUserExist
self._on_message_begin = None
def on_message_begin(self, func):
self._on_message_begin = func
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
if self._on_message_begin:
self._on_message_begin(name, type, seqid)
if name not in self._processMap:
iprot.skip(TType.STRUCT)
iprot.readMessageEnd()
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
x.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
return
else:
self._processMap[name](self, seqid, iprot, oprot)
return True
def process_initializeUserProfile(self, seqid, iprot, oprot):
args = initializeUserProfile_args()
args.read(iprot)
iprot.readMessageEnd()
result = initializeUserProfile_result()
try:
result.success = self._handler.initializeUserProfile(args.authzToken)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("initializeUserProfile", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_addUserProfile(self, seqid, iprot, oprot):
args = addUserProfile_args()
args.read(iprot)
iprot.readMessageEnd()
result = addUserProfile_result()
try:
result.success = self._handler.addUserProfile(args.authzToken, args.userProfile)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("addUserProfile", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_updateUserProfile(self, seqid, iprot, oprot):
args = updateUserProfile_args()
args.read(iprot)
iprot.readMessageEnd()
result = updateUserProfile_result()
try:
result.success = self._handler.updateUserProfile(args.authzToken, args.userProfile)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("updateUserProfile", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_getUserProfileById(self, seqid, iprot, oprot):
args = getUserProfileById_args()
args.read(iprot)
iprot.readMessageEnd()
result = getUserProfileById_result()
try:
result.success = self._handler.getUserProfileById(args.authzToken, args.userId, args.gatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getUserProfileById", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_deleteUserProfile(self, seqid, iprot, oprot):
args = deleteUserProfile_args()
args.read(iprot)
iprot.readMessageEnd()
result = deleteUserProfile_result()
try:
result.success = self._handler.deleteUserProfile(args.authzToken, args.userId, args.gatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("deleteUserProfile", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_getAllUserProfilesInGateway(self, seqid, iprot, oprot):
args = getAllUserProfilesInGateway_args()
args.read(iprot)
iprot.readMessageEnd()
result = getAllUserProfilesInGateway_result()
try:
result.success = self._handler.getAllUserProfilesInGateway(args.authzToken, args.gatewayId, args.offset, args.limit)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getAllUserProfilesInGateway", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_doesUserExist(self, seqid, iprot, oprot):
args = doesUserExist_args()
args.read(iprot)
iprot.readMessageEnd()
result = doesUserExist_result()
try:
result.success = self._handler.doesUserExist(args.authzToken, args.userId, args.gatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException as upe:
msg_type = TMessageType.REPLY
result.upe = upe
except airavata.api.error.ttypes.AuthorizationException as ae:
msg_type = TMessageType.REPLY
result.ae = ae
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("doesUserExist", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
# HELPER FUNCTIONS AND STRUCTURES
class initializeUserProfile_args(object):
"""
Attributes:
- authzToken
"""
def __init__(self, authzToken=None,):
self.authzToken = authzToken
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
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('initializeUserProfile_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
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(initializeUserProfile_args)
initializeUserProfile_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
)
class initializeUserProfile_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.STRING:
self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('initializeUserProfile_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.STRING, 0)
oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(initializeUserProfile_result)
initializeUserProfile_result.thrift_spec = (
(0, TType.STRING, 'success', 'UTF8', None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class addUserProfile_args(object):
"""
Attributes:
- authzToken
- userProfile
"""
def __init__(self, authzToken=None, userProfile=None,):
self.authzToken = authzToken
self.userProfile = userProfile
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.userProfile = airavata.model.user.ttypes.UserProfile()
self.userProfile.read(iprot)
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('addUserProfile_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.userProfile is not None:
oprot.writeFieldBegin('userProfile', TType.STRUCT, 2)
self.userProfile.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.userProfile is None:
raise TProtocolException(message='Required field userProfile is unset!')
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(addUserProfile_args)
addUserProfile_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRUCT, 'userProfile', [airavata.model.user.ttypes.UserProfile, None], None, ), # 2
)
class addUserProfile_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.STRING:
self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('addUserProfile_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.STRING, 0)
oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(addUserProfile_result)
addUserProfile_result.thrift_spec = (
(0, TType.STRING, 'success', 'UTF8', None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class updateUserProfile_args(object):
"""
Attributes:
- authzToken
- userProfile
"""
def __init__(self, authzToken=None, userProfile=None,):
self.authzToken = authzToken
self.userProfile = userProfile
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.userProfile = airavata.model.user.ttypes.UserProfile()
self.userProfile.read(iprot)
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('updateUserProfile_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.userProfile is not None:
oprot.writeFieldBegin('userProfile', TType.STRUCT, 2)
self.userProfile.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.userProfile is None:
raise TProtocolException(message='Required field userProfile is unset!')
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(updateUserProfile_args)
updateUserProfile_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRUCT, 'userProfile', [airavata.model.user.ttypes.UserProfile, None], None, ), # 2
)
class updateUserProfile_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.BOOL:
self.success = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('updateUserProfile_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(updateUserProfile_result)
updateUserProfile_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class getUserProfileById_args(object):
"""
Attributes:
- authzToken
- userId
- gatewayId
"""
def __init__(self, authzToken=None, userId=None, gatewayId=None,):
self.authzToken = authzToken
self.userId = userId
self.gatewayId = gatewayId
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.userId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.gatewayId = iprot.readString().decode('utf-8', errors='replace') 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('getUserProfileById_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.userId is not None:
oprot.writeFieldBegin('userId', TType.STRING, 2)
oprot.writeString(self.userId.encode('utf-8') if sys.version_info[0] == 2 else self.userId)
oprot.writeFieldEnd()
if self.gatewayId is not None:
oprot.writeFieldBegin('gatewayId', TType.STRING, 3)
oprot.writeString(self.gatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.gatewayId)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.userId is None:
raise TProtocolException(message='Required field userId is unset!')
if self.gatewayId is None:
raise TProtocolException(message='Required field gatewayId is unset!')
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(getUserProfileById_args)
getUserProfileById_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'userId', 'UTF8', None, ), # 2
(3, TType.STRING, 'gatewayId', 'UTF8', None, ), # 3
)
class getUserProfileById_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.STRUCT:
self.success = airavata.model.user.ttypes.UserProfile()
self.success.read(iprot)
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('getUserProfileById_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.STRUCT, 0)
self.success.write(oprot)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(getUserProfileById_result)
getUserProfileById_result.thrift_spec = (
(0, TType.STRUCT, 'success', [airavata.model.user.ttypes.UserProfile, None], None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class deleteUserProfile_args(object):
"""
Attributes:
- authzToken
- userId
- gatewayId
"""
def __init__(self, authzToken=None, userId=None, gatewayId=None,):
self.authzToken = authzToken
self.userId = userId
self.gatewayId = gatewayId
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.userId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.gatewayId = iprot.readString().decode('utf-8', errors='replace') 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('deleteUserProfile_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.userId is not None:
oprot.writeFieldBegin('userId', TType.STRING, 2)
oprot.writeString(self.userId.encode('utf-8') if sys.version_info[0] == 2 else self.userId)
oprot.writeFieldEnd()
if self.gatewayId is not None:
oprot.writeFieldBegin('gatewayId', TType.STRING, 3)
oprot.writeString(self.gatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.gatewayId)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.userId is None:
raise TProtocolException(message='Required field userId is unset!')
if self.gatewayId is None:
raise TProtocolException(message='Required field gatewayId is unset!')
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(deleteUserProfile_args)
deleteUserProfile_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'userId', 'UTF8', None, ), # 2
(3, TType.STRING, 'gatewayId', 'UTF8', None, ), # 3
)
class deleteUserProfile_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.BOOL:
self.success = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('deleteUserProfile_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(deleteUserProfile_result)
deleteUserProfile_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class getAllUserProfilesInGateway_args(object):
"""
Attributes:
- authzToken
- gatewayId
- offset
- limit
"""
def __init__(self, authzToken=None, gatewayId=None, offset=None, limit=None,):
self.authzToken = authzToken
self.gatewayId = gatewayId
self.offset = offset
self.limit = limit
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.gatewayId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.I32:
self.offset = iprot.readI32()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.I32:
self.limit = iprot.readI32()
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('getAllUserProfilesInGateway_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.gatewayId is not None:
oprot.writeFieldBegin('gatewayId', TType.STRING, 2)
oprot.writeString(self.gatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.gatewayId)
oprot.writeFieldEnd()
if self.offset is not None:
oprot.writeFieldBegin('offset', TType.I32, 3)
oprot.writeI32(self.offset)
oprot.writeFieldEnd()
if self.limit is not None:
oprot.writeFieldBegin('limit', TType.I32, 4)
oprot.writeI32(self.limit)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.gatewayId is None:
raise TProtocolException(message='Required field gatewayId is unset!')
if self.offset is None:
raise TProtocolException(message='Required field offset is unset!')
if self.limit is None:
raise TProtocolException(message='Required field limit is unset!')
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(getAllUserProfilesInGateway_args)
getAllUserProfilesInGateway_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'gatewayId', 'UTF8', None, ), # 2
(3, TType.I32, 'offset', None, None, ), # 3
(4, TType.I32, 'limit', None, None, ), # 4
)
class getAllUserProfilesInGateway_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.LIST:
self.success = []
(_etype3, _size0) = iprot.readListBegin()
for _i4 in range(_size0):
_elem5 = airavata.model.user.ttypes.UserProfile()
_elem5.read(iprot)
self.success.append(_elem5)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('getAllUserProfilesInGateway_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.LIST, 0)
oprot.writeListBegin(TType.STRUCT, len(self.success))
for iter6 in self.success:
iter6.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(getAllUserProfilesInGateway_result)
getAllUserProfilesInGateway_result.thrift_spec = (
(0, TType.LIST, 'success', (TType.STRUCT, [airavata.model.user.ttypes.UserProfile, None], False), None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class doesUserExist_args(object):
"""
Attributes:
- authzToken
- userId
- gatewayId
"""
def __init__(self, authzToken=None, userId=None, gatewayId=None,):
self.authzToken = authzToken
self.userId = userId
self.gatewayId = gatewayId
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.STRUCT:
self.authzToken = airavata.model.security.ttypes.AuthzToken()
self.authzToken.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.userId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.gatewayId = iprot.readString().decode('utf-8', errors='replace') 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('doesUserExist_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.userId is not None:
oprot.writeFieldBegin('userId', TType.STRING, 2)
oprot.writeString(self.userId.encode('utf-8') if sys.version_info[0] == 2 else self.userId)
oprot.writeFieldEnd()
if self.gatewayId is not None:
oprot.writeFieldBegin('gatewayId', TType.STRING, 3)
oprot.writeString(self.gatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.gatewayId)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.userId is None:
raise TProtocolException(message='Required field userId is unset!')
if self.gatewayId is None:
raise TProtocolException(message='Required field gatewayId is unset!')
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(doesUserExist_args)
doesUserExist_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'userId', 'UTF8', None, ), # 2
(3, TType.STRING, 'gatewayId', 'UTF8', None, ), # 3
)
class doesUserExist_result(object):
"""
Attributes:
- success
- upe
- ae
"""
def __init__(self, success=None, upe=None, ae=None,):
self.success = success
self.upe = upe
self.ae = ae
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 == 0:
if ftype == TType.BOOL:
self.success = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.upe = airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.ae = airavata.api.error.ttypes.AuthorizationException.read(iprot)
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('doesUserExist_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.upe is not None:
oprot.writeFieldBegin('upe', TType.STRUCT, 1)
self.upe.write(oprot)
oprot.writeFieldEnd()
if self.ae is not None:
oprot.writeFieldBegin('ae', TType.STRUCT, 2)
self.ae.write(oprot)
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(doesUserExist_result)
doesUserExist_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'upe', [airavata.service.profile.user.cpi.error.ttypes.UserProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
fix_spec(all_structs)
del all_structs