| # |
| # Autogenerated by Thrift Compiler (0.9.3) |
| # |
| # 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 |
| |
| from thrift.transport import TTransport |
| from thrift.protocol import TBinaryProtocol, TProtocol |
| try: |
| from thrift.protocol import fastbinary |
| except: |
| fastbinary = None |
| |
| |
| class MetadataType: |
| FILE = 0 |
| COLLECTION = 1 |
| |
| _VALUES_TO_NAMES = { |
| 0: "FILE", |
| 1: "COLLECTION", |
| } |
| |
| _NAMES_TO_VALUES = { |
| "FILE": 0, |
| "COLLECTION": 1, |
| } |
| |
| |
| class MetadataModel: |
| """ |
| Attributes: |
| - metadataId |
| - gatewayId |
| - username |
| - sharedUsers |
| - sharedPublic |
| - userFriendlyName |
| - userFriendlyDescription |
| - metadataType |
| - associatedEntityId |
| - customInformation |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'metadataId', None, None, ), # 1 |
| (2, TType.STRING, 'gatewayId', None, None, ), # 2 |
| (3, TType.STRING, 'username', None, None, ), # 3 |
| (4, TType.LIST, 'sharedUsers', (TType.STRING,None), None, ), # 4 |
| (5, TType.BOOL, 'sharedPublic', None, None, ), # 5 |
| (6, TType.STRING, 'userFriendlyName', None, None, ), # 6 |
| (7, TType.STRING, 'userFriendlyDescription', None, None, ), # 7 |
| (8, TType.I32, 'metadataType', None, None, ), # 8 |
| (9, TType.STRING, 'associatedEntityId', None, None, ), # 9 |
| (10, TType.MAP, 'customInformation', (TType.STRING,None,TType.STRING,None), None, ), # 10 |
| ) |
| |
| def __init__(self, metadataId=None, gatewayId=None, username=None, sharedUsers=None, sharedPublic=None, userFriendlyName=None, userFriendlyDescription=None, metadataType=None, associatedEntityId=None, customInformation=None,): |
| self.metadataId = metadataId |
| self.gatewayId = gatewayId |
| self.username = username |
| self.sharedUsers = sharedUsers |
| self.sharedPublic = sharedPublic |
| self.userFriendlyName = userFriendlyName |
| self.userFriendlyDescription = userFriendlyDescription |
| self.metadataType = metadataType |
| self.associatedEntityId = associatedEntityId |
| self.customInformation = customInformation |
| |
| 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.metadataId = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.gatewayId = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.username = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.LIST: |
| self.sharedUsers = [] |
| (_etype3, _size0) = iprot.readListBegin() |
| for _i4 in xrange(_size0): |
| _elem5 = iprot.readString() |
| self.sharedUsers.append(_elem5) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.BOOL: |
| self.sharedPublic = iprot.readBool() |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.STRING: |
| self.userFriendlyName = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 7: |
| if ftype == TType.STRING: |
| self.userFriendlyDescription = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 8: |
| if ftype == TType.I32: |
| self.metadataType = iprot.readI32() |
| else: |
| iprot.skip(ftype) |
| elif fid == 9: |
| if ftype == TType.STRING: |
| self.associatedEntityId = iprot.readString() |
| else: |
| iprot.skip(ftype) |
| elif fid == 10: |
| if ftype == TType.MAP: |
| self.customInformation = {} |
| (_ktype7, _vtype8, _size6 ) = iprot.readMapBegin() |
| for _i10 in xrange(_size6): |
| _key11 = iprot.readString() |
| _val12 = iprot.readString() |
| self.customInformation[_key11] = _val12 |
| iprot.readMapEnd() |
| 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('MetadataModel') |
| if self.metadataId is not None: |
| oprot.writeFieldBegin('metadataId', TType.STRING, 1) |
| oprot.writeString(self.metadataId) |
| oprot.writeFieldEnd() |
| if self.gatewayId is not None: |
| oprot.writeFieldBegin('gatewayId', TType.STRING, 2) |
| oprot.writeString(self.gatewayId) |
| oprot.writeFieldEnd() |
| if self.username is not None: |
| oprot.writeFieldBegin('username', TType.STRING, 3) |
| oprot.writeString(self.username) |
| oprot.writeFieldEnd() |
| if self.sharedUsers is not None: |
| oprot.writeFieldBegin('sharedUsers', TType.LIST, 4) |
| oprot.writeListBegin(TType.STRING, len(self.sharedUsers)) |
| for iter13 in self.sharedUsers: |
| oprot.writeString(iter13) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.sharedPublic is not None: |
| oprot.writeFieldBegin('sharedPublic', TType.BOOL, 5) |
| oprot.writeBool(self.sharedPublic) |
| oprot.writeFieldEnd() |
| if self.userFriendlyName is not None: |
| oprot.writeFieldBegin('userFriendlyName', TType.STRING, 6) |
| oprot.writeString(self.userFriendlyName) |
| oprot.writeFieldEnd() |
| if self.userFriendlyDescription is not None: |
| oprot.writeFieldBegin('userFriendlyDescription', TType.STRING, 7) |
| oprot.writeString(self.userFriendlyDescription) |
| oprot.writeFieldEnd() |
| if self.metadataType is not None: |
| oprot.writeFieldBegin('metadataType', TType.I32, 8) |
| oprot.writeI32(self.metadataType) |
| oprot.writeFieldEnd() |
| if self.associatedEntityId is not None: |
| oprot.writeFieldBegin('associatedEntityId', TType.STRING, 9) |
| oprot.writeString(self.associatedEntityId) |
| oprot.writeFieldEnd() |
| if self.customInformation is not None: |
| oprot.writeFieldBegin('customInformation', TType.MAP, 10) |
| oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.customInformation)) |
| for kiter14,viter15 in self.customInformation.items(): |
| oprot.writeString(kiter14) |
| oprot.writeString(viter15) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __hash__(self): |
| value = 17 |
| value = (value * 31) ^ hash(self.metadataId) |
| value = (value * 31) ^ hash(self.gatewayId) |
| value = (value * 31) ^ hash(self.username) |
| value = (value * 31) ^ hash(self.sharedUsers) |
| value = (value * 31) ^ hash(self.sharedPublic) |
| value = (value * 31) ^ hash(self.userFriendlyName) |
| value = (value * 31) ^ hash(self.userFriendlyDescription) |
| value = (value * 31) ^ hash(self.metadataType) |
| value = (value * 31) ^ hash(self.associatedEntityId) |
| value = (value * 31) ^ hash(self.customInformation) |
| 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) |