| # |
| # Autogenerated by Thrift Compiler (0.9.2) |
| # |
| # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| # |
| # options string: py |
| # |
| |
| from thrift.Thrift import TType, TMessageType, TException, TApplicationException |
| import apache.airavata.model.application.io.ttypes |
| import apache.airavata.model.commons.ttypes |
| |
| |
| from thrift.transport import TTransport |
| from thrift.protocol import TBinaryProtocol, TProtocol |
| try: |
| from thrift.protocol import fastbinary |
| except: |
| fastbinary = None |
| |
| |
| |
| class Workflow: |
| """ |
| Attributes: |
| - templateId |
| - name |
| - graph |
| - image |
| - workflowInputs |
| - workflowOutputs |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'templateId', None, "DO_NOT_SET_AT_CLIENTS", ), # 1 |
| (2, TType.STRING, 'name', None, None, ), # 2 |
| (3, TType.STRING, 'graph', None, None, ), # 3 |
| (4, TType.STRING, 'image', None, None, ), # 4 |
| (5, TType.LIST, 'workflowInputs', (TType.STRUCT,(apache.airavata.model.application.io.ttypes.InputDataObjectType, apache.airavata.model.application.io.ttypes.InputDataObjectType.thrift_spec)), None, ), # 5 |
| (6, TType.LIST, 'workflowOutputs', (TType.STRUCT,(apache.airavata.model.application.io.ttypes.OutputDataObjectType, apache.airavata.model.application.io.ttypes.OutputDataObjectType.thrift_spec)), None, ), # 6 |
| ) |
| |
| def __init__(self, templateId=thrift_spec[1][4], name=None, graph=None, image=None, workflowInputs=None, workflowOutputs=None,): |
| self.templateId = templateId |
| self.name = name |
| self.graph = graph |
| self.image = image |
| self.workflowInputs = workflowInputs |
| self.workflowOutputs = workflowOutputs |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (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.templateId = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.name = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.graph = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.STRING: |
| self.image = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.LIST: |
| self.workflowInputs = [] |
| (_etype3, _size0) = iprot.readListBegin() |
| for _i4 in xrange(_size0): |
| _elem5 = apache.airavata.model.application.io.ttypes.InputDataObjectType() |
| _elem5.read(iprot) |
| self.workflowInputs.append(_elem5) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.LIST: |
| self.workflowOutputs = [] |
| (_etype9, _size6) = iprot.readListBegin() |
| for _i10 in xrange(_size6): |
| _elem11 = apache.airavata.model.application.io.ttypes.OutputDataObjectType() |
| _elem11.read(iprot) |
| self.workflowOutputs.append(_elem11) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('Workflow') |
| if self.templateId is not None: |
| oprot.writeFieldBegin('templateId', TType.STRING, 1) |
| oprot.writeString(self.templateId) |
| oprot.writeFieldEnd() |
| if self.name is not None: |
| oprot.writeFieldBegin('name', TType.STRING, 2) |
| oprot.writeString(self.name) |
| oprot.writeFieldEnd() |
| if self.graph is not None: |
| oprot.writeFieldBegin('graph', TType.STRING, 3) |
| oprot.writeString(self.graph) |
| oprot.writeFieldEnd() |
| if self.image is not None: |
| oprot.writeFieldBegin('image', TType.STRING, 4) |
| oprot.writeString(self.image) |
| oprot.writeFieldEnd() |
| if self.workflowInputs is not None: |
| oprot.writeFieldBegin('workflowInputs', TType.LIST, 5) |
| oprot.writeListBegin(TType.STRUCT, len(self.workflowInputs)) |
| for iter12 in self.workflowInputs: |
| iter12.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.workflowOutputs is not None: |
| oprot.writeFieldBegin('workflowOutputs', TType.LIST, 6) |
| oprot.writeListBegin(TType.STRUCT, len(self.workflowOutputs)) |
| for iter13 in self.workflowOutputs: |
| iter13.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.templateId is None: |
| raise TProtocol.TProtocolException(message='Required field templateId is unset!') |
| if self.name is None: |
| raise TProtocol.TProtocolException(message='Required field name is unset!') |
| return |
| |
| |
| def __hash__(self): |
| value = 17 |
| value = (value * 31) ^ hash(self.templateId) |
| value = (value * 31) ^ hash(self.name) |
| value = (value * 31) ^ hash(self.graph) |
| value = (value * 31) ^ hash(self.image) |
| value = (value * 31) ^ hash(self.workflowInputs) |
| value = (value * 31) ^ hash(self.workflowOutputs) |
| return value |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| 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) |