| # |
| # 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 |
| |
| from thrift.transport import TTransport |
| all_structs = [] |
| |
| |
| class ErrorModel(object): |
| """ |
| Attributes: |
| - errorId |
| - creationTime |
| - actualErrorMessage |
| - userFriendlyMessage |
| - transientOrPersistent |
| - rootCauseErrorIdList |
| |
| """ |
| |
| |
| def __init__(self, errorId="DO_NOT_SET_AT_CLIENTS", creationTime=None, actualErrorMessage=None, userFriendlyMessage=None, transientOrPersistent=False, rootCauseErrorIdList=None,): |
| self.errorId = errorId |
| self.creationTime = creationTime |
| self.actualErrorMessage = actualErrorMessage |
| self.userFriendlyMessage = userFriendlyMessage |
| self.transientOrPersistent = transientOrPersistent |
| self.rootCauseErrorIdList = rootCauseErrorIdList |
| |
| 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.errorId = 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.I64: |
| self.creationTime = iprot.readI64() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.actualErrorMessage = 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.userFriendlyMessage = 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.BOOL: |
| self.transientOrPersistent = iprot.readBool() |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.LIST: |
| self.rootCauseErrorIdList = [] |
| (_etype3, _size0) = iprot.readListBegin() |
| for _i4 in range(_size0): |
| _elem5 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() |
| self.rootCauseErrorIdList.append(_elem5) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot._fast_encode is not None and self.thrift_spec is not None: |
| oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) |
| return |
| oprot.writeStructBegin('ErrorModel') |
| if self.errorId is not None: |
| oprot.writeFieldBegin('errorId', TType.STRING, 1) |
| oprot.writeString(self.errorId.encode('utf-8') if sys.version_info[0] == 2 else self.errorId) |
| oprot.writeFieldEnd() |
| if self.creationTime is not None: |
| oprot.writeFieldBegin('creationTime', TType.I64, 2) |
| oprot.writeI64(self.creationTime) |
| oprot.writeFieldEnd() |
| if self.actualErrorMessage is not None: |
| oprot.writeFieldBegin('actualErrorMessage', TType.STRING, 3) |
| oprot.writeString(self.actualErrorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.actualErrorMessage) |
| oprot.writeFieldEnd() |
| if self.userFriendlyMessage is not None: |
| oprot.writeFieldBegin('userFriendlyMessage', TType.STRING, 4) |
| oprot.writeString(self.userFriendlyMessage.encode('utf-8') if sys.version_info[0] == 2 else self.userFriendlyMessage) |
| oprot.writeFieldEnd() |
| if self.transientOrPersistent is not None: |
| oprot.writeFieldBegin('transientOrPersistent', TType.BOOL, 5) |
| oprot.writeBool(self.transientOrPersistent) |
| oprot.writeFieldEnd() |
| if self.rootCauseErrorIdList is not None: |
| oprot.writeFieldBegin('rootCauseErrorIdList', TType.LIST, 6) |
| oprot.writeListBegin(TType.STRING, len(self.rootCauseErrorIdList)) |
| for iter6 in self.rootCauseErrorIdList: |
| oprot.writeString(iter6.encode('utf-8') if sys.version_info[0] == 2 else iter6) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.errorId is None: |
| raise TProtocolException(message='Required field errorId 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) |
| |
| |
| class ValidatorResult(object): |
| """ |
| This data structure can be used to store the validation results |
| captured during validation step and during the launchExperiment |
| operation it can be easilly checked to see the errors occured |
| during the experiment launch operation |
| |
| |
| Attributes: |
| - result |
| - errorDetails |
| |
| """ |
| |
| |
| def __init__(self, result=None, errorDetails=None,): |
| self.result = result |
| self.errorDetails = errorDetails |
| |
| 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.BOOL: |
| self.result = iprot.readBool() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.errorDetails = 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('ValidatorResult') |
| if self.result is not None: |
| oprot.writeFieldBegin('result', TType.BOOL, 1) |
| oprot.writeBool(self.result) |
| oprot.writeFieldEnd() |
| if self.errorDetails is not None: |
| oprot.writeFieldBegin('errorDetails', TType.STRING, 2) |
| oprot.writeString(self.errorDetails.encode('utf-8') if sys.version_info[0] == 2 else self.errorDetails) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.result is None: |
| raise TProtocolException(message='Required field result 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) |
| |
| |
| class ValidationResults(object): |
| """ |
| Attributes: |
| - validationState |
| - validationResultList |
| |
| """ |
| |
| |
| def __init__(self, validationState=None, validationResultList=None,): |
| self.validationState = validationState |
| self.validationResultList = validationResultList |
| |
| 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.BOOL: |
| self.validationState = iprot.readBool() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.LIST: |
| self.validationResultList = [] |
| (_etype10, _size7) = iprot.readListBegin() |
| for _i11 in range(_size7): |
| _elem12 = ValidatorResult() |
| _elem12.read(iprot) |
| self.validationResultList.append(_elem12) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot._fast_encode is not None and self.thrift_spec is not None: |
| oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) |
| return |
| oprot.writeStructBegin('ValidationResults') |
| if self.validationState is not None: |
| oprot.writeFieldBegin('validationState', TType.BOOL, 1) |
| oprot.writeBool(self.validationState) |
| oprot.writeFieldEnd() |
| if self.validationResultList is not None: |
| oprot.writeFieldBegin('validationResultList', TType.LIST, 2) |
| oprot.writeListBegin(TType.STRUCT, len(self.validationResultList)) |
| for iter13 in self.validationResultList: |
| iter13.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.validationState is None: |
| raise TProtocolException(message='Required field validationState is unset!') |
| if self.validationResultList is None: |
| raise TProtocolException(message='Required field validationResultList 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(ErrorModel) |
| ErrorModel.thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'errorId', 'UTF8', "DO_NOT_SET_AT_CLIENTS", ), # 1 |
| (2, TType.I64, 'creationTime', None, None, ), # 2 |
| (3, TType.STRING, 'actualErrorMessage', 'UTF8', None, ), # 3 |
| (4, TType.STRING, 'userFriendlyMessage', 'UTF8', None, ), # 4 |
| (5, TType.BOOL, 'transientOrPersistent', None, False, ), # 5 |
| (6, TType.LIST, 'rootCauseErrorIdList', (TType.STRING, 'UTF8', False), None, ), # 6 |
| ) |
| all_structs.append(ValidatorResult) |
| ValidatorResult.thrift_spec = ( |
| None, # 0 |
| (1, TType.BOOL, 'result', None, None, ), # 1 |
| (2, TType.STRING, 'errorDetails', 'UTF8', None, ), # 2 |
| ) |
| all_structs.append(ValidationResults) |
| ValidationResults.thrift_spec = ( |
| None, # 0 |
| (1, TType.BOOL, 'validationState', None, None, ), # 1 |
| (2, TType.LIST, 'validationResultList', (TType.STRUCT, [ValidatorResult, None], False), None, ), # 2 |
| ) |
| fix_spec(all_structs) |
| del all_structs |