Blame | Last modification | View Log | RSS feed
## Autogenerated by Thrift Compiler (0.7.0)## DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING#from thrift.Thrift import *import shop2020.thriftpy.generic.ttypesfrom thrift.transport import TTransportfrom thrift.protocol import TBinaryProtocol, TProtocoltry:from thrift.protocol import fastbinaryexcept:fastbinary = Noneclass EntityType:"""Various structures*"""ORDER = 1COURIER = 2PRODUCT = 3TICKET = 4_VALUES_TO_NAMES = {1: "ORDER",2: "COURIER",3: "PRODUCT",4: "TICKET",}_NAMES_TO_VALUES = {"ORDER": 1,"COURIER": 2,"PRODUCT": 3,"TICKET": 4,}class EntityProcessedState:UNEXPIRED = 1WARNING_SENT = 2CRITICAL_SENT = 3_VALUES_TO_NAMES = {1: "UNEXPIRED",2: "WARNING_SENT",3: "CRITICAL_SENT",}_NAMES_TO_VALUES = {"UNEXPIRED": 1,"WARNING_SENT": 2,"CRITICAL_SENT": 3,}class AlertType:EMAIL = 1_VALUES_TO_NAMES = {1: "EMAIL",}_NAMES_TO_VALUES = {"EMAIL": 1,}class AlertServiceException(Exception):"""ExceptionsAttributes:- message- errorCode"""thrift_spec = (None, # 0(1, TType.STRING, 'message', None, None, ), # 1(2, TType.I32, 'errorCode', None, None, ), # 2)def __init__(self, message=None, errorCode=None,):self.message = messageself.errorCode = errorCodedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRING:self.message = iprot.readString();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I32:self.errorCode = iprot.readI32();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)))returnoprot.writeStructBegin('AlertServiceException')if self.message is not None:oprot.writeFieldBegin('message', TType.STRING, 1)oprot.writeString(self.message)oprot.writeFieldEnd()if self.errorCode is not None:oprot.writeFieldBegin('errorCode', TType.I32, 2)oprot.writeI32(self.errorCode)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __str__(self):return repr(self)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)class EntityMonitoringStatus:"""Attributes:- entityType- isActive- userIds"""thrift_spec = (None, # 0(1, TType.I32, 'entityType', None, None, ), # 1(2, TType.BOOL, 'isActive', None, None, ), # 2(3, TType.STRING, 'userIds', None, None, ), # 3)def __init__(self, entityType=None, isActive=None, userIds=None,):self.entityType = entityTypeself.isActive = isActiveself.userIds = userIdsdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I32:self.entityType = iprot.readI32();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.BOOL:self.isActive = iprot.readBool();else:iprot.skip(ftype)elif fid == 3:if ftype == TType.STRING:self.userIds = iprot.readString();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)))returnoprot.writeStructBegin('EntityMonitoringStatus')if self.entityType is not None:oprot.writeFieldBegin('entityType', TType.I32, 1)oprot.writeI32(self.entityType)oprot.writeFieldEnd()if self.isActive is not None:oprot.writeFieldBegin('isActive', TType.BOOL, 2)oprot.writeBool(self.isActive)oprot.writeFieldEnd()if self.userIds is not None:oprot.writeFieldBegin('userIds', TType.STRING, 3)oprot.writeString(self.userIds)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)class MonitoredEntity:"""Attributes:- id- entityType- eventType- entityIdentifier- warnExpiryTime- criticalExpiryTime- description- entityProcessedState"""thrift_spec = (None, # 0(1, TType.I64, 'id', None, None, ), # 1(2, TType.I32, 'entityType', None, None, ), # 2(3, TType.I32, 'eventType', None, None, ), # 3(4, TType.STRING, 'entityIdentifier', None, None, ), # 4(5, TType.I64, 'warnExpiryTime', None, None, ), # 5(6, TType.I64, 'criticalExpiryTime', None, None, ), # 6(7, TType.STRING, 'description', None, None, ), # 7(8, TType.I32, 'entityProcessedState', None, None, ), # 8)def __init__(self, id=None, entityType=None, eventType=None, entityIdentifier=None, warnExpiryTime=None, criticalExpiryTime=None, description=None, entityProcessedState=None,):self.id = idself.entityType = entityTypeself.eventType = eventTypeself.entityIdentifier = entityIdentifierself.warnExpiryTime = warnExpiryTimeself.criticalExpiryTime = criticalExpiryTimeself.description = descriptionself.entityProcessedState = entityProcessedStatedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.id = iprot.readI64();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.I32:self.eventType = iprot.readI32();else:iprot.skip(ftype)elif fid == 4:if ftype == TType.STRING:self.entityIdentifier = iprot.readString();else:iprot.skip(ftype)elif fid == 5:if ftype == TType.I64:self.warnExpiryTime = iprot.readI64();else:iprot.skip(ftype)elif fid == 6:if ftype == TType.I64:self.criticalExpiryTime = iprot.readI64();else:iprot.skip(ftype)elif fid == 7:if ftype == TType.STRING:self.description = iprot.readString();else:iprot.skip(ftype)elif fid == 8:if ftype == TType.I32:self.entityProcessedState = iprot.readI32();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)))returnoprot.writeStructBegin('MonitoredEntity')if self.id is not None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()if self.entityType is not None:oprot.writeFieldBegin('entityType', TType.I32, 2)oprot.writeI32(self.entityType)oprot.writeFieldEnd()if self.eventType is not None:oprot.writeFieldBegin('eventType', TType.I32, 3)oprot.writeI32(self.eventType)oprot.writeFieldEnd()if self.entityIdentifier is not None:oprot.writeFieldBegin('entityIdentifier', TType.STRING, 4)oprot.writeString(self.entityIdentifier)oprot.writeFieldEnd()if self.warnExpiryTime is not None:oprot.writeFieldBegin('warnExpiryTime', TType.I64, 5)oprot.writeI64(self.warnExpiryTime)oprot.writeFieldEnd()if self.criticalExpiryTime is not None:oprot.writeFieldBegin('criticalExpiryTime', TType.I64, 6)oprot.writeI64(self.criticalExpiryTime)oprot.writeFieldEnd()if self.description is not None:oprot.writeFieldBegin('description', TType.STRING, 7)oprot.writeString(self.description)oprot.writeFieldEnd()if self.entityProcessedState is not None:oprot.writeFieldBegin('entityProcessedState', TType.I32, 8)oprot.writeI32(self.entityProcessedState)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)class AlertMapper:"""Attributes:- entityType- eventType- eventdesciption- alertType- userIds"""thrift_spec = (None, # 0(1, TType.I32, 'entityType', None, None, ), # 1(2, TType.I32, 'eventType', None, None, ), # 2(3, TType.STRING, 'eventdesciption', None, None, ), # 3(4, TType.I32, 'alertType', None, None, ), # 4(5, TType.STRING, 'userIds', None, None, ), # 5)def __init__(self, entityType=None, eventType=None, eventdesciption=None, alertType=None, userIds=None,):self.entityType = entityTypeself.eventType = eventTypeself.eventdesciption = eventdesciptionself.alertType = alertTypeself.userIds = userIdsdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I32:self.entityType = iprot.readI32();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I32:self.eventType = iprot.readI32();else:iprot.skip(ftype)elif fid == 3:if ftype == TType.STRING:self.eventdesciption = iprot.readString();else:iprot.skip(ftype)elif fid == 4:if ftype == TType.I32:self.alertType = iprot.readI32();else:iprot.skip(ftype)elif fid == 5:if ftype == TType.STRING:self.userIds = iprot.readString();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)))returnoprot.writeStructBegin('AlertMapper')if self.entityType is not None:oprot.writeFieldBegin('entityType', TType.I32, 1)oprot.writeI32(self.entityType)oprot.writeFieldEnd()if self.eventType is not None:oprot.writeFieldBegin('eventType', TType.I32, 2)oprot.writeI32(self.eventType)oprot.writeFieldEnd()if self.eventdesciption is not None:oprot.writeFieldBegin('eventdesciption', TType.STRING, 3)oprot.writeString(self.eventdesciption)oprot.writeFieldEnd()if self.alertType is not None:oprot.writeFieldBegin('alertType', TType.I32, 4)oprot.writeI32(self.alertType)oprot.writeFieldEnd()if self.userIds is not None:oprot.writeFieldBegin('userIds', TType.STRING, 5)oprot.writeString(self.userIds)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)class AlertedEntity:"""Attributes:- id- entityType- eventType- entityIdentifier- description- entityProcessedState- lastAlertedTime"""thrift_spec = (None, # 0(1, TType.I64, 'id', None, None, ), # 1(2, TType.I32, 'entityType', None, None, ), # 2(3, TType.I32, 'eventType', None, None, ), # 3(4, TType.STRING, 'entityIdentifier', None, None, ), # 4(5, TType.STRING, 'description', None, None, ), # 5(6, TType.I32, 'entityProcessedState', None, None, ), # 6(7, TType.I64, 'lastAlertedTime', None, None, ), # 7)def __init__(self, id=None, entityType=None, eventType=None, entityIdentifier=None, description=None, entityProcessedState=None, lastAlertedTime=None,):self.id = idself.entityType = entityTypeself.eventType = eventTypeself.entityIdentifier = entityIdentifierself.description = descriptionself.entityProcessedState = entityProcessedStateself.lastAlertedTime = lastAlertedTimedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.id = iprot.readI64();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.I32:self.eventType = iprot.readI32();else:iprot.skip(ftype)elif fid == 4:if ftype == TType.STRING:self.entityIdentifier = iprot.readString();else:iprot.skip(ftype)elif fid == 5:if ftype == TType.STRING:self.description = iprot.readString();else:iprot.skip(ftype)elif fid == 6:if ftype == TType.I32:self.entityProcessedState = iprot.readI32();else:iprot.skip(ftype)elif fid == 7:if ftype == TType.I64:self.lastAlertedTime = iprot.readI64();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)))returnoprot.writeStructBegin('AlertedEntity')if self.id is not None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()if self.entityType is not None:oprot.writeFieldBegin('entityType', TType.I32, 2)oprot.writeI32(self.entityType)oprot.writeFieldEnd()if self.eventType is not None:oprot.writeFieldBegin('eventType', TType.I32, 3)oprot.writeI32(self.eventType)oprot.writeFieldEnd()if self.entityIdentifier is not None:oprot.writeFieldBegin('entityIdentifier', TType.STRING, 4)oprot.writeString(self.entityIdentifier)oprot.writeFieldEnd()if self.description is not None:oprot.writeFieldBegin('description', TType.STRING, 5)oprot.writeString(self.description)oprot.writeFieldEnd()if self.entityProcessedState is not None:oprot.writeFieldBegin('entityProcessedState', TType.I32, 6)oprot.writeI32(self.entityProcessedState)oprot.writeFieldEnd()if self.lastAlertedTime is not None:oprot.writeFieldBegin('lastAlertedTime', TType.I64, 7)oprot.writeI64(self.lastAlertedTime)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)class SearchFilter:"""Attributes:- entityType- eventType- entityIdentifier- warnExpiryTime- criticalExpiryTime- entityProcessedState"""thrift_spec = (None, # 0(1, TType.I32, 'entityType', None, None, ), # 1(2, TType.I32, 'eventType', None, None, ), # 2(3, TType.STRING, 'entityIdentifier', None, None, ), # 3(4, TType.I64, 'warnExpiryTime', None, None, ), # 4(5, TType.I64, 'criticalExpiryTime', None, None, ), # 5(6, TType.I32, 'entityProcessedState', None, None, ), # 6)def __init__(self, entityType=None, eventType=None, entityIdentifier=None, warnExpiryTime=None, criticalExpiryTime=None, entityProcessedState=None,):self.entityType = entityTypeself.eventType = eventTypeself.entityIdentifier = entityIdentifierself.warnExpiryTime = warnExpiryTimeself.criticalExpiryTime = criticalExpiryTimeself.entityProcessedState = entityProcessedStatedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I32:self.entityType = iprot.readI32();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I32:self.eventType = iprot.readI32();else:iprot.skip(ftype)elif fid == 3:if ftype == TType.STRING:self.entityIdentifier = iprot.readString();else:iprot.skip(ftype)elif fid == 4:if ftype == TType.I64:self.warnExpiryTime = iprot.readI64();else:iprot.skip(ftype)elif fid == 5:if ftype == TType.I64:self.criticalExpiryTime = iprot.readI64();else:iprot.skip(ftype)elif fid == 6:if ftype == TType.I32:self.entityProcessedState = iprot.readI32();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)))returnoprot.writeStructBegin('SearchFilter')if self.entityType is not None:oprot.writeFieldBegin('entityType', TType.I32, 1)oprot.writeI32(self.entityType)oprot.writeFieldEnd()if self.eventType is not None:oprot.writeFieldBegin('eventType', TType.I32, 2)oprot.writeI32(self.eventType)oprot.writeFieldEnd()if self.entityIdentifier is not None:oprot.writeFieldBegin('entityIdentifier', TType.STRING, 3)oprot.writeString(self.entityIdentifier)oprot.writeFieldEnd()if self.warnExpiryTime is not None:oprot.writeFieldBegin('warnExpiryTime', TType.I64, 4)oprot.writeI64(self.warnExpiryTime)oprot.writeFieldEnd()if self.criticalExpiryTime is not None:oprot.writeFieldBegin('criticalExpiryTime', TType.I64, 5)oprot.writeI64(self.criticalExpiryTime)oprot.writeFieldEnd()if self.entityProcessedState is not None:oprot.writeFieldBegin('entityProcessedState', TType.I32, 6)oprot.writeI32(self.entityProcessedState)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)