# # Autogenerated by Thrift Compiler (0.20.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 from thrift.TRecursive import fix_spec import sys import pangramia.base_service.BaseService import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(pangramia.base_service.BaseService.Iface): def getProxyStatus(self, serverIdentity): """ Parameters: - serverIdentity """ pass def banProxy(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ pass def unbanProxy(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ pass def resetAllProxyStatuses(self, serverIdentity): """ Parameters: - serverIdentity """ pass def banAllProxies(self, serverIdentity): """ Parameters: - serverIdentity """ pass def deleteProxyFromRedis(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ pass def deleteAllProxiesFromRedis(self, serverIdentity): """ Parameters: - serverIdentity """ pass def getAccountStatus(self, accountId, accountPrefix): """ Parameters: - accountId - accountPrefix """ pass def banAccount(self, accountId, reason): """ Parameters: - accountId - reason """ pass def unbanAccount(self, accountId, reason): """ Parameters: - accountId - reason """ pass def deleteAccountFromRedis(self, accountId): """ Parameters: - accountId """ pass def deleteAllAccountsFromRedis(self, accountPrefix): """ Parameters: - accountPrefix """ pass class Client(pangramia.base_service.BaseService.Client, Iface): def __init__(self, iprot, oprot=None): pangramia.base_service.BaseService.Client.__init__(self, iprot, oprot) def getProxyStatus(self, serverIdentity): """ Parameters: - serverIdentity """ self.send_getProxyStatus(serverIdentity) return self.recv_getProxyStatus() def send_getProxyStatus(self, serverIdentity): self._oprot.writeMessageBegin('getProxyStatus', TMessageType.CALL, self._seqid) args = getProxyStatus_args() args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getProxyStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getProxyStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "getProxyStatus failed: unknown result") def banProxy(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ self.send_banProxy(proxyUrl, serverIdentity) return self.recv_banProxy() def send_banProxy(self, proxyUrl, serverIdentity): self._oprot.writeMessageBegin('banProxy', TMessageType.CALL, self._seqid) args = banProxy_args() args.proxyUrl = proxyUrl args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_banProxy(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = banProxy_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "banProxy failed: unknown result") def unbanProxy(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ self.send_unbanProxy(proxyUrl, serverIdentity) return self.recv_unbanProxy() def send_unbanProxy(self, proxyUrl, serverIdentity): self._oprot.writeMessageBegin('unbanProxy', TMessageType.CALL, self._seqid) args = unbanProxy_args() args.proxyUrl = proxyUrl args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_unbanProxy(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = unbanProxy_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "unbanProxy failed: unknown result") def resetAllProxyStatuses(self, serverIdentity): """ Parameters: - serverIdentity """ self.send_resetAllProxyStatuses(serverIdentity) return self.recv_resetAllProxyStatuses() def send_resetAllProxyStatuses(self, serverIdentity): self._oprot.writeMessageBegin('resetAllProxyStatuses', TMessageType.CALL, self._seqid) args = resetAllProxyStatuses_args() args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_resetAllProxyStatuses(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = resetAllProxyStatuses_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "resetAllProxyStatuses failed: unknown result") def banAllProxies(self, serverIdentity): """ Parameters: - serverIdentity """ self.send_banAllProxies(serverIdentity) return self.recv_banAllProxies() def send_banAllProxies(self, serverIdentity): self._oprot.writeMessageBegin('banAllProxies', TMessageType.CALL, self._seqid) args = banAllProxies_args() args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_banAllProxies(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = banAllProxies_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "banAllProxies failed: unknown result") def deleteProxyFromRedis(self, proxyUrl, serverIdentity): """ Parameters: - proxyUrl - serverIdentity """ self.send_deleteProxyFromRedis(proxyUrl, serverIdentity) return self.recv_deleteProxyFromRedis() def send_deleteProxyFromRedis(self, proxyUrl, serverIdentity): self._oprot.writeMessageBegin('deleteProxyFromRedis', TMessageType.CALL, self._seqid) args = deleteProxyFromRedis_args() args.proxyUrl = proxyUrl args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_deleteProxyFromRedis(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = deleteProxyFromRedis_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteProxyFromRedis failed: unknown result") def deleteAllProxiesFromRedis(self, serverIdentity): """ Parameters: - serverIdentity """ self.send_deleteAllProxiesFromRedis(serverIdentity) return self.recv_deleteAllProxiesFromRedis() def send_deleteAllProxiesFromRedis(self, serverIdentity): self._oprot.writeMessageBegin('deleteAllProxiesFromRedis', TMessageType.CALL, self._seqid) args = deleteAllProxiesFromRedis_args() args.serverIdentity = serverIdentity args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_deleteAllProxiesFromRedis(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = deleteAllProxiesFromRedis_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteAllProxiesFromRedis failed: unknown result") def getAccountStatus(self, accountId, accountPrefix): """ Parameters: - accountId - accountPrefix """ self.send_getAccountStatus(accountId, accountPrefix) return self.recv_getAccountStatus() def send_getAccountStatus(self, accountId, accountPrefix): self._oprot.writeMessageBegin('getAccountStatus', TMessageType.CALL, self._seqid) args = getAccountStatus_args() args.accountId = accountId args.accountPrefix = accountPrefix args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getAccountStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = getAccountStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "getAccountStatus failed: unknown result") def banAccount(self, accountId, reason): """ Parameters: - accountId - reason """ self.send_banAccount(accountId, reason) return self.recv_banAccount() def send_banAccount(self, accountId, reason): self._oprot.writeMessageBegin('banAccount', TMessageType.CALL, self._seqid) args = banAccount_args() args.accountId = accountId args.reason = reason args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_banAccount(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = banAccount_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "banAccount failed: unknown result") def unbanAccount(self, accountId, reason): """ Parameters: - accountId - reason """ self.send_unbanAccount(accountId, reason) return self.recv_unbanAccount() def send_unbanAccount(self, accountId, reason): self._oprot.writeMessageBegin('unbanAccount', TMessageType.CALL, self._seqid) args = unbanAccount_args() args.accountId = accountId args.reason = reason args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_unbanAccount(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = unbanAccount_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "unbanAccount failed: unknown result") def deleteAccountFromRedis(self, accountId): """ Parameters: - accountId """ self.send_deleteAccountFromRedis(accountId) return self.recv_deleteAccountFromRedis() def send_deleteAccountFromRedis(self, accountId): self._oprot.writeMessageBegin('deleteAccountFromRedis', TMessageType.CALL, self._seqid) args = deleteAccountFromRedis_args() args.accountId = accountId args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_deleteAccountFromRedis(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = deleteAccountFromRedis_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteAccountFromRedis failed: unknown result") def deleteAllAccountsFromRedis(self, accountPrefix): """ Parameters: - accountPrefix """ self.send_deleteAllAccountsFromRedis(accountPrefix) return self.recv_deleteAllAccountsFromRedis() def send_deleteAllAccountsFromRedis(self, accountPrefix): self._oprot.writeMessageBegin('deleteAllAccountsFromRedis', TMessageType.CALL, self._seqid) args = deleteAllAccountsFromRedis_args() args.accountPrefix = accountPrefix args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_deleteAllAccountsFromRedis(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = deleteAllAccountsFromRedis_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.serviceExp is not None: raise result.serviceExp if result.userExp is not None: raise result.userExp raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteAllAccountsFromRedis failed: unknown result") class Processor(pangramia.base_service.BaseService.Processor, Iface, TProcessor): def __init__(self, handler): pangramia.base_service.BaseService.Processor.__init__(self, handler) self._processMap["getProxyStatus"] = Processor.process_getProxyStatus self._processMap["banProxy"] = Processor.process_banProxy self._processMap["unbanProxy"] = Processor.process_unbanProxy self._processMap["resetAllProxyStatuses"] = Processor.process_resetAllProxyStatuses self._processMap["banAllProxies"] = Processor.process_banAllProxies self._processMap["deleteProxyFromRedis"] = Processor.process_deleteProxyFromRedis self._processMap["deleteAllProxiesFromRedis"] = Processor.process_deleteAllProxiesFromRedis self._processMap["getAccountStatus"] = Processor.process_getAccountStatus self._processMap["banAccount"] = Processor.process_banAccount self._processMap["unbanAccount"] = Processor.process_unbanAccount self._processMap["deleteAccountFromRedis"] = Processor.process_deleteAccountFromRedis self._processMap["deleteAllAccountsFromRedis"] = Processor.process_deleteAllAccountsFromRedis self._on_message_begin = None def on_message_begin(self, func): self._on_message_begin = func def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if self._on_message_begin: self._on_message_begin(name, type, seqid) if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_getProxyStatus(self, seqid, iprot, oprot): args = getProxyStatus_args() args.read(iprot) iprot.readMessageEnd() result = getProxyStatus_result() try: result.success = self._handler.getProxyStatus(args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getProxyStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_banProxy(self, seqid, iprot, oprot): args = banProxy_args() args.read(iprot) iprot.readMessageEnd() result = banProxy_result() try: result.success = self._handler.banProxy(args.proxyUrl, args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("banProxy", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_unbanProxy(self, seqid, iprot, oprot): args = unbanProxy_args() args.read(iprot) iprot.readMessageEnd() result = unbanProxy_result() try: result.success = self._handler.unbanProxy(args.proxyUrl, args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("unbanProxy", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_resetAllProxyStatuses(self, seqid, iprot, oprot): args = resetAllProxyStatuses_args() args.read(iprot) iprot.readMessageEnd() result = resetAllProxyStatuses_result() try: result.success = self._handler.resetAllProxyStatuses(args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("resetAllProxyStatuses", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_banAllProxies(self, seqid, iprot, oprot): args = banAllProxies_args() args.read(iprot) iprot.readMessageEnd() result = banAllProxies_result() try: result.success = self._handler.banAllProxies(args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("banAllProxies", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_deleteProxyFromRedis(self, seqid, iprot, oprot): args = deleteProxyFromRedis_args() args.read(iprot) iprot.readMessageEnd() result = deleteProxyFromRedis_result() try: result.success = self._handler.deleteProxyFromRedis(args.proxyUrl, args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("deleteProxyFromRedis", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_deleteAllProxiesFromRedis(self, seqid, iprot, oprot): args = deleteAllProxiesFromRedis_args() args.read(iprot) iprot.readMessageEnd() result = deleteAllProxiesFromRedis_result() try: result.success = self._handler.deleteAllProxiesFromRedis(args.serverIdentity) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("deleteAllProxiesFromRedis", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getAccountStatus(self, seqid, iprot, oprot): args = getAccountStatus_args() args.read(iprot) iprot.readMessageEnd() result = getAccountStatus_result() try: result.success = self._handler.getAccountStatus(args.accountId, args.accountPrefix) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("getAccountStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_banAccount(self, seqid, iprot, oprot): args = banAccount_args() args.read(iprot) iprot.readMessageEnd() result = banAccount_result() try: result.success = self._handler.banAccount(args.accountId, args.reason) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("banAccount", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_unbanAccount(self, seqid, iprot, oprot): args = unbanAccount_args() args.read(iprot) iprot.readMessageEnd() result = unbanAccount_result() try: result.success = self._handler.unbanAccount(args.accountId, args.reason) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("unbanAccount", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_deleteAccountFromRedis(self, seqid, iprot, oprot): args = deleteAccountFromRedis_args() args.read(iprot) iprot.readMessageEnd() result = deleteAccountFromRedis_result() try: result.success = self._handler.deleteAccountFromRedis(args.accountId) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("deleteAccountFromRedis", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_deleteAllAccountsFromRedis(self, seqid, iprot, oprot): args = deleteAllAccountsFromRedis_args() args.read(iprot) iprot.readMessageEnd() result = deleteAllAccountsFromRedis_result() try: result.success = self._handler.deleteAllAccountsFromRedis(args.accountPrefix) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except pangramia.yt.exceptions.ttypes.PBServiceException as serviceExp: msg_type = TMessageType.REPLY result.serviceExp = serviceExp except pangramia.yt.exceptions.ttypes.PBUserException as userExp: msg_type = TMessageType.REPLY result.userExp = userExp except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("deleteAllAccountsFromRedis", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class getProxyStatus_args(object): """ Attributes: - serverIdentity """ def __init__(self, serverIdentity=None,): self.serverIdentity = serverIdentity 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.serverIdentity = 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('getProxyStatus_args') if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 1) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(getProxyStatus_args) getProxyStatus_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 1 ) class getProxyStatus_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.LIST: self.success = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = pangramia.yt.common.ttypes.ProxyStatus() _elem5.read(iprot) self.success.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('getProxyStatus_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter6 in self.success: iter6.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(getProxyStatus_result) getProxyStatus_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [pangramia.yt.common.ttypes.ProxyStatus, None], False), None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class banProxy_args(object): """ Attributes: - proxyUrl - serverIdentity """ def __init__(self, proxyUrl=None, serverIdentity=None,): self.proxyUrl = proxyUrl self.serverIdentity = serverIdentity 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.proxyUrl = 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.STRING: self.serverIdentity = 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('banProxy_args') if self.proxyUrl is not None: oprot.writeFieldBegin('proxyUrl', TType.STRING, 1) oprot.writeString(self.proxyUrl.encode('utf-8') if sys.version_info[0] == 2 else self.proxyUrl) oprot.writeFieldEnd() if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 2) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(banProxy_args) banProxy_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'proxyUrl', 'UTF8', None, ), # 1 (2, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 2 ) class banProxy_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('banProxy_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(banProxy_result) banProxy_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class unbanProxy_args(object): """ Attributes: - proxyUrl - serverIdentity """ def __init__(self, proxyUrl=None, serverIdentity=None,): self.proxyUrl = proxyUrl self.serverIdentity = serverIdentity 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.proxyUrl = 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.STRING: self.serverIdentity = 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('unbanProxy_args') if self.proxyUrl is not None: oprot.writeFieldBegin('proxyUrl', TType.STRING, 1) oprot.writeString(self.proxyUrl.encode('utf-8') if sys.version_info[0] == 2 else self.proxyUrl) oprot.writeFieldEnd() if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 2) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(unbanProxy_args) unbanProxy_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'proxyUrl', 'UTF8', None, ), # 1 (2, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 2 ) class unbanProxy_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('unbanProxy_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(unbanProxy_result) unbanProxy_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class resetAllProxyStatuses_args(object): """ Attributes: - serverIdentity """ def __init__(self, serverIdentity=None,): self.serverIdentity = serverIdentity 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.serverIdentity = 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('resetAllProxyStatuses_args') if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 1) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(resetAllProxyStatuses_args) resetAllProxyStatuses_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 1 ) class resetAllProxyStatuses_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('resetAllProxyStatuses_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(resetAllProxyStatuses_result) resetAllProxyStatuses_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class banAllProxies_args(object): """ Attributes: - serverIdentity """ def __init__(self, serverIdentity=None,): self.serverIdentity = serverIdentity 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.serverIdentity = 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('banAllProxies_args') if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 1) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(banAllProxies_args) banAllProxies_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 1 ) class banAllProxies_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('banAllProxies_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(banAllProxies_result) banAllProxies_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class deleteProxyFromRedis_args(object): """ Attributes: - proxyUrl - serverIdentity """ def __init__(self, proxyUrl=None, serverIdentity=None,): self.proxyUrl = proxyUrl self.serverIdentity = serverIdentity 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.proxyUrl = 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.STRING: self.serverIdentity = 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('deleteProxyFromRedis_args') if self.proxyUrl is not None: oprot.writeFieldBegin('proxyUrl', TType.STRING, 1) oprot.writeString(self.proxyUrl.encode('utf-8') if sys.version_info[0] == 2 else self.proxyUrl) oprot.writeFieldEnd() if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 2) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(deleteProxyFromRedis_args) deleteProxyFromRedis_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'proxyUrl', 'UTF8', None, ), # 1 (2, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 2 ) class deleteProxyFromRedis_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('deleteProxyFromRedis_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(deleteProxyFromRedis_result) deleteProxyFromRedis_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class deleteAllProxiesFromRedis_args(object): """ Attributes: - serverIdentity """ def __init__(self, serverIdentity=None,): self.serverIdentity = serverIdentity 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.serverIdentity = 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('deleteAllProxiesFromRedis_args') if self.serverIdentity is not None: oprot.writeFieldBegin('serverIdentity', TType.STRING, 1) oprot.writeString(self.serverIdentity.encode('utf-8') if sys.version_info[0] == 2 else self.serverIdentity) 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) all_structs.append(deleteAllProxiesFromRedis_args) deleteAllProxiesFromRedis_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'serverIdentity', 'UTF8', None, ), # 1 ) class deleteAllProxiesFromRedis_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.I32: self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('deleteAllProxiesFromRedis_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I32, 0) oprot.writeI32(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(deleteAllProxiesFromRedis_result) deleteAllProxiesFromRedis_result.thrift_spec = ( (0, TType.I32, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class getAccountStatus_args(object): """ Attributes: - accountId - accountPrefix """ def __init__(self, accountId=None, accountPrefix=None,): self.accountId = accountId self.accountPrefix = accountPrefix 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.accountId = 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.STRING: self.accountPrefix = 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('getAccountStatus_args') if self.accountId is not None: oprot.writeFieldBegin('accountId', TType.STRING, 1) oprot.writeString(self.accountId.encode('utf-8') if sys.version_info[0] == 2 else self.accountId) oprot.writeFieldEnd() if self.accountPrefix is not None: oprot.writeFieldBegin('accountPrefix', TType.STRING, 2) oprot.writeString(self.accountPrefix.encode('utf-8') if sys.version_info[0] == 2 else self.accountPrefix) 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) all_structs.append(getAccountStatus_args) getAccountStatus_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'accountId', 'UTF8', None, ), # 1 (2, TType.STRING, 'accountPrefix', 'UTF8', None, ), # 2 ) class getAccountStatus_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.LIST: self.success = [] (_etype10, _size7) = iprot.readListBegin() for _i11 in range(_size7): _elem12 = pangramia.yt.common.ttypes.AccountStatus() _elem12.read(iprot) self.success.append(_elem12) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('getAccountStatus_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter13 in self.success: iter13.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(getAccountStatus_result) getAccountStatus_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [pangramia.yt.common.ttypes.AccountStatus, None], False), None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class banAccount_args(object): """ Attributes: - accountId - reason """ def __init__(self, accountId=None, reason=None,): self.accountId = accountId self.reason = reason 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.accountId = 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.STRING: self.reason = 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('banAccount_args') if self.accountId is not None: oprot.writeFieldBegin('accountId', TType.STRING, 1) oprot.writeString(self.accountId.encode('utf-8') if sys.version_info[0] == 2 else self.accountId) oprot.writeFieldEnd() if self.reason is not None: oprot.writeFieldBegin('reason', TType.STRING, 2) oprot.writeString(self.reason.encode('utf-8') if sys.version_info[0] == 2 else self.reason) 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) all_structs.append(banAccount_args) banAccount_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'accountId', 'UTF8', None, ), # 1 (2, TType.STRING, 'reason', 'UTF8', None, ), # 2 ) class banAccount_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('banAccount_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(banAccount_result) banAccount_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class unbanAccount_args(object): """ Attributes: - accountId - reason """ def __init__(self, accountId=None, reason=None,): self.accountId = accountId self.reason = reason 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.accountId = 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.STRING: self.reason = 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('unbanAccount_args') if self.accountId is not None: oprot.writeFieldBegin('accountId', TType.STRING, 1) oprot.writeString(self.accountId.encode('utf-8') if sys.version_info[0] == 2 else self.accountId) oprot.writeFieldEnd() if self.reason is not None: oprot.writeFieldBegin('reason', TType.STRING, 2) oprot.writeString(self.reason.encode('utf-8') if sys.version_info[0] == 2 else self.reason) 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) all_structs.append(unbanAccount_args) unbanAccount_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'accountId', 'UTF8', None, ), # 1 (2, TType.STRING, 'reason', 'UTF8', None, ), # 2 ) class unbanAccount_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('unbanAccount_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(unbanAccount_result) unbanAccount_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class deleteAccountFromRedis_args(object): """ Attributes: - accountId """ def __init__(self, accountId=None,): self.accountId = accountId 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.accountId = 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('deleteAccountFromRedis_args') if self.accountId is not None: oprot.writeFieldBegin('accountId', TType.STRING, 1) oprot.writeString(self.accountId.encode('utf-8') if sys.version_info[0] == 2 else self.accountId) 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) all_structs.append(deleteAccountFromRedis_args) deleteAccountFromRedis_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'accountId', 'UTF8', None, ), # 1 ) class deleteAccountFromRedis_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('deleteAccountFromRedis_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(deleteAccountFromRedis_result) deleteAccountFromRedis_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) class deleteAllAccountsFromRedis_args(object): """ Attributes: - accountPrefix """ def __init__(self, accountPrefix=None,): self.accountPrefix = accountPrefix 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.accountPrefix = 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('deleteAllAccountsFromRedis_args') if self.accountPrefix is not None: oprot.writeFieldBegin('accountPrefix', TType.STRING, 1) oprot.writeString(self.accountPrefix.encode('utf-8') if sys.version_info[0] == 2 else self.accountPrefix) 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) all_structs.append(deleteAllAccountsFromRedis_args) deleteAllAccountsFromRedis_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'accountPrefix', 'UTF8', None, ), # 1 ) class deleteAllAccountsFromRedis_result(object): """ Attributes: - success - serviceExp - userExp """ def __init__(self, success=None, serviceExp=None, userExp=None,): self.success = success self.serviceExp = serviceExp self.userExp = userExp 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 == 0: if ftype == TType.I32: self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.serviceExp = pangramia.yt.exceptions.ttypes.PBServiceException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.userExp = pangramia.yt.exceptions.ttypes.PBUserException.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('deleteAllAccountsFromRedis_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I32, 0) oprot.writeI32(self.success) oprot.writeFieldEnd() if self.serviceExp is not None: oprot.writeFieldBegin('serviceExp', TType.STRUCT, 1) self.serviceExp.write(oprot) oprot.writeFieldEnd() if self.userExp is not None: oprot.writeFieldBegin('userExp', TType.STRUCT, 2) self.userExp.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) all_structs.append(deleteAllAccountsFromRedis_result) deleteAllAccountsFromRedis_result.thrift_spec = ( (0, TType.I32, 'success', None, None, ), # 0 (1, TType.STRUCT, 'serviceExp', [pangramia.yt.exceptions.ttypes.PBServiceException, None], None, ), # 1 (2, TType.STRUCT, 'userExp', [pangramia.yt.exceptions.ttypes.PBUserException, None], None, ), # 2 ) fix_spec(all_structs) del all_structs