| # |
| # Autogenerated by Thrift Compiler (0.10.0) |
| # |
| # 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 |
| import sys |
| |
| from thrift.transport import TTransport |
| |
| |
| class CrudType(object): |
| CREATE = 0 |
| READ = 1 |
| UPDATE = 2 |
| DELETE = 3 |
| |
| _VALUES_TO_NAMES = { |
| 0: "CREATE", |
| 1: "READ", |
| 2: "UPDATE", |
| 3: "DELETE", |
| } |
| |
| _NAMES_TO_VALUES = { |
| "CREATE": 0, |
| "READ": 1, |
| "UPDATE": 2, |
| "DELETE": 3, |
| } |
| |
| |
| class EntityType(object): |
| USER_PROFILE = 0 |
| TENANT = 1 |
| GROUP = 2 |
| PROJECT = 3 |
| EXPERIMENT = 4 |
| APPLICATION = 5 |
| SHARING = 6 |
| REGISTRY = 7 |
| |
| _VALUES_TO_NAMES = { |
| 0: "USER_PROFILE", |
| 1: "TENANT", |
| 2: "GROUP", |
| 3: "PROJECT", |
| 4: "EXPERIMENT", |
| 5: "APPLICATION", |
| 6: "SHARING", |
| 7: "REGISTRY", |
| } |
| |
| _NAMES_TO_VALUES = { |
| "USER_PROFILE": 0, |
| "TENANT": 1, |
| "GROUP": 2, |
| "PROJECT": 3, |
| "EXPERIMENT": 4, |
| "APPLICATION": 5, |
| "SHARING": 6, |
| "REGISTRY": 7, |
| } |
| |
| |
| class DBEventType(object): |
| PUBLISHER = 0 |
| SUBSCRIBER = 1 |
| |
| _VALUES_TO_NAMES = { |
| 0: "PUBLISHER", |
| 1: "SUBSCRIBER", |
| } |
| |
| _NAMES_TO_VALUES = { |
| "PUBLISHER": 0, |
| "SUBSCRIBER": 1, |
| } |
| |
| |
| class DBEventPublisherContext(object): |
| """ |
| Attributes: |
| - crudType |
| - entityType |
| - entityDataModel |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'crudType', None, None, ), # 1 |
| (2, TType.I32, 'entityType', None, None, ), # 2 |
| (3, TType.STRING, 'entityDataModel', 'BINARY', None, ), # 3 |
| ) |
| |
| def __init__(self, crudType=None, entityType=None, entityDataModel=None,): |
| self.crudType = crudType |
| self.entityType = entityType |
| self.entityDataModel = entityDataModel |
| |
| 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.I32: |
| self.crudType = iprot.readI32() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I32: |
| self.entityType = iprot.readI32() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.entityDataModel = iprot.readBinary() |
| 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('DBEventPublisherContext') |
| if self.crudType is not None: |
| oprot.writeFieldBegin('crudType', TType.I32, 1) |
| oprot.writeI32(self.crudType) |
| oprot.writeFieldEnd() |
| if self.entityType is not None: |
| oprot.writeFieldBegin('entityType', TType.I32, 2) |
| oprot.writeI32(self.entityType) |
| oprot.writeFieldEnd() |
| if self.entityDataModel is not None: |
| oprot.writeFieldBegin('entityDataModel', TType.STRING, 3) |
| oprot.writeBinary(self.entityDataModel) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.crudType is None: |
| raise TProtocolException(message='Required field crudType is unset!') |
| if self.entityType is None: |
| raise TProtocolException(message='Required field entityType is unset!') |
| if self.entityDataModel is None: |
| raise TProtocolException(message='Required field entityDataModel 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 DBEventPublisher(object): |
| """ |
| Attributes: |
| - publisherContext |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'publisherContext', (DBEventPublisherContext, DBEventPublisherContext.thrift_spec), None, ), # 1 |
| ) |
| |
| def __init__(self, publisherContext=None,): |
| self.publisherContext = publisherContext |
| |
| 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.publisherContext = DBEventPublisherContext() |
| self.publisherContext.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('DBEventPublisher') |
| if self.publisherContext is not None: |
| oprot.writeFieldBegin('publisherContext', TType.STRUCT, 1) |
| self.publisherContext.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.publisherContext is None: |
| raise TProtocolException(message='Required field publisherContext 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 DBEventSubscriber(object): |
| """ |
| Attributes: |
| - subscriberService |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'subscriberService', 'UTF8', None, ), # 1 |
| ) |
| |
| def __init__(self, subscriberService=None,): |
| self.subscriberService = subscriberService |
| |
| 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.subscriberService = iprot.readString().decode('utf-8') 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('DBEventSubscriber') |
| if self.subscriberService is not None: |
| oprot.writeFieldBegin('subscriberService', TType.STRING, 1) |
| oprot.writeString(self.subscriberService.encode('utf-8') if sys.version_info[0] == 2 else self.subscriberService) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.subscriberService is None: |
| raise TProtocolException(message='Required field subscriberService 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 DBEventMessageContext(object): |
| """ |
| Attributes: |
| - publisher |
| - subscriber |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'publisher', (DBEventPublisher, DBEventPublisher.thrift_spec), None, ), # 1 |
| (2, TType.STRUCT, 'subscriber', (DBEventSubscriber, DBEventSubscriber.thrift_spec), None, ), # 2 |
| ) |
| |
| def __init__(self, publisher=None, subscriber=None,): |
| self.publisher = publisher |
| self.subscriber = subscriber |
| |
| 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.publisher = DBEventPublisher() |
| self.publisher.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.subscriber = DBEventSubscriber() |
| self.subscriber.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('DBEventMessageContext') |
| if self.publisher is not None: |
| oprot.writeFieldBegin('publisher', TType.STRUCT, 1) |
| self.publisher.write(oprot) |
| oprot.writeFieldEnd() |
| if self.subscriber is not None: |
| oprot.writeFieldBegin('subscriber', TType.STRUCT, 2) |
| self.subscriber.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) |
| |
| |
| class DBEventMessage(object): |
| """ |
| Attributes: |
| - dbEventType |
| - messageContext |
| - publisherService |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'dbEventType', None, None, ), # 1 |
| (2, TType.STRUCT, 'messageContext', (DBEventMessageContext, DBEventMessageContext.thrift_spec), None, ), # 2 |
| (3, TType.STRING, 'publisherService', 'UTF8', None, ), # 3 |
| ) |
| |
| def __init__(self, dbEventType=None, messageContext=None, publisherService=None,): |
| self.dbEventType = dbEventType |
| self.messageContext = messageContext |
| self.publisherService = publisherService |
| |
| 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.I32: |
| self.dbEventType = iprot.readI32() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.messageContext = DBEventMessageContext() |
| self.messageContext.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.publisherService = iprot.readString().decode('utf-8') 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('DBEventMessage') |
| if self.dbEventType is not None: |
| oprot.writeFieldBegin('dbEventType', TType.I32, 1) |
| oprot.writeI32(self.dbEventType) |
| oprot.writeFieldEnd() |
| if self.messageContext is not None: |
| oprot.writeFieldBegin('messageContext', TType.STRUCT, 2) |
| self.messageContext.write(oprot) |
| oprot.writeFieldEnd() |
| if self.publisherService is not None: |
| oprot.writeFieldBegin('publisherService', TType.STRING, 3) |
| oprot.writeString(self.publisherService.encode('utf-8') if sys.version_info[0] == 2 else self.publisherService) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.dbEventType is None: |
| raise TProtocolException(message='Required field dbEventType is unset!') |
| if self.messageContext is None: |
| raise TProtocolException(message='Required field messageContext is unset!') |
| if self.publisherService is None: |
| raise TProtocolException(message='Required field publisherService 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) |