blob: c1d67db5c398c69fab4ae6a8d8579bedb2843c90 [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 addGateway(self, authzToken, gateway):
"""
Return the airavataInternalGatewayId assigned to given gateway.
Parameters:
- authzToken
- gateway
"""
pass
def updateGateway(self, authzToken, updatedGateway):
"""
Parameters:
- authzToken
- updatedGateway
"""
pass
def getGateway(self, authzToken, airavataInternalGatewayId):
"""
Parameters:
- authzToken
- airavataInternalGatewayId
"""
pass
def deleteGateway(self, authzToken, airavataInternalGatewayId, gatewayId):
"""
Parameters:
- authzToken
- airavataInternalGatewayId
- gatewayId
"""
pass
def getAllGateways(self, authzToken):
"""
Parameters:
- authzToken
"""
pass
def isGatewayExist(self, authzToken, gatewayId):
"""
Parameters:
- authzToken
- gatewayId
"""
pass
def getAllGatewaysForUser(self, authzToken, requesterUsername):
"""
Parameters:
- authzToken
- requesterUsername
"""
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 addGateway(self, authzToken, gateway):
"""
Return the airavataInternalGatewayId assigned to given gateway.
Parameters:
- authzToken
- gateway
"""
self.send_addGateway(authzToken, gateway)
return self.recv_addGateway()
def send_addGateway(self, authzToken, gateway):
self._oprot.writeMessageBegin('addGateway', TMessageType.CALL, self._seqid)
args = addGateway_args()
args.authzToken = authzToken
args.gateway = gateway
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_addGateway(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = addGateway_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "addGateway failed: unknown result")
def updateGateway(self, authzToken, updatedGateway):
"""
Parameters:
- authzToken
- updatedGateway
"""
self.send_updateGateway(authzToken, updatedGateway)
return self.recv_updateGateway()
def send_updateGateway(self, authzToken, updatedGateway):
self._oprot.writeMessageBegin('updateGateway', TMessageType.CALL, self._seqid)
args = updateGateway_args()
args.authzToken = authzToken
args.updatedGateway = updatedGateway
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_updateGateway(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = updateGateway_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "updateGateway failed: unknown result")
def getGateway(self, authzToken, airavataInternalGatewayId):
"""
Parameters:
- authzToken
- airavataInternalGatewayId
"""
self.send_getGateway(authzToken, airavataInternalGatewayId)
return self.recv_getGateway()
def send_getGateway(self, authzToken, airavataInternalGatewayId):
self._oprot.writeMessageBegin('getGateway', TMessageType.CALL, self._seqid)
args = getGateway_args()
args.authzToken = authzToken
args.airavataInternalGatewayId = airavataInternalGatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_getGateway(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = getGateway_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "getGateway failed: unknown result")
def deleteGateway(self, authzToken, airavataInternalGatewayId, gatewayId):
"""
Parameters:
- authzToken
- airavataInternalGatewayId
- gatewayId
"""
self.send_deleteGateway(authzToken, airavataInternalGatewayId, gatewayId)
return self.recv_deleteGateway()
def send_deleteGateway(self, authzToken, airavataInternalGatewayId, gatewayId):
self._oprot.writeMessageBegin('deleteGateway', TMessageType.CALL, self._seqid)
args = deleteGateway_args()
args.authzToken = authzToken
args.airavataInternalGatewayId = airavataInternalGatewayId
args.gatewayId = gatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_deleteGateway(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = deleteGateway_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteGateway failed: unknown result")
def getAllGateways(self, authzToken):
"""
Parameters:
- authzToken
"""
self.send_getAllGateways(authzToken)
return self.recv_getAllGateways()
def send_getAllGateways(self, authzToken):
self._oprot.writeMessageBegin('getAllGateways', TMessageType.CALL, self._seqid)
args = getAllGateways_args()
args.authzToken = authzToken
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_getAllGateways(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = getAllGateways_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllGateways failed: unknown result")
def isGatewayExist(self, authzToken, gatewayId):
"""
Parameters:
- authzToken
- gatewayId
"""
self.send_isGatewayExist(authzToken, gatewayId)
return self.recv_isGatewayExist()
def send_isGatewayExist(self, authzToken, gatewayId):
self._oprot.writeMessageBegin('isGatewayExist', TMessageType.CALL, self._seqid)
args = isGatewayExist_args()
args.authzToken = authzToken
args.gatewayId = gatewayId
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_isGatewayExist(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = isGatewayExist_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "isGatewayExist failed: unknown result")
def getAllGatewaysForUser(self, authzToken, requesterUsername):
"""
Parameters:
- authzToken
- requesterUsername
"""
self.send_getAllGatewaysForUser(authzToken, requesterUsername)
return self.recv_getAllGatewaysForUser()
def send_getAllGatewaysForUser(self, authzToken, requesterUsername):
self._oprot.writeMessageBegin('getAllGatewaysForUser', TMessageType.CALL, self._seqid)
args = getAllGatewaysForUser_args()
args.authzToken = authzToken
args.requesterUsername = requesterUsername
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_getAllGatewaysForUser(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = getAllGatewaysForUser_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.tpe is not None:
raise result.tpe
if result.ae is not None:
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllGatewaysForUser 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["addGateway"] = Processor.process_addGateway
self._processMap["updateGateway"] = Processor.process_updateGateway
self._processMap["getGateway"] = Processor.process_getGateway
self._processMap["deleteGateway"] = Processor.process_deleteGateway
self._processMap["getAllGateways"] = Processor.process_getAllGateways
self._processMap["isGatewayExist"] = Processor.process_isGatewayExist
self._processMap["getAllGatewaysForUser"] = Processor.process_getAllGatewaysForUser
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_addGateway(self, seqid, iprot, oprot):
args = addGateway_args()
args.read(iprot)
iprot.readMessageEnd()
result = addGateway_result()
try:
result.success = self._handler.addGateway(args.authzToken, args.gateway)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("addGateway", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_updateGateway(self, seqid, iprot, oprot):
args = updateGateway_args()
args.read(iprot)
iprot.readMessageEnd()
result = updateGateway_result()
try:
result.success = self._handler.updateGateway(args.authzToken, args.updatedGateway)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("updateGateway", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_getGateway(self, seqid, iprot, oprot):
args = getGateway_args()
args.read(iprot)
iprot.readMessageEnd()
result = getGateway_result()
try:
result.success = self._handler.getGateway(args.authzToken, args.airavataInternalGatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("getGateway", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_deleteGateway(self, seqid, iprot, oprot):
args = deleteGateway_args()
args.read(iprot)
iprot.readMessageEnd()
result = deleteGateway_result()
try:
result.success = self._handler.deleteGateway(args.authzToken, args.airavataInternalGatewayId, args.gatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("deleteGateway", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_getAllGateways(self, seqid, iprot, oprot):
args = getAllGateways_args()
args.read(iprot)
iprot.readMessageEnd()
result = getAllGateways_result()
try:
result.success = self._handler.getAllGateways(args.authzToken)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("getAllGateways", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_isGatewayExist(self, seqid, iprot, oprot):
args = isGatewayExist_args()
args.read(iprot)
iprot.readMessageEnd()
result = isGatewayExist_result()
try:
result.success = self._handler.isGatewayExist(args.authzToken, args.gatewayId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("isGatewayExist", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_getAllGatewaysForUser(self, seqid, iprot, oprot):
args = getAllGatewaysForUser_args()
args.read(iprot)
iprot.readMessageEnd()
result = getAllGatewaysForUser_result()
try:
result.success = self._handler.getAllGatewaysForUser(args.authzToken, args.requesterUsername)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException as tpe:
msg_type = TMessageType.REPLY
result.tpe = tpe
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("getAllGatewaysForUser", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
# HELPER FUNCTIONS AND STRUCTURES
class addGateway_args(object):
"""
Attributes:
- authzToken
- gateway
"""
def __init__(self, authzToken=None, gateway=None,):
self.authzToken = authzToken
self.gateway = gateway
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.gateway = airavata.model.workspace.ttypes.Gateway()
self.gateway.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('addGateway_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.gateway is not None:
oprot.writeFieldBegin('gateway', TType.STRUCT, 2)
self.gateway.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.gateway is None:
raise TProtocolException(message='Required field gateway 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(addGateway_args)
addGateway_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRUCT, 'gateway', [airavata.model.workspace.ttypes.Gateway, None], None, ), # 2
)
class addGateway_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('addGateway_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.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(addGateway_result)
addGateway_result.thrift_spec = (
(0, TType.STRING, 'success', 'UTF8', None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class updateGateway_args(object):
"""
Attributes:
- authzToken
- updatedGateway
"""
def __init__(self, authzToken=None, updatedGateway=None,):
self.authzToken = authzToken
self.updatedGateway = updatedGateway
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.updatedGateway = airavata.model.workspace.ttypes.Gateway()
self.updatedGateway.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('updateGateway_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.updatedGateway is not None:
oprot.writeFieldBegin('updatedGateway', TType.STRUCT, 2)
self.updatedGateway.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.updatedGateway is None:
raise TProtocolException(message='Required field updatedGateway 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(updateGateway_args)
updateGateway_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRUCT, 'updatedGateway', [airavata.model.workspace.ttypes.Gateway, None], None, ), # 2
)
class updateGateway_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('updateGateway_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(updateGateway_result)
updateGateway_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class getGateway_args(object):
"""
Attributes:
- authzToken
- airavataInternalGatewayId
"""
def __init__(self, authzToken=None, airavataInternalGatewayId=None,):
self.authzToken = authzToken
self.airavataInternalGatewayId = airavataInternalGatewayId
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.airavataInternalGatewayId = 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('getGateway_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.airavataInternalGatewayId is not None:
oprot.writeFieldBegin('airavataInternalGatewayId', TType.STRING, 2)
oprot.writeString(self.airavataInternalGatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.airavataInternalGatewayId)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.airavataInternalGatewayId is None:
raise TProtocolException(message='Required field airavataInternalGatewayId 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(getGateway_args)
getGateway_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'airavataInternalGatewayId', 'UTF8', None, ), # 2
)
class getGateway_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.workspace.ttypes.Gateway()
self.success.read(iprot)
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('getGateway_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.STRUCT, 0)
self.success.write(oprot)
oprot.writeFieldEnd()
if self.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(getGateway_result)
getGateway_result.thrift_spec = (
(0, TType.STRUCT, 'success', [airavata.model.workspace.ttypes.Gateway, None], None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class deleteGateway_args(object):
"""
Attributes:
- authzToken
- airavataInternalGatewayId
- gatewayId
"""
def __init__(self, authzToken=None, airavataInternalGatewayId=None, gatewayId=None,):
self.authzToken = authzToken
self.airavataInternalGatewayId = airavataInternalGatewayId
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.airavataInternalGatewayId = 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('deleteGateway_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.airavataInternalGatewayId is not None:
oprot.writeFieldBegin('airavataInternalGatewayId', TType.STRING, 2)
oprot.writeString(self.airavataInternalGatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.airavataInternalGatewayId)
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.airavataInternalGatewayId is None:
raise TProtocolException(message='Required field airavataInternalGatewayId 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(deleteGateway_args)
deleteGateway_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'airavataInternalGatewayId', 'UTF8', None, ), # 2
(3, TType.STRING, 'gatewayId', 'UTF8', None, ), # 3
)
class deleteGateway_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('deleteGateway_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(deleteGateway_result)
deleteGateway_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class getAllGateways_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('getAllGateways_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(getAllGateways_args)
getAllGateways_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
)
class getAllGateways_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.workspace.ttypes.Gateway()
_elem5.read(iprot)
self.success.append(_elem5)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('getAllGateways_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.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(getAllGateways_result)
getAllGateways_result.thrift_spec = (
(0, TType.LIST, 'success', (TType.STRUCT, [airavata.model.workspace.ttypes.Gateway, None], False), None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class isGatewayExist_args(object):
"""
Attributes:
- authzToken
- gatewayId
"""
def __init__(self, authzToken=None, gatewayId=None,):
self.authzToken = authzToken
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.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('isGatewayExist_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()
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!')
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(isGatewayExist_args)
isGatewayExist_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'gatewayId', 'UTF8', None, ), # 2
)
class isGatewayExist_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('isGatewayExist_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(isGatewayExist_result)
isGatewayExist_result.thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
class getAllGatewaysForUser_args(object):
"""
Attributes:
- authzToken
- requesterUsername
"""
def __init__(self, authzToken=None, requesterUsername=None,):
self.authzToken = authzToken
self.requesterUsername = requesterUsername
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.requesterUsername = 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('getAllGatewaysForUser_args')
if self.authzToken is not None:
oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
self.authzToken.write(oprot)
oprot.writeFieldEnd()
if self.requesterUsername is not None:
oprot.writeFieldBegin('requesterUsername', TType.STRING, 2)
oprot.writeString(self.requesterUsername.encode('utf-8') if sys.version_info[0] == 2 else self.requesterUsername)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.authzToken is None:
raise TProtocolException(message='Required field authzToken is unset!')
if self.requesterUsername is None:
raise TProtocolException(message='Required field requesterUsername 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(getAllGatewaysForUser_args)
getAllGatewaysForUser_args.thrift_spec = (
None, # 0
(1, TType.STRUCT, 'authzToken', [airavata.model.security.ttypes.AuthzToken, None], None, ), # 1
(2, TType.STRING, 'requesterUsername', 'UTF8', None, ), # 2
)
class getAllGatewaysForUser_result(object):
"""
Attributes:
- success
- tpe
- ae
"""
def __init__(self, success=None, tpe=None, ae=None,):
self.success = success
self.tpe = tpe
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 = []
(_etype10, _size7) = iprot.readListBegin()
for _i11 in range(_size7):
_elem12 = airavata.model.workspace.ttypes.Gateway()
_elem12.read(iprot)
self.success.append(_elem12)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.tpe = airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException.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('getAllGatewaysForUser_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.LIST, 0)
oprot.writeListBegin(TType.STRUCT, len(self.success))
for iter13 in self.success:
iter13.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.tpe is not None:
oprot.writeFieldBegin('tpe', TType.STRUCT, 1)
self.tpe.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(getAllGatewaysForUser_result)
getAllGatewaysForUser_result.thrift_spec = (
(0, TType.LIST, 'success', (TType.STRUCT, [airavata.model.workspace.ttypes.Gateway, None], False), None, ), # 0
(1, TType.STRUCT, 'tpe', [airavata.service.profile.tenant.cpi.error.ttypes.TenantProfileServiceException, None], None, ), # 1
(2, TType.STRUCT, 'ae', [airavata.api.error.ttypes.AuthorizationException, None], None, ), # 2
)
fix_spec(all_structs)
del all_structs