| # |
| # 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.model.commons.ttypes |
| |
| from thrift.transport import TTransport |
| all_structs = [] |
| |
| |
| class TenantApprovalStatus(object): |
| REQUESTED = 0 |
| APPROVED = 1 |
| ACTIVE = 2 |
| DEACTIVATED = 3 |
| CANCELLED = 4 |
| DENIED = 5 |
| CREATED = 6 |
| DEPLOYED = 7 |
| |
| _VALUES_TO_NAMES = { |
| 0: "REQUESTED", |
| 1: "APPROVED", |
| 2: "ACTIVE", |
| 3: "DEACTIVATED", |
| 4: "CANCELLED", |
| 5: "DENIED", |
| 6: "CREATED", |
| 7: "DEPLOYED", |
| } |
| |
| _NAMES_TO_VALUES = { |
| "REQUESTED": 0, |
| "APPROVED": 1, |
| "ACTIVE": 2, |
| "DEACTIVATED": 3, |
| "CANCELLED": 4, |
| "DENIED": 5, |
| "CREATED": 6, |
| "DEPLOYED": 7, |
| } |
| |
| |
| class TenantPreferences(object): |
| """ |
| Attributes: |
| - tenantAdminFirstName |
| - tenantAdminLastName |
| - tenantAdminEmail |
| |
| """ |
| |
| |
| def __init__(self, tenantAdminFirstName=None, tenantAdminLastName=None, tenantAdminEmail=None,): |
| self.tenantAdminFirstName = tenantAdminFirstName |
| self.tenantAdminLastName = tenantAdminLastName |
| self.tenantAdminEmail = tenantAdminEmail |
| |
| 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 == 10: |
| if ftype == TType.STRING: |
| self.tenantAdminFirstName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 11: |
| if ftype == TType.STRING: |
| self.tenantAdminLastName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 12: |
| if ftype == TType.STRING: |
| self.tenantAdminEmail = 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('TenantPreferences') |
| if self.tenantAdminFirstName is not None: |
| oprot.writeFieldBegin('tenantAdminFirstName', TType.STRING, 10) |
| oprot.writeString(self.tenantAdminFirstName.encode('utf-8') if sys.version_info[0] == 2 else self.tenantAdminFirstName) |
| oprot.writeFieldEnd() |
| if self.tenantAdminLastName is not None: |
| oprot.writeFieldBegin('tenantAdminLastName', TType.STRING, 11) |
| oprot.writeString(self.tenantAdminLastName.encode('utf-8') if sys.version_info[0] == 2 else self.tenantAdminLastName) |
| oprot.writeFieldEnd() |
| if self.tenantAdminEmail is not None: |
| oprot.writeFieldBegin('tenantAdminEmail', TType.STRING, 12) |
| oprot.writeString(self.tenantAdminEmail.encode('utf-8') if sys.version_info[0] == 2 else self.tenantAdminEmail) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.items()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| |
| class TenantConfig(object): |
| """ |
| Attributes: |
| - oauthClientId |
| - oauthClientSecret |
| - identityServerUserName |
| - identityServerPasswordToken |
| |
| """ |
| |
| |
| def __init__(self, oauthClientId=None, oauthClientSecret=None, identityServerUserName=None, identityServerPasswordToken=None,): |
| self.oauthClientId = oauthClientId |
| self.oauthClientSecret = oauthClientSecret |
| self.identityServerUserName = identityServerUserName |
| self.identityServerPasswordToken = identityServerPasswordToken |
| |
| 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 == 16: |
| if ftype == TType.STRING: |
| self.oauthClientId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 17: |
| if ftype == TType.STRING: |
| self.oauthClientSecret = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 13: |
| if ftype == TType.STRING: |
| self.identityServerUserName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 14: |
| if ftype == TType.STRING: |
| self.identityServerPasswordToken = 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('TenantConfig') |
| if self.identityServerUserName is not None: |
| oprot.writeFieldBegin('identityServerUserName', TType.STRING, 13) |
| oprot.writeString(self.identityServerUserName.encode('utf-8') if sys.version_info[0] == 2 else self.identityServerUserName) |
| oprot.writeFieldEnd() |
| if self.identityServerPasswordToken is not None: |
| oprot.writeFieldBegin('identityServerPasswordToken', TType.STRING, 14) |
| oprot.writeString(self.identityServerPasswordToken.encode('utf-8') if sys.version_info[0] == 2 else self.identityServerPasswordToken) |
| oprot.writeFieldEnd() |
| if self.oauthClientId is not None: |
| oprot.writeFieldBegin('oauthClientId', TType.STRING, 16) |
| oprot.writeString(self.oauthClientId.encode('utf-8') if sys.version_info[0] == 2 else self.oauthClientId) |
| oprot.writeFieldEnd() |
| if self.oauthClientSecret is not None: |
| oprot.writeFieldBegin('oauthClientSecret', TType.STRING, 17) |
| oprot.writeString(self.oauthClientSecret.encode('utf-8') if sys.version_info[0] == 2 else self.oauthClientSecret) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.items()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| |
| class Tenant(object): |
| """ |
| Attributes: |
| - tenantId |
| - tenantApprovalStatus |
| - tenantName |
| - domain |
| - emailAddress |
| - tenantAcronym |
| - tenantURL |
| - tenantPublicAbstract |
| - reviewProposalDescription |
| - declinedReason |
| - requestCreationTime |
| - requesterUsername |
| |
| """ |
| |
| |
| def __init__(self, tenantId=None, tenantApprovalStatus=None, tenantName=None, domain=None, emailAddress=None, tenantAcronym=None, tenantURL=None, tenantPublicAbstract=None, reviewProposalDescription=None, declinedReason=None, requestCreationTime=None, requesterUsername=None,): |
| self.tenantId = tenantId |
| self.tenantApprovalStatus = tenantApprovalStatus |
| self.tenantName = tenantName |
| self.domain = domain |
| self.emailAddress = emailAddress |
| self.tenantAcronym = tenantAcronym |
| self.tenantURL = tenantURL |
| self.tenantPublicAbstract = tenantPublicAbstract |
| self.reviewProposalDescription = reviewProposalDescription |
| self.declinedReason = declinedReason |
| self.requestCreationTime = requestCreationTime |
| 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.STRING: |
| self.tenantId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I32: |
| self.tenantApprovalStatus = iprot.readI32() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.tenantName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.STRING: |
| self.domain = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.STRING: |
| self.emailAddress = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.STRING: |
| self.tenantAcronym = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 7: |
| if ftype == TType.STRING: |
| self.tenantURL = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 8: |
| if ftype == TType.STRING: |
| self.tenantPublicAbstract = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 9: |
| if ftype == TType.STRING: |
| self.reviewProposalDescription = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 15: |
| if ftype == TType.STRING: |
| self.declinedReason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 18: |
| if ftype == TType.I64: |
| self.requestCreationTime = iprot.readI64() |
| else: |
| iprot.skip(ftype) |
| elif fid == 19: |
| 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('Tenant') |
| if self.tenantId is not None: |
| oprot.writeFieldBegin('tenantId', TType.STRING, 1) |
| oprot.writeString(self.tenantId.encode('utf-8') if sys.version_info[0] == 2 else self.tenantId) |
| oprot.writeFieldEnd() |
| if self.tenantApprovalStatus is not None: |
| oprot.writeFieldBegin('tenantApprovalStatus', TType.I32, 2) |
| oprot.writeI32(self.tenantApprovalStatus) |
| oprot.writeFieldEnd() |
| if self.tenantName is not None: |
| oprot.writeFieldBegin('tenantName', TType.STRING, 3) |
| oprot.writeString(self.tenantName.encode('utf-8') if sys.version_info[0] == 2 else self.tenantName) |
| oprot.writeFieldEnd() |
| if self.domain is not None: |
| oprot.writeFieldBegin('domain', TType.STRING, 4) |
| oprot.writeString(self.domain.encode('utf-8') if sys.version_info[0] == 2 else self.domain) |
| oprot.writeFieldEnd() |
| if self.emailAddress is not None: |
| oprot.writeFieldBegin('emailAddress', TType.STRING, 5) |
| oprot.writeString(self.emailAddress.encode('utf-8') if sys.version_info[0] == 2 else self.emailAddress) |
| oprot.writeFieldEnd() |
| if self.tenantAcronym is not None: |
| oprot.writeFieldBegin('tenantAcronym', TType.STRING, 6) |
| oprot.writeString(self.tenantAcronym.encode('utf-8') if sys.version_info[0] == 2 else self.tenantAcronym) |
| oprot.writeFieldEnd() |
| if self.tenantURL is not None: |
| oprot.writeFieldBegin('tenantURL', TType.STRING, 7) |
| oprot.writeString(self.tenantURL.encode('utf-8') if sys.version_info[0] == 2 else self.tenantURL) |
| oprot.writeFieldEnd() |
| if self.tenantPublicAbstract is not None: |
| oprot.writeFieldBegin('tenantPublicAbstract', TType.STRING, 8) |
| oprot.writeString(self.tenantPublicAbstract.encode('utf-8') if sys.version_info[0] == 2 else self.tenantPublicAbstract) |
| oprot.writeFieldEnd() |
| if self.reviewProposalDescription is not None: |
| oprot.writeFieldBegin('reviewProposalDescription', TType.STRING, 9) |
| oprot.writeString(self.reviewProposalDescription.encode('utf-8') if sys.version_info[0] == 2 else self.reviewProposalDescription) |
| oprot.writeFieldEnd() |
| if self.declinedReason is not None: |
| oprot.writeFieldBegin('declinedReason', TType.STRING, 15) |
| oprot.writeString(self.declinedReason.encode('utf-8') if sys.version_info[0] == 2 else self.declinedReason) |
| oprot.writeFieldEnd() |
| if self.requestCreationTime is not None: |
| oprot.writeFieldBegin('requestCreationTime', TType.I64, 18) |
| oprot.writeI64(self.requestCreationTime) |
| oprot.writeFieldEnd() |
| if self.requesterUsername is not None: |
| oprot.writeFieldBegin('requesterUsername', TType.STRING, 19) |
| 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.tenantId is None: |
| raise TProtocolException(message='Required field tenantId is unset!') |
| if self.tenantApprovalStatus is None: |
| raise TProtocolException(message='Required field tenantApprovalStatus 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(TenantPreferences) |
| TenantPreferences.thrift_spec = ( |
| None, # 0 |
| None, # 1 |
| None, # 2 |
| None, # 3 |
| None, # 4 |
| None, # 5 |
| None, # 6 |
| None, # 7 |
| None, # 8 |
| None, # 9 |
| (10, TType.STRING, 'tenantAdminFirstName', 'UTF8', None, ), # 10 |
| (11, TType.STRING, 'tenantAdminLastName', 'UTF8', None, ), # 11 |
| (12, TType.STRING, 'tenantAdminEmail', 'UTF8', None, ), # 12 |
| ) |
| all_structs.append(TenantConfig) |
| TenantConfig.thrift_spec = ( |
| None, # 0 |
| None, # 1 |
| None, # 2 |
| None, # 3 |
| None, # 4 |
| None, # 5 |
| None, # 6 |
| None, # 7 |
| None, # 8 |
| None, # 9 |
| None, # 10 |
| None, # 11 |
| None, # 12 |
| (13, TType.STRING, 'identityServerUserName', 'UTF8', None, ), # 13 |
| (14, TType.STRING, 'identityServerPasswordToken', 'UTF8', None, ), # 14 |
| None, # 15 |
| (16, TType.STRING, 'oauthClientId', 'UTF8', None, ), # 16 |
| (17, TType.STRING, 'oauthClientSecret', 'UTF8', None, ), # 17 |
| ) |
| all_structs.append(Tenant) |
| Tenant.thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'tenantId', 'UTF8', None, ), # 1 |
| (2, TType.I32, 'tenantApprovalStatus', None, None, ), # 2 |
| (3, TType.STRING, 'tenantName', 'UTF8', None, ), # 3 |
| (4, TType.STRING, 'domain', 'UTF8', None, ), # 4 |
| (5, TType.STRING, 'emailAddress', 'UTF8', None, ), # 5 |
| (6, TType.STRING, 'tenantAcronym', 'UTF8', None, ), # 6 |
| (7, TType.STRING, 'tenantURL', 'UTF8', None, ), # 7 |
| (8, TType.STRING, 'tenantPublicAbstract', 'UTF8', None, ), # 8 |
| (9, TType.STRING, 'reviewProposalDescription', 'UTF8', None, ), # 9 |
| None, # 10 |
| None, # 11 |
| None, # 12 |
| None, # 13 |
| None, # 14 |
| (15, TType.STRING, 'declinedReason', 'UTF8', None, ), # 15 |
| None, # 16 |
| None, # 17 |
| (18, TType.I64, 'requestCreationTime', None, None, ), # 18 |
| (19, TType.STRING, 'requesterUsername', 'UTF8', None, ), # 19 |
| ) |
| fix_spec(all_structs) |
| del all_structs |