mirror of
https://github.com/studio-neptune/yuuki.git
synced 2024-09-20 16:35:56 +08:00
Update and Switch core from olsb_core to yuuki_core
This commit is contained in:
parent
0324db1564
commit
d15ae8cfeb
|
@ -1,152 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import AccountSupervisorService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' RSAKey getRSAKey()')
|
||||
print(' void notifyEmailConfirmationResult( parameterMap)')
|
||||
print(' string registerVirtualAccount(string locale, string encryptedVirtualUserId, string encryptedPassword)')
|
||||
print(' void requestVirtualAccountPasswordChange(string virtualMid, string encryptedVirtualUserId, string encryptedOldPassword, string encryptedNewPassword)')
|
||||
print(' void requestVirtualAccountPasswordSet(string virtualMid, string encryptedVirtualUserId, string encryptedNewPassword)')
|
||||
print(' void unregisterVirtualAccount(string virtualMid)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = AccountSupervisorService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'getRSAKey':
|
||||
if len(args) != 0:
|
||||
print('getRSAKey requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getRSAKey())
|
||||
|
||||
elif cmd == 'notifyEmailConfirmationResult':
|
||||
if len(args) != 1:
|
||||
print('notifyEmailConfirmationResult requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.notifyEmailConfirmationResult(eval(args[0]),))
|
||||
|
||||
elif cmd == 'registerVirtualAccount':
|
||||
if len(args) != 3:
|
||||
print('registerVirtualAccount requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.registerVirtualAccount(args[0], args[1], args[2],))
|
||||
|
||||
elif cmd == 'requestVirtualAccountPasswordChange':
|
||||
if len(args) != 4:
|
||||
print('requestVirtualAccountPasswordChange requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.requestVirtualAccountPasswordChange(args[0], args[1], args[2], args[3],))
|
||||
|
||||
elif cmd == 'requestVirtualAccountPasswordSet':
|
||||
if len(args) != 3:
|
||||
print('requestVirtualAccountPasswordSet requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.requestVirtualAccountPasswordSet(args[0], args[1], args[2],))
|
||||
|
||||
elif cmd == 'unregisterVirtualAccount':
|
||||
if len(args) != 1:
|
||||
print('unregisterVirtualAccount requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.unregisterVirtualAccount(args[0],))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,138 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import AgeCheckService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' UserAgeType checkUserAge(CarrierCode carrier, string sessionId, string verifier, i32 standardAge)')
|
||||
print(' AgeCheckDocomoResult checkUserAgeWithDocomo(string openIdRedirectUrl, i32 standardAge, string verifier)')
|
||||
print(' string retrieveOpenIdAuthUrlWithDocomo()')
|
||||
print(' AgeCheckRequestResult retrieveRequestToken(CarrierCode carrier)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = AgeCheckService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'checkUserAge':
|
||||
if len(args) != 4:
|
||||
print('checkUserAge requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.checkUserAge(eval(args[0]), args[1], args[2], eval(args[3]),))
|
||||
|
||||
elif cmd == 'checkUserAgeWithDocomo':
|
||||
if len(args) != 3:
|
||||
print('checkUserAgeWithDocomo requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.checkUserAgeWithDocomo(args[0], eval(args[1]), args[2],))
|
||||
|
||||
elif cmd == 'retrieveOpenIdAuthUrlWithDocomo':
|
||||
if len(args) != 0:
|
||||
print('retrieveOpenIdAuthUrlWithDocomo requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.retrieveOpenIdAuthUrlWithDocomo())
|
||||
|
||||
elif cmd == 'retrieveRequestToken':
|
||||
if len(args) != 1:
|
||||
print('retrieveRequestToken requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.retrieveRequestToken(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
|
@ -1,930 +0,0 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.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 logging
|
||||
from .ttypes import *
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.transport import TTransport
|
||||
all_structs = []
|
||||
|
||||
|
||||
class Iface(object):
|
||||
def checkUserAge(self, carrier, sessionId, verifier, standardAge):
|
||||
"""
|
||||
Parameters:
|
||||
- carrier
|
||||
- sessionId
|
||||
- verifier
|
||||
- standardAge
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def checkUserAgeWithDocomo(self, openIdRedirectUrl, standardAge, verifier):
|
||||
"""
|
||||
Parameters:
|
||||
- openIdRedirectUrl
|
||||
- standardAge
|
||||
- verifier
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def retrieveOpenIdAuthUrlWithDocomo(self):
|
||||
pass
|
||||
|
||||
def retrieveRequestToken(self, carrier):
|
||||
"""
|
||||
Parameters:
|
||||
- carrier
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Client(Iface):
|
||||
def __init__(self, iprot, oprot=None):
|
||||
self._iprot = self._oprot = iprot
|
||||
if oprot is not None:
|
||||
self._oprot = oprot
|
||||
self._seqid = 0
|
||||
|
||||
def checkUserAge(self, carrier, sessionId, verifier, standardAge):
|
||||
"""
|
||||
Parameters:
|
||||
- carrier
|
||||
- sessionId
|
||||
- verifier
|
||||
- standardAge
|
||||
|
||||
"""
|
||||
self.send_checkUserAge(carrier, sessionId, verifier, standardAge)
|
||||
return self.recv_checkUserAge()
|
||||
|
||||
def send_checkUserAge(self, carrier, sessionId, verifier, standardAge):
|
||||
self._oprot.writeMessageBegin('checkUserAge', TMessageType.CALL, self._seqid)
|
||||
args = checkUserAge_args()
|
||||
args.carrier = carrier
|
||||
args.sessionId = sessionId
|
||||
args.verifier = verifier
|
||||
args.standardAge = standardAge
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_checkUserAge(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = checkUserAge_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "checkUserAge failed: unknown result")
|
||||
|
||||
def checkUserAgeWithDocomo(self, openIdRedirectUrl, standardAge, verifier):
|
||||
"""
|
||||
Parameters:
|
||||
- openIdRedirectUrl
|
||||
- standardAge
|
||||
- verifier
|
||||
|
||||
"""
|
||||
self.send_checkUserAgeWithDocomo(openIdRedirectUrl, standardAge, verifier)
|
||||
return self.recv_checkUserAgeWithDocomo()
|
||||
|
||||
def send_checkUserAgeWithDocomo(self, openIdRedirectUrl, standardAge, verifier):
|
||||
self._oprot.writeMessageBegin('checkUserAgeWithDocomo', TMessageType.CALL, self._seqid)
|
||||
args = checkUserAgeWithDocomo_args()
|
||||
args.openIdRedirectUrl = openIdRedirectUrl
|
||||
args.standardAge = standardAge
|
||||
args.verifier = verifier
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_checkUserAgeWithDocomo(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = checkUserAgeWithDocomo_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "checkUserAgeWithDocomo failed: unknown result")
|
||||
|
||||
def retrieveOpenIdAuthUrlWithDocomo(self):
|
||||
self.send_retrieveOpenIdAuthUrlWithDocomo()
|
||||
return self.recv_retrieveOpenIdAuthUrlWithDocomo()
|
||||
|
||||
def send_retrieveOpenIdAuthUrlWithDocomo(self):
|
||||
self._oprot.writeMessageBegin('retrieveOpenIdAuthUrlWithDocomo', TMessageType.CALL, self._seqid)
|
||||
args = retrieveOpenIdAuthUrlWithDocomo_args()
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_retrieveOpenIdAuthUrlWithDocomo(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = retrieveOpenIdAuthUrlWithDocomo_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "retrieveOpenIdAuthUrlWithDocomo failed: unknown result")
|
||||
|
||||
def retrieveRequestToken(self, carrier):
|
||||
"""
|
||||
Parameters:
|
||||
- carrier
|
||||
|
||||
"""
|
||||
self.send_retrieveRequestToken(carrier)
|
||||
return self.recv_retrieveRequestToken()
|
||||
|
||||
def send_retrieveRequestToken(self, carrier):
|
||||
self._oprot.writeMessageBegin('retrieveRequestToken', TMessageType.CALL, self._seqid)
|
||||
args = retrieveRequestToken_args()
|
||||
args.carrier = carrier
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_retrieveRequestToken(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = retrieveRequestToken_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "retrieveRequestToken failed: unknown result")
|
||||
|
||||
|
||||
class Processor(Iface, TProcessor):
|
||||
def __init__(self, handler):
|
||||
self._handler = handler
|
||||
self._processMap = {}
|
||||
self._processMap["checkUserAge"] = Processor.process_checkUserAge
|
||||
self._processMap["checkUserAgeWithDocomo"] = Processor.process_checkUserAgeWithDocomo
|
||||
self._processMap["retrieveOpenIdAuthUrlWithDocomo"] = Processor.process_retrieveOpenIdAuthUrlWithDocomo
|
||||
self._processMap["retrieveRequestToken"] = Processor.process_retrieveRequestToken
|
||||
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_checkUserAge(self, seqid, iprot, oprot):
|
||||
args = checkUserAge_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = checkUserAge_result()
|
||||
try:
|
||||
result.success = self._handler.checkUserAge(args.carrier, args.sessionId, args.verifier, args.standardAge)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("checkUserAge", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_checkUserAgeWithDocomo(self, seqid, iprot, oprot):
|
||||
args = checkUserAgeWithDocomo_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = checkUserAgeWithDocomo_result()
|
||||
try:
|
||||
result.success = self._handler.checkUserAgeWithDocomo(args.openIdRedirectUrl, args.standardAge, args.verifier)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("checkUserAgeWithDocomo", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_retrieveOpenIdAuthUrlWithDocomo(self, seqid, iprot, oprot):
|
||||
args = retrieveOpenIdAuthUrlWithDocomo_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = retrieveOpenIdAuthUrlWithDocomo_result()
|
||||
try:
|
||||
result.success = self._handler.retrieveOpenIdAuthUrlWithDocomo()
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("retrieveOpenIdAuthUrlWithDocomo", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_retrieveRequestToken(self, seqid, iprot, oprot):
|
||||
args = retrieveRequestToken_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = retrieveRequestToken_result()
|
||||
try:
|
||||
result.success = self._handler.retrieveRequestToken(args.carrier)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("retrieveRequestToken", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
# HELPER FUNCTIONS AND STRUCTURES
|
||||
|
||||
|
||||
class checkUserAge_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- carrier
|
||||
- sessionId
|
||||
- verifier
|
||||
- standardAge
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, carrier=None, sessionId=None, verifier=None, standardAge=None,):
|
||||
self.carrier = carrier
|
||||
self.sessionId = sessionId
|
||||
self.verifier = verifier
|
||||
self.standardAge = standardAge
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I32:
|
||||
self.carrier = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.STRING:
|
||||
self.sessionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 4:
|
||||
if ftype == TType.STRING:
|
||||
self.verifier = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 5:
|
||||
if ftype == TType.I32:
|
||||
self.standardAge = iprot.readI32()
|
||||
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('checkUserAge_args')
|
||||
if self.carrier is not None:
|
||||
oprot.writeFieldBegin('carrier', TType.I32, 2)
|
||||
oprot.writeI32(self.carrier)
|
||||
oprot.writeFieldEnd()
|
||||
if self.sessionId is not None:
|
||||
oprot.writeFieldBegin('sessionId', TType.STRING, 3)
|
||||
oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId)
|
||||
oprot.writeFieldEnd()
|
||||
if self.verifier is not None:
|
||||
oprot.writeFieldBegin('verifier', TType.STRING, 4)
|
||||
oprot.writeString(self.verifier.encode('utf-8') if sys.version_info[0] == 2 else self.verifier)
|
||||
oprot.writeFieldEnd()
|
||||
if self.standardAge is not None:
|
||||
oprot.writeFieldBegin('standardAge', TType.I32, 5)
|
||||
oprot.writeI32(self.standardAge)
|
||||
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(checkUserAge_args)
|
||||
checkUserAge_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I32, 'carrier', None, None, ), # 2
|
||||
(3, TType.STRING, 'sessionId', 'UTF8', None, ), # 3
|
||||
(4, TType.STRING, 'verifier', 'UTF8', None, ), # 4
|
||||
(5, TType.I32, 'standardAge', None, None, ), # 5
|
||||
)
|
||||
|
||||
|
||||
class checkUserAge_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.e = TalkException()
|
||||
self.e.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('checkUserAge_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.I32, 0)
|
||||
oprot.writeI32(self.success)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(checkUserAge_result)
|
||||
checkUserAge_result.thrift_spec = (
|
||||
(0, TType.I32, 'success', None, None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class checkUserAgeWithDocomo_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- openIdRedirectUrl
|
||||
- standardAge
|
||||
- verifier
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, openIdRedirectUrl=None, standardAge=None, verifier=None,):
|
||||
self.openIdRedirectUrl = openIdRedirectUrl
|
||||
self.standardAge = standardAge
|
||||
self.verifier = verifier
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.STRING:
|
||||
self.openIdRedirectUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.I32:
|
||||
self.standardAge = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 4:
|
||||
if ftype == TType.STRING:
|
||||
self.verifier = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
iprot.readFieldEnd()
|
||||
iprot.readStructEnd()
|
||||
|
||||
def write(self, oprot):
|
||||
if oprot._fast_encode is not None and self.thrift_spec is not None:
|
||||
oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
|
||||
return
|
||||
oprot.writeStructBegin('checkUserAgeWithDocomo_args')
|
||||
if self.openIdRedirectUrl is not None:
|
||||
oprot.writeFieldBegin('openIdRedirectUrl', TType.STRING, 2)
|
||||
oprot.writeString(self.openIdRedirectUrl.encode('utf-8') if sys.version_info[0] == 2 else self.openIdRedirectUrl)
|
||||
oprot.writeFieldEnd()
|
||||
if self.standardAge is not None:
|
||||
oprot.writeFieldBegin('standardAge', TType.I32, 3)
|
||||
oprot.writeI32(self.standardAge)
|
||||
oprot.writeFieldEnd()
|
||||
if self.verifier is not None:
|
||||
oprot.writeFieldBegin('verifier', TType.STRING, 4)
|
||||
oprot.writeString(self.verifier.encode('utf-8') if sys.version_info[0] == 2 else self.verifier)
|
||||
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(checkUserAgeWithDocomo_args)
|
||||
checkUserAgeWithDocomo_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.STRING, 'openIdRedirectUrl', 'UTF8', None, ), # 2
|
||||
(3, TType.I32, 'standardAge', None, None, ), # 3
|
||||
(4, TType.STRING, 'verifier', 'UTF8', None, ), # 4
|
||||
)
|
||||
|
||||
|
||||
class checkUserAgeWithDocomo_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = AgeCheckDocomoResult()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('checkUserAgeWithDocomo_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(checkUserAgeWithDocomo_result)
|
||||
checkUserAgeWithDocomo_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [AgeCheckDocomoResult, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class retrieveOpenIdAuthUrlWithDocomo_args(object):
|
||||
|
||||
|
||||
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
|
||||
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('retrieveOpenIdAuthUrlWithDocomo_args')
|
||||
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(retrieveOpenIdAuthUrlWithDocomo_args)
|
||||
retrieveOpenIdAuthUrlWithDocomo_args.thrift_spec = (
|
||||
)
|
||||
|
||||
|
||||
class retrieveOpenIdAuthUrlWithDocomo_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRING:
|
||||
self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('retrieveOpenIdAuthUrlWithDocomo_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRING, 0)
|
||||
oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(retrieveOpenIdAuthUrlWithDocomo_result)
|
||||
retrieveOpenIdAuthUrlWithDocomo_result.thrift_spec = (
|
||||
(0, TType.STRING, 'success', 'UTF8', None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class retrieveRequestToken_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- carrier
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, carrier=None,):
|
||||
self.carrier = carrier
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I32:
|
||||
self.carrier = iprot.readI32()
|
||||
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('retrieveRequestToken_args')
|
||||
if self.carrier is not None:
|
||||
oprot.writeFieldBegin('carrier', TType.I32, 2)
|
||||
oprot.writeI32(self.carrier)
|
||||
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(retrieveRequestToken_args)
|
||||
retrieveRequestToken_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I32, 'carrier', None, None, ), # 2
|
||||
)
|
||||
|
||||
|
||||
class retrieveRequestToken_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = AgeCheckRequestResult()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('retrieveRequestToken_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(retrieveRequestToken_result)
|
||||
retrieveRequestToken_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [AgeCheckRequestResult, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
fix_spec(all_structs)
|
||||
del all_structs
|
||||
|
|
@ -1,502 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import BuddyManagementService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' void addBuddyMember(string requestId, string userMid)')
|
||||
print(' void addBuddyMembers(string requestId, userMids)')
|
||||
print(' void blockBuddyMember(string requestId, string mid)')
|
||||
print(' commitSendMessagesToAll( requestIdList)')
|
||||
print(' commitSendMessagesToMids( requestIdList, mids)')
|
||||
print(' bool containsBuddyMember(string requestId, string userMid)')
|
||||
print(' string downloadMessageContent(string requestId, string messageId)')
|
||||
print(' string downloadMessageContentPreview(string requestId, string messageId)')
|
||||
print(' string downloadProfileImage(string requestId)')
|
||||
print(' string downloadProfileImagePreview(string requestId)')
|
||||
print(' i64 getActiveMemberCountByBuddyMid(string buddyMid)')
|
||||
print(' getActiveMemberMidsByBuddyMid(string buddyMid)')
|
||||
print(' getAllBuddyMembers()')
|
||||
print(' getBlockedBuddyMembers()')
|
||||
print(' i64 getBlockerCountByBuddyMid(string buddyMid)')
|
||||
print(' BuddyDetail getBuddyDetailByMid(string buddyMid)')
|
||||
print(' BuddyProfile getBuddyProfile()')
|
||||
print(' Ticket getContactTicket()')
|
||||
print(' i64 getMemberCountByBuddyMid(string buddyMid)')
|
||||
print(' SendBuddyMessageResult getSendBuddyMessageResult(string sendBuddyMessageRequestId)')
|
||||
print(' SetBuddyOnAirResult getSetBuddyOnAirResult(string setBuddyOnAirRequestId)')
|
||||
print(' UpdateBuddyProfileResult getUpdateBuddyProfileResult(string updateBuddyProfileRequestId)')
|
||||
print(' bool isBuddyOnAirByMid(string buddyMid)')
|
||||
print(' string linkAndSendBuddyContentMessageToAllAsync(string requestId, Message msg, string sourceContentId)')
|
||||
print(' SendBuddyMessageResult linkAndSendBuddyContentMessageToMids(string requestId, Message msg, string sourceContentId, mids)')
|
||||
print(' void notifyBuddyBlocked(string buddyMid, string blockerMid)')
|
||||
print(' void notifyBuddyUnblocked(string buddyMid, string blockerMid)')
|
||||
print(' string registerBuddy(string buddyId, string searchId, string displayName, string statusMeessage, string picture, settings)')
|
||||
print(' string registerBuddyAdmin(string buddyId, string searchId, string displayName, string statusMessage, string picture)')
|
||||
print(' string reissueContactTicket(i64 expirationTime, i32 maxUseCount)')
|
||||
print(' void removeBuddyMember(string requestId, string userMid)')
|
||||
print(' void removeBuddyMembers(string requestId, userMids)')
|
||||
print(' SendBuddyMessageResult sendBuddyContentMessageToAll(string requestId, Message msg, string content)')
|
||||
print(' string sendBuddyContentMessageToAllAsync(string requestId, Message msg, string content)')
|
||||
print(' SendBuddyMessageResult sendBuddyContentMessageToMids(string requestId, Message msg, string content, mids)')
|
||||
print(' string sendBuddyContentMessageToMidsAsync(string requestId, Message msg, string content, mids)')
|
||||
print(' SendBuddyMessageResult sendBuddyMessageToAll(string requestId, Message msg)')
|
||||
print(' string sendBuddyMessageToAllAsync(string requestId, Message msg)')
|
||||
print(' SendBuddyMessageResult sendBuddyMessageToMids(string requestId, Message msg, mids)')
|
||||
print(' string sendBuddyMessageToMidsAsync(string requestId, Message msg, mids)')
|
||||
print(' void sendIndividualEventToAllAsync(string requestId, string buddyMid, NotificationStatus notificationStatus)')
|
||||
print(' SetBuddyOnAirResult setBuddyOnAir(string requestId, bool onAir)')
|
||||
print(' string setBuddyOnAirAsync(string requestId, bool onAir)')
|
||||
print(' SendBuddyMessageResult storeMessage(string requestId, BuddyMessageRequest messageRequest)')
|
||||
print(' void unblockBuddyMember(string requestId, string mid)')
|
||||
print(' void unregisterBuddy(string requestId)')
|
||||
print(' void unregisterBuddyAdmin(string requestId)')
|
||||
print(' void updateBuddyAdminProfileAttribute(string requestId, attributes)')
|
||||
print(' void updateBuddyAdminProfileImage(string requestId, string picture)')
|
||||
print(' UpdateBuddyProfileResult updateBuddyProfileAttributes(string requestId, attributes)')
|
||||
print(' string updateBuddyProfileAttributesAsync(string requestId, attributes)')
|
||||
print(' UpdateBuddyProfileResult updateBuddyProfileImage(string requestId, string image)')
|
||||
print(' string updateBuddyProfileImageAsync(string requestId, string image)')
|
||||
print(' void updateBuddySearchId(string requestId, string searchId)')
|
||||
print(' void updateBuddySettings( settings)')
|
||||
print(' string uploadBuddyContent(ContentType contentType, string content)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = BuddyManagementService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'addBuddyMember':
|
||||
if len(args) != 2:
|
||||
print('addBuddyMember requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.addBuddyMember(args[0], args[1],))
|
||||
|
||||
elif cmd == 'addBuddyMembers':
|
||||
if len(args) != 2:
|
||||
print('addBuddyMembers requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.addBuddyMembers(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'blockBuddyMember':
|
||||
if len(args) != 2:
|
||||
print('blockBuddyMember requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.blockBuddyMember(args[0], args[1],))
|
||||
|
||||
elif cmd == 'commitSendMessagesToAll':
|
||||
if len(args) != 1:
|
||||
print('commitSendMessagesToAll requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.commitSendMessagesToAll(eval(args[0]),))
|
||||
|
||||
elif cmd == 'commitSendMessagesToMids':
|
||||
if len(args) != 2:
|
||||
print('commitSendMessagesToMids requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.commitSendMessagesToMids(eval(args[0]), eval(args[1]),))
|
||||
|
||||
elif cmd == 'containsBuddyMember':
|
||||
if len(args) != 2:
|
||||
print('containsBuddyMember requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.containsBuddyMember(args[0], args[1],))
|
||||
|
||||
elif cmd == 'downloadMessageContent':
|
||||
if len(args) != 2:
|
||||
print('downloadMessageContent requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.downloadMessageContent(args[0], args[1],))
|
||||
|
||||
elif cmd == 'downloadMessageContentPreview':
|
||||
if len(args) != 2:
|
||||
print('downloadMessageContentPreview requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.downloadMessageContentPreview(args[0], args[1],))
|
||||
|
||||
elif cmd == 'downloadProfileImage':
|
||||
if len(args) != 1:
|
||||
print('downloadProfileImage requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.downloadProfileImage(args[0],))
|
||||
|
||||
elif cmd == 'downloadProfileImagePreview':
|
||||
if len(args) != 1:
|
||||
print('downloadProfileImagePreview requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.downloadProfileImagePreview(args[0],))
|
||||
|
||||
elif cmd == 'getActiveMemberCountByBuddyMid':
|
||||
if len(args) != 1:
|
||||
print('getActiveMemberCountByBuddyMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getActiveMemberCountByBuddyMid(args[0],))
|
||||
|
||||
elif cmd == 'getActiveMemberMidsByBuddyMid':
|
||||
if len(args) != 1:
|
||||
print('getActiveMemberMidsByBuddyMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getActiveMemberMidsByBuddyMid(args[0],))
|
||||
|
||||
elif cmd == 'getAllBuddyMembers':
|
||||
if len(args) != 0:
|
||||
print('getAllBuddyMembers requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getAllBuddyMembers())
|
||||
|
||||
elif cmd == 'getBlockedBuddyMembers':
|
||||
if len(args) != 0:
|
||||
print('getBlockedBuddyMembers requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBlockedBuddyMembers())
|
||||
|
||||
elif cmd == 'getBlockerCountByBuddyMid':
|
||||
if len(args) != 1:
|
||||
print('getBlockerCountByBuddyMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBlockerCountByBuddyMid(args[0],))
|
||||
|
||||
elif cmd == 'getBuddyDetailByMid':
|
||||
if len(args) != 1:
|
||||
print('getBuddyDetailByMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBuddyDetailByMid(args[0],))
|
||||
|
||||
elif cmd == 'getBuddyProfile':
|
||||
if len(args) != 0:
|
||||
print('getBuddyProfile requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBuddyProfile())
|
||||
|
||||
elif cmd == 'getContactTicket':
|
||||
if len(args) != 0:
|
||||
print('getContactTicket requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getContactTicket())
|
||||
|
||||
elif cmd == 'getMemberCountByBuddyMid':
|
||||
if len(args) != 1:
|
||||
print('getMemberCountByBuddyMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getMemberCountByBuddyMid(args[0],))
|
||||
|
||||
elif cmd == 'getSendBuddyMessageResult':
|
||||
if len(args) != 1:
|
||||
print('getSendBuddyMessageResult requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getSendBuddyMessageResult(args[0],))
|
||||
|
||||
elif cmd == 'getSetBuddyOnAirResult':
|
||||
if len(args) != 1:
|
||||
print('getSetBuddyOnAirResult requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getSetBuddyOnAirResult(args[0],))
|
||||
|
||||
elif cmd == 'getUpdateBuddyProfileResult':
|
||||
if len(args) != 1:
|
||||
print('getUpdateBuddyProfileResult requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUpdateBuddyProfileResult(args[0],))
|
||||
|
||||
elif cmd == 'isBuddyOnAirByMid':
|
||||
if len(args) != 1:
|
||||
print('isBuddyOnAirByMid requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.isBuddyOnAirByMid(args[0],))
|
||||
|
||||
elif cmd == 'linkAndSendBuddyContentMessageToAllAsync':
|
||||
if len(args) != 3:
|
||||
print('linkAndSendBuddyContentMessageToAllAsync requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.linkAndSendBuddyContentMessageToAllAsync(args[0], eval(args[1]), args[2],))
|
||||
|
||||
elif cmd == 'linkAndSendBuddyContentMessageToMids':
|
||||
if len(args) != 4:
|
||||
print('linkAndSendBuddyContentMessageToMids requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.linkAndSendBuddyContentMessageToMids(args[0], eval(args[1]), args[2], eval(args[3]),))
|
||||
|
||||
elif cmd == 'notifyBuddyBlocked':
|
||||
if len(args) != 2:
|
||||
print('notifyBuddyBlocked requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.notifyBuddyBlocked(args[0], args[1],))
|
||||
|
||||
elif cmd == 'notifyBuddyUnblocked':
|
||||
if len(args) != 2:
|
||||
print('notifyBuddyUnblocked requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.notifyBuddyUnblocked(args[0], args[1],))
|
||||
|
||||
elif cmd == 'registerBuddy':
|
||||
if len(args) != 6:
|
||||
print('registerBuddy requires 6 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.registerBuddy(args[0], args[1], args[2], args[3], args[4], eval(args[5]),))
|
||||
|
||||
elif cmd == 'registerBuddyAdmin':
|
||||
if len(args) != 5:
|
||||
print('registerBuddyAdmin requires 5 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.registerBuddyAdmin(args[0], args[1], args[2], args[3], args[4],))
|
||||
|
||||
elif cmd == 'reissueContactTicket':
|
||||
if len(args) != 2:
|
||||
print('reissueContactTicket requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.reissueContactTicket(eval(args[0]), eval(args[1]),))
|
||||
|
||||
elif cmd == 'removeBuddyMember':
|
||||
if len(args) != 2:
|
||||
print('removeBuddyMember requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.removeBuddyMember(args[0], args[1],))
|
||||
|
||||
elif cmd == 'removeBuddyMembers':
|
||||
if len(args) != 2:
|
||||
print('removeBuddyMembers requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.removeBuddyMembers(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'sendBuddyContentMessageToAll':
|
||||
if len(args) != 3:
|
||||
print('sendBuddyContentMessageToAll requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyContentMessageToAll(args[0], eval(args[1]), args[2],))
|
||||
|
||||
elif cmd == 'sendBuddyContentMessageToAllAsync':
|
||||
if len(args) != 3:
|
||||
print('sendBuddyContentMessageToAllAsync requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyContentMessageToAllAsync(args[0], eval(args[1]), args[2],))
|
||||
|
||||
elif cmd == 'sendBuddyContentMessageToMids':
|
||||
if len(args) != 4:
|
||||
print('sendBuddyContentMessageToMids requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyContentMessageToMids(args[0], eval(args[1]), args[2], eval(args[3]),))
|
||||
|
||||
elif cmd == 'sendBuddyContentMessageToMidsAsync':
|
||||
if len(args) != 4:
|
||||
print('sendBuddyContentMessageToMidsAsync requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyContentMessageToMidsAsync(args[0], eval(args[1]), args[2], eval(args[3]),))
|
||||
|
||||
elif cmd == 'sendBuddyMessageToAll':
|
||||
if len(args) != 2:
|
||||
print('sendBuddyMessageToAll requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyMessageToAll(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'sendBuddyMessageToAllAsync':
|
||||
if len(args) != 2:
|
||||
print('sendBuddyMessageToAllAsync requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyMessageToAllAsync(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'sendBuddyMessageToMids':
|
||||
if len(args) != 3:
|
||||
print('sendBuddyMessageToMids requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyMessageToMids(args[0], eval(args[1]), eval(args[2]),))
|
||||
|
||||
elif cmd == 'sendBuddyMessageToMidsAsync':
|
||||
if len(args) != 3:
|
||||
print('sendBuddyMessageToMidsAsync requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendBuddyMessageToMidsAsync(args[0], eval(args[1]), eval(args[2]),))
|
||||
|
||||
elif cmd == 'sendIndividualEventToAllAsync':
|
||||
if len(args) != 3:
|
||||
print('sendIndividualEventToAllAsync requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendIndividualEventToAllAsync(args[0], args[1], eval(args[2]),))
|
||||
|
||||
elif cmd == 'setBuddyOnAir':
|
||||
if len(args) != 2:
|
||||
print('setBuddyOnAir requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.setBuddyOnAir(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'setBuddyOnAirAsync':
|
||||
if len(args) != 2:
|
||||
print('setBuddyOnAirAsync requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.setBuddyOnAirAsync(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'storeMessage':
|
||||
if len(args) != 2:
|
||||
print('storeMessage requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.storeMessage(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'unblockBuddyMember':
|
||||
if len(args) != 2:
|
||||
print('unblockBuddyMember requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.unblockBuddyMember(args[0], args[1],))
|
||||
|
||||
elif cmd == 'unregisterBuddy':
|
||||
if len(args) != 1:
|
||||
print('unregisterBuddy requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.unregisterBuddy(args[0],))
|
||||
|
||||
elif cmd == 'unregisterBuddyAdmin':
|
||||
if len(args) != 1:
|
||||
print('unregisterBuddyAdmin requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.unregisterBuddyAdmin(args[0],))
|
||||
|
||||
elif cmd == 'updateBuddyAdminProfileAttribute':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyAdminProfileAttribute requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyAdminProfileAttribute(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'updateBuddyAdminProfileImage':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyAdminProfileImage requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyAdminProfileImage(args[0], args[1],))
|
||||
|
||||
elif cmd == 'updateBuddyProfileAttributes':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyProfileAttributes requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyProfileAttributes(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'updateBuddyProfileAttributesAsync':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyProfileAttributesAsync requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyProfileAttributesAsync(args[0], eval(args[1]),))
|
||||
|
||||
elif cmd == 'updateBuddyProfileImage':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyProfileImage requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyProfileImage(args[0], args[1],))
|
||||
|
||||
elif cmd == 'updateBuddyProfileImageAsync':
|
||||
if len(args) != 2:
|
||||
print('updateBuddyProfileImageAsync requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddyProfileImageAsync(args[0], args[1],))
|
||||
|
||||
elif cmd == 'updateBuddySearchId':
|
||||
if len(args) != 2:
|
||||
print('updateBuddySearchId requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddySearchId(args[0], args[1],))
|
||||
|
||||
elif cmd == 'updateBuddySettings':
|
||||
if len(args) != 1:
|
||||
print('updateBuddySettings requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateBuddySettings(eval(args[0]),))
|
||||
|
||||
elif cmd == 'uploadBuddyContent':
|
||||
if len(args) != 2:
|
||||
print('uploadBuddyContent requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.uploadBuddyContent(eval(args[0]), args[1],))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,173 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import BuddyService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' findBuddyContactsByQuery(string language, string country, string query, i32 fromIndex, i32 count, BuddySearchRequestSource requestSource)')
|
||||
print(' getBuddyContacts(string language, string country, string classification, i32 fromIndex, i32 count)')
|
||||
print(' BuddyDetail getBuddyDetail(string buddyMid)')
|
||||
print(' BuddyOnAir getBuddyOnAir(string buddyMid)')
|
||||
print(' getCountriesHavingBuddy()')
|
||||
print(' getNewlyReleasedBuddyIds(string country)')
|
||||
print(' BuddyBanner getPopularBuddyBanner(string language, string country, ApplicationType applicationType, string resourceSpecification)')
|
||||
print(' getPopularBuddyLists(string language, string country)')
|
||||
print(' getPromotedBuddyContacts(string language, string country)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = BuddyService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'findBuddyContactsByQuery':
|
||||
if len(args) != 6:
|
||||
print('findBuddyContactsByQuery requires 6 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.findBuddyContactsByQuery(args[0], args[1], args[2], eval(args[3]), eval(args[4]), eval(args[5]),))
|
||||
|
||||
elif cmd == 'getBuddyContacts':
|
||||
if len(args) != 5:
|
||||
print('getBuddyContacts requires 5 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBuddyContacts(args[0], args[1], args[2], eval(args[3]), eval(args[4]),))
|
||||
|
||||
elif cmd == 'getBuddyDetail':
|
||||
if len(args) != 1:
|
||||
print('getBuddyDetail requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBuddyDetail(args[0],))
|
||||
|
||||
elif cmd == 'getBuddyOnAir':
|
||||
if len(args) != 1:
|
||||
print('getBuddyOnAir requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getBuddyOnAir(args[0],))
|
||||
|
||||
elif cmd == 'getCountriesHavingBuddy':
|
||||
if len(args) != 0:
|
||||
print('getCountriesHavingBuddy requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCountriesHavingBuddy())
|
||||
|
||||
elif cmd == 'getNewlyReleasedBuddyIds':
|
||||
if len(args) != 1:
|
||||
print('getNewlyReleasedBuddyIds requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getNewlyReleasedBuddyIds(args[0],))
|
||||
|
||||
elif cmd == 'getPopularBuddyBanner':
|
||||
if len(args) != 4:
|
||||
print('getPopularBuddyBanner requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPopularBuddyBanner(args[0], args[1], eval(args[2]), args[3],))
|
||||
|
||||
elif cmd == 'getPopularBuddyLists':
|
||||
if len(args) != 2:
|
||||
print('getPopularBuddyLists requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPopularBuddyLists(args[0], args[1],))
|
||||
|
||||
elif cmd == 'getPromotedBuddyContacts':
|
||||
if len(args) != 2:
|
||||
print('getPromotedBuddyContacts requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPromotedBuddyContacts(args[0], args[1],))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,327 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import ChannelApplicationProvidedService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' i64 activeBuddySubscriberCount()')
|
||||
print(' void addOperationForChannel(OpType opType, string param1, string param2, string param3)')
|
||||
print(' i64 displayBuddySubscriberCount()')
|
||||
print(' Contact findContactByUseridWithoutAbuseBlockForChannel(string userid)')
|
||||
print(' getAllContactIdsForChannel()')
|
||||
print(' getCompactContacts(i64 lastModifiedTimestamp)')
|
||||
print(' getContactsForChannel( ids)')
|
||||
print(' string getDisplayName(string mid)')
|
||||
print(' getFavoriteMidsForChannel()')
|
||||
print(' getFriendMids()')
|
||||
print(' getGroupMemberMids(string groupId)')
|
||||
print(' getGroupsForChannel( groupIds)')
|
||||
print(' IdentityCredential getIdentityCredential()')
|
||||
print(' getJoinedGroupIdsForChannel()')
|
||||
print(' MetaProfile getMetaProfile()')
|
||||
print(' string getMid()')
|
||||
print(' SimpleChannelClient getPrimaryClientForChannel()')
|
||||
print(' Profile getProfileForChannel()')
|
||||
print(' getSimpleChannelContacts( ids)')
|
||||
print(' string getUserCountryForBilling(string country, string remoteIp)')
|
||||
print(' i64 getUserCreateTime()')
|
||||
print(' getUserIdentities()')
|
||||
print(' string getUserLanguage()')
|
||||
print(' getUserMidsWhoAddedMe()')
|
||||
print(' bool isGroupMember(string groupId)')
|
||||
print(' bool isInContact(string mid)')
|
||||
print(' string registerChannelCP(string cpId, string registerPassword)')
|
||||
print(' void removeNotificationStatus(NotificationStatus notificationStatus)')
|
||||
print(' Message sendMessageForChannel(Message message)')
|
||||
print(' void sendPinCodeOperation(string verifier)')
|
||||
print(' void updateProfileAttributeForChannel(ProfileAttribute profileAttribute, string value)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = ChannelApplicationProvidedService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'activeBuddySubscriberCount':
|
||||
if len(args) != 0:
|
||||
print('activeBuddySubscriberCount requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.activeBuddySubscriberCount())
|
||||
|
||||
elif cmd == 'addOperationForChannel':
|
||||
if len(args) != 4:
|
||||
print('addOperationForChannel requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.addOperationForChannel(eval(args[0]), args[1], args[2], args[3],))
|
||||
|
||||
elif cmd == 'displayBuddySubscriberCount':
|
||||
if len(args) != 0:
|
||||
print('displayBuddySubscriberCount requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.displayBuddySubscriberCount())
|
||||
|
||||
elif cmd == 'findContactByUseridWithoutAbuseBlockForChannel':
|
||||
if len(args) != 1:
|
||||
print('findContactByUseridWithoutAbuseBlockForChannel requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.findContactByUseridWithoutAbuseBlockForChannel(args[0],))
|
||||
|
||||
elif cmd == 'getAllContactIdsForChannel':
|
||||
if len(args) != 0:
|
||||
print('getAllContactIdsForChannel requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getAllContactIdsForChannel())
|
||||
|
||||
elif cmd == 'getCompactContacts':
|
||||
if len(args) != 1:
|
||||
print('getCompactContacts requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCompactContacts(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getContactsForChannel':
|
||||
if len(args) != 1:
|
||||
print('getContactsForChannel requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getContactsForChannel(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getDisplayName':
|
||||
if len(args) != 1:
|
||||
print('getDisplayName requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getDisplayName(args[0],))
|
||||
|
||||
elif cmd == 'getFavoriteMidsForChannel':
|
||||
if len(args) != 0:
|
||||
print('getFavoriteMidsForChannel requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getFavoriteMidsForChannel())
|
||||
|
||||
elif cmd == 'getFriendMids':
|
||||
if len(args) != 0:
|
||||
print('getFriendMids requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getFriendMids())
|
||||
|
||||
elif cmd == 'getGroupMemberMids':
|
||||
if len(args) != 1:
|
||||
print('getGroupMemberMids requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getGroupMemberMids(args[0],))
|
||||
|
||||
elif cmd == 'getGroupsForChannel':
|
||||
if len(args) != 1:
|
||||
print('getGroupsForChannel requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getGroupsForChannel(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getIdentityCredential':
|
||||
if len(args) != 0:
|
||||
print('getIdentityCredential requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getIdentityCredential())
|
||||
|
||||
elif cmd == 'getJoinedGroupIdsForChannel':
|
||||
if len(args) != 0:
|
||||
print('getJoinedGroupIdsForChannel requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getJoinedGroupIdsForChannel())
|
||||
|
||||
elif cmd == 'getMetaProfile':
|
||||
if len(args) != 0:
|
||||
print('getMetaProfile requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getMetaProfile())
|
||||
|
||||
elif cmd == 'getMid':
|
||||
if len(args) != 0:
|
||||
print('getMid requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getMid())
|
||||
|
||||
elif cmd == 'getPrimaryClientForChannel':
|
||||
if len(args) != 0:
|
||||
print('getPrimaryClientForChannel requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPrimaryClientForChannel())
|
||||
|
||||
elif cmd == 'getProfileForChannel':
|
||||
if len(args) != 0:
|
||||
print('getProfileForChannel requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getProfileForChannel())
|
||||
|
||||
elif cmd == 'getSimpleChannelContacts':
|
||||
if len(args) != 1:
|
||||
print('getSimpleChannelContacts requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getSimpleChannelContacts(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getUserCountryForBilling':
|
||||
if len(args) != 2:
|
||||
print('getUserCountryForBilling requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUserCountryForBilling(args[0], args[1],))
|
||||
|
||||
elif cmd == 'getUserCreateTime':
|
||||
if len(args) != 0:
|
||||
print('getUserCreateTime requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUserCreateTime())
|
||||
|
||||
elif cmd == 'getUserIdentities':
|
||||
if len(args) != 0:
|
||||
print('getUserIdentities requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUserIdentities())
|
||||
|
||||
elif cmd == 'getUserLanguage':
|
||||
if len(args) != 0:
|
||||
print('getUserLanguage requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUserLanguage())
|
||||
|
||||
elif cmd == 'getUserMidsWhoAddedMe':
|
||||
if len(args) != 0:
|
||||
print('getUserMidsWhoAddedMe requires 0 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getUserMidsWhoAddedMe())
|
||||
|
||||
elif cmd == 'isGroupMember':
|
||||
if len(args) != 1:
|
||||
print('isGroupMember requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.isGroupMember(args[0],))
|
||||
|
||||
elif cmd == 'isInContact':
|
||||
if len(args) != 1:
|
||||
print('isInContact requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.isInContact(args[0],))
|
||||
|
||||
elif cmd == 'registerChannelCP':
|
||||
if len(args) != 2:
|
||||
print('registerChannelCP requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.registerChannelCP(args[0], args[1],))
|
||||
|
||||
elif cmd == 'removeNotificationStatus':
|
||||
if len(args) != 1:
|
||||
print('removeNotificationStatus requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.removeNotificationStatus(eval(args[0]),))
|
||||
|
||||
elif cmd == 'sendMessageForChannel':
|
||||
if len(args) != 1:
|
||||
print('sendMessageForChannel requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendMessageForChannel(eval(args[0]),))
|
||||
|
||||
elif cmd == 'sendPinCodeOperation':
|
||||
if len(args) != 1:
|
||||
print('sendPinCodeOperation requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.sendPinCodeOperation(args[0],))
|
||||
|
||||
elif cmd == 'updateProfileAttributeForChannel':
|
||||
if len(args) != 2:
|
||||
print('updateProfileAttributeForChannel requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateProfileAttributeForChannel(eval(args[0]), args[1],))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,236 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import ChannelService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' ChannelToken approveChannelAndIssueChannelToken(string channelId)')
|
||||
print(' string approveChannelAndIssueRequestToken(string channelId, string otpId)')
|
||||
print(' NotificationFetchResult fetchNotificationItems(i64 localRev)')
|
||||
print(' ApprovedChannelInfos getApprovedChannels(i64 lastSynced, string locale)')
|
||||
print(' ChannelInfo getChannelInfo(string channelId, string locale)')
|
||||
print(' ChannelNotificationSetting getChannelNotificationSetting(string channelId, string locale)')
|
||||
print(' getChannelNotificationSettings(string locale)')
|
||||
print(' ChannelInfos getChannels(i64 lastSynced, string locale)')
|
||||
print(' ChannelDomains getDomains(i64 lastSynced)')
|
||||
print(' FriendChannelMatricesResponse getFriendChannelMatrices( channelIds)')
|
||||
print(' i32 getNotificationBadgeCount(i64 localRev)')
|
||||
print(' ChannelToken issueChannelToken(string channelId)')
|
||||
print(' string issueRequestToken(string channelId, string otpId)')
|
||||
print(' RequestTokenResponse issueRequestTokenWithAuthScheme(string channelId, string otpId, authScheme, string returnUrl)')
|
||||
print(' string reserveCoinUse(CoinUseReservation request, string locale)')
|
||||
print(' void revokeChannel(string channelId)')
|
||||
print(' ChannelSyncDatas syncChannelData(i64 lastSynced, string locale)')
|
||||
print(' void updateChannelNotificationSetting( setting)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = ChannelService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'approveChannelAndIssueChannelToken':
|
||||
if len(args) != 1:
|
||||
print('approveChannelAndIssueChannelToken requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.approveChannelAndIssueChannelToken(args[0],))
|
||||
|
||||
elif cmd == 'approveChannelAndIssueRequestToken':
|
||||
if len(args) != 2:
|
||||
print('approveChannelAndIssueRequestToken requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.approveChannelAndIssueRequestToken(args[0], args[1],))
|
||||
|
||||
elif cmd == 'fetchNotificationItems':
|
||||
if len(args) != 1:
|
||||
print('fetchNotificationItems requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.fetchNotificationItems(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getApprovedChannels':
|
||||
if len(args) != 2:
|
||||
print('getApprovedChannels requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getApprovedChannels(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'getChannelInfo':
|
||||
if len(args) != 2:
|
||||
print('getChannelInfo requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getChannelInfo(args[0], args[1],))
|
||||
|
||||
elif cmd == 'getChannelNotificationSetting':
|
||||
if len(args) != 2:
|
||||
print('getChannelNotificationSetting requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getChannelNotificationSetting(args[0], args[1],))
|
||||
|
||||
elif cmd == 'getChannelNotificationSettings':
|
||||
if len(args) != 1:
|
||||
print('getChannelNotificationSettings requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getChannelNotificationSettings(args[0],))
|
||||
|
||||
elif cmd == 'getChannels':
|
||||
if len(args) != 2:
|
||||
print('getChannels requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getChannels(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'getDomains':
|
||||
if len(args) != 1:
|
||||
print('getDomains requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getDomains(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getFriendChannelMatrices':
|
||||
if len(args) != 1:
|
||||
print('getFriendChannelMatrices requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getFriendChannelMatrices(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getNotificationBadgeCount':
|
||||
if len(args) != 1:
|
||||
print('getNotificationBadgeCount requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getNotificationBadgeCount(eval(args[0]),))
|
||||
|
||||
elif cmd == 'issueChannelToken':
|
||||
if len(args) != 1:
|
||||
print('issueChannelToken requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.issueChannelToken(args[0],))
|
||||
|
||||
elif cmd == 'issueRequestToken':
|
||||
if len(args) != 2:
|
||||
print('issueRequestToken requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.issueRequestToken(args[0], args[1],))
|
||||
|
||||
elif cmd == 'issueRequestTokenWithAuthScheme':
|
||||
if len(args) != 4:
|
||||
print('issueRequestTokenWithAuthScheme requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.issueRequestTokenWithAuthScheme(args[0], args[1], eval(args[2]), args[3],))
|
||||
|
||||
elif cmd == 'reserveCoinUse':
|
||||
if len(args) != 2:
|
||||
print('reserveCoinUse requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.reserveCoinUse(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'revokeChannel':
|
||||
if len(args) != 1:
|
||||
print('revokeChannel requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.revokeChannel(args[0],))
|
||||
|
||||
elif cmd == 'syncChannelData':
|
||||
if len(args) != 2:
|
||||
print('syncChannelData requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.syncChannelData(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'updateChannelNotificationSetting':
|
||||
if len(args) != 1:
|
||||
print('updateChannelNotificationSetting requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.updateChannelNotificationSetting(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,163 +0,0 @@
|
|||
GNU Lesser General Public License
|
||||
=================================
|
||||
|
||||
_Version 3, 29 June 2007_
|
||||
_Copyright © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>_
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
### 0. Additional Definitions
|
||||
|
||||
As used herein, “this License” refers to version 3 of the GNU Lesser
|
||||
General Public License, and the “GNU GPL” refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
“The Library” refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An “Application” is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A “Combined Work” is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the “Linked
|
||||
Version”.
|
||||
|
||||
The “Minimal Corresponding Source” for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The “Corresponding Application Code” for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
### 1. Exception to Section 3 of the GNU GPL
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
### 2. Conveying Modified Versions
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
* **a)** under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
* **b)** under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
### 3. Object Code Incorporating Material from Library Header Files
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
* **a)** Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
* **b)** Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
### 4. Combined Works
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
* **a)** Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
* **b)** Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
* **c)** For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
* **d)** Do one of the following:
|
||||
- **0)** Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
- **1)** Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that **(a)** uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and **(b)** will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
* **e)** Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option **4d0**, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option **4d1**, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
### 5. Combined Libraries
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
* **a)** Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
* **b)** Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
### 6. Revised Versions of the GNU Lesser General Public License
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License “or any later version”
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
|
@ -1,131 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import MessageService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' MessageOperations fetchMessageOperations(i64 localRevision, i64 lastOpTimestamp, i32 count)')
|
||||
print(' LastReadMessageIds getLastReadMessageIds(string chatId)')
|
||||
print(' multiGetLastReadMessageIds( chatIds)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = MessageService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'fetchMessageOperations':
|
||||
if len(args) != 3:
|
||||
print('fetchMessageOperations requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.fetchMessageOperations(eval(args[0]), eval(args[1]), eval(args[2]),))
|
||||
|
||||
elif cmd == 'getLastReadMessageIds':
|
||||
if len(args) != 1:
|
||||
print('getLastReadMessageIds requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getLastReadMessageIds(args[0],))
|
||||
|
||||
elif cmd == 'multiGetLastReadMessageIds':
|
||||
if len(args) != 1:
|
||||
print('multiGetLastReadMessageIds requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.multiGetLastReadMessageIds(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
|
@ -1,727 +0,0 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.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 logging
|
||||
from .ttypes import *
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.transport import TTransport
|
||||
all_structs = []
|
||||
|
||||
|
||||
class Iface(object):
|
||||
def fetchMessageOperations(self, localRevision, lastOpTimestamp, count):
|
||||
"""
|
||||
Parameters:
|
||||
- localRevision
|
||||
- lastOpTimestamp
|
||||
- count
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def getLastReadMessageIds(self, chatId):
|
||||
"""
|
||||
Parameters:
|
||||
- chatId
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def multiGetLastReadMessageIds(self, chatIds):
|
||||
"""
|
||||
Parameters:
|
||||
- chatIds
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Client(Iface):
|
||||
def __init__(self, iprot, oprot=None):
|
||||
self._iprot = self._oprot = iprot
|
||||
if oprot is not None:
|
||||
self._oprot = oprot
|
||||
self._seqid = 0
|
||||
|
||||
def fetchMessageOperations(self, localRevision, lastOpTimestamp, count):
|
||||
"""
|
||||
Parameters:
|
||||
- localRevision
|
||||
- lastOpTimestamp
|
||||
- count
|
||||
|
||||
"""
|
||||
self.send_fetchMessageOperations(localRevision, lastOpTimestamp, count)
|
||||
return self.recv_fetchMessageOperations()
|
||||
|
||||
def send_fetchMessageOperations(self, localRevision, lastOpTimestamp, count):
|
||||
self._oprot.writeMessageBegin('fetchMessageOperations', TMessageType.CALL, self._seqid)
|
||||
args = fetchMessageOperations_args()
|
||||
args.localRevision = localRevision
|
||||
args.lastOpTimestamp = lastOpTimestamp
|
||||
args.count = count
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_fetchMessageOperations(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = fetchMessageOperations_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchMessageOperations failed: unknown result")
|
||||
|
||||
def getLastReadMessageIds(self, chatId):
|
||||
"""
|
||||
Parameters:
|
||||
- chatId
|
||||
|
||||
"""
|
||||
self.send_getLastReadMessageIds(chatId)
|
||||
return self.recv_getLastReadMessageIds()
|
||||
|
||||
def send_getLastReadMessageIds(self, chatId):
|
||||
self._oprot.writeMessageBegin('getLastReadMessageIds', TMessageType.CALL, self._seqid)
|
||||
args = getLastReadMessageIds_args()
|
||||
args.chatId = chatId
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_getLastReadMessageIds(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = getLastReadMessageIds_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "getLastReadMessageIds failed: unknown result")
|
||||
|
||||
def multiGetLastReadMessageIds(self, chatIds):
|
||||
"""
|
||||
Parameters:
|
||||
- chatIds
|
||||
|
||||
"""
|
||||
self.send_multiGetLastReadMessageIds(chatIds)
|
||||
return self.recv_multiGetLastReadMessageIds()
|
||||
|
||||
def send_multiGetLastReadMessageIds(self, chatIds):
|
||||
self._oprot.writeMessageBegin('multiGetLastReadMessageIds', TMessageType.CALL, self._seqid)
|
||||
args = multiGetLastReadMessageIds_args()
|
||||
args.chatIds = chatIds
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_multiGetLastReadMessageIds(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = multiGetLastReadMessageIds_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "multiGetLastReadMessageIds failed: unknown result")
|
||||
|
||||
|
||||
class Processor(Iface, TProcessor):
|
||||
def __init__(self, handler):
|
||||
self._handler = handler
|
||||
self._processMap = {}
|
||||
self._processMap["fetchMessageOperations"] = Processor.process_fetchMessageOperations
|
||||
self._processMap["getLastReadMessageIds"] = Processor.process_getLastReadMessageIds
|
||||
self._processMap["multiGetLastReadMessageIds"] = Processor.process_multiGetLastReadMessageIds
|
||||
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_fetchMessageOperations(self, seqid, iprot, oprot):
|
||||
args = fetchMessageOperations_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = fetchMessageOperations_result()
|
||||
try:
|
||||
result.success = self._handler.fetchMessageOperations(args.localRevision, args.lastOpTimestamp, args.count)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("fetchMessageOperations", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_getLastReadMessageIds(self, seqid, iprot, oprot):
|
||||
args = getLastReadMessageIds_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = getLastReadMessageIds_result()
|
||||
try:
|
||||
result.success = self._handler.getLastReadMessageIds(args.chatId)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("getLastReadMessageIds", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_multiGetLastReadMessageIds(self, seqid, iprot, oprot):
|
||||
args = multiGetLastReadMessageIds_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = multiGetLastReadMessageIds_result()
|
||||
try:
|
||||
result.success = self._handler.multiGetLastReadMessageIds(args.chatIds)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("multiGetLastReadMessageIds", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
# HELPER FUNCTIONS AND STRUCTURES
|
||||
|
||||
|
||||
class fetchMessageOperations_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- localRevision
|
||||
- lastOpTimestamp
|
||||
- count
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, localRevision=None, lastOpTimestamp=None, count=None,):
|
||||
self.localRevision = localRevision
|
||||
self.lastOpTimestamp = lastOpTimestamp
|
||||
self.count = count
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I64:
|
||||
self.localRevision = iprot.readI64()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.I64:
|
||||
self.lastOpTimestamp = iprot.readI64()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 4:
|
||||
if ftype == TType.I32:
|
||||
self.count = iprot.readI32()
|
||||
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('fetchMessageOperations_args')
|
||||
if self.localRevision is not None:
|
||||
oprot.writeFieldBegin('localRevision', TType.I64, 2)
|
||||
oprot.writeI64(self.localRevision)
|
||||
oprot.writeFieldEnd()
|
||||
if self.lastOpTimestamp is not None:
|
||||
oprot.writeFieldBegin('lastOpTimestamp', TType.I64, 3)
|
||||
oprot.writeI64(self.lastOpTimestamp)
|
||||
oprot.writeFieldEnd()
|
||||
if self.count is not None:
|
||||
oprot.writeFieldBegin('count', TType.I32, 4)
|
||||
oprot.writeI32(self.count)
|
||||
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(fetchMessageOperations_args)
|
||||
fetchMessageOperations_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I64, 'localRevision', None, None, ), # 2
|
||||
(3, TType.I64, 'lastOpTimestamp', None, None, ), # 3
|
||||
(4, TType.I32, 'count', None, None, ), # 4
|
||||
)
|
||||
|
||||
|
||||
class fetchMessageOperations_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = MessageOperations()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('fetchMessageOperations_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(fetchMessageOperations_result)
|
||||
fetchMessageOperations_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [MessageOperations, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class getLastReadMessageIds_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- chatId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, chatId=None,):
|
||||
self.chatId = chatId
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.STRING:
|
||||
self.chatId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
iprot.readFieldEnd()
|
||||
iprot.readStructEnd()
|
||||
|
||||
def write(self, oprot):
|
||||
if oprot._fast_encode is not None and self.thrift_spec is not None:
|
||||
oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
|
||||
return
|
||||
oprot.writeStructBegin('getLastReadMessageIds_args')
|
||||
if self.chatId is not None:
|
||||
oprot.writeFieldBegin('chatId', TType.STRING, 2)
|
||||
oprot.writeString(self.chatId.encode('utf-8') if sys.version_info[0] == 2 else self.chatId)
|
||||
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(getLastReadMessageIds_args)
|
||||
getLastReadMessageIds_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.STRING, 'chatId', 'UTF8', None, ), # 2
|
||||
)
|
||||
|
||||
|
||||
class getLastReadMessageIds_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = LastReadMessageIds()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('getLastReadMessageIds_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(getLastReadMessageIds_result)
|
||||
getLastReadMessageIds_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [LastReadMessageIds, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class multiGetLastReadMessageIds_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- chatIds
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, chatIds=None,):
|
||||
self.chatIds = chatIds
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.LIST:
|
||||
self.chatIds = []
|
||||
(_etype666, _size663) = iprot.readListBegin()
|
||||
for _i667 in range(_size663):
|
||||
_elem668 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
self.chatIds.append(_elem668)
|
||||
iprot.readListEnd()
|
||||
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('multiGetLastReadMessageIds_args')
|
||||
if self.chatIds is not None:
|
||||
oprot.writeFieldBegin('chatIds', TType.LIST, 2)
|
||||
oprot.writeListBegin(TType.STRING, len(self.chatIds))
|
||||
for iter669 in self.chatIds:
|
||||
oprot.writeString(iter669.encode('utf-8') if sys.version_info[0] == 2 else iter669)
|
||||
oprot.writeListEnd()
|
||||
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(multiGetLastReadMessageIds_args)
|
||||
multiGetLastReadMessageIds_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.LIST, 'chatIds', (TType.STRING, 'UTF8', False), None, ), # 2
|
||||
)
|
||||
|
||||
|
||||
class multiGetLastReadMessageIds_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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 = []
|
||||
(_etype673, _size670) = iprot.readListBegin()
|
||||
for _i674 in range(_size670):
|
||||
_elem675 = LastReadMessageIds()
|
||||
_elem675.read(iprot)
|
||||
self.success.append(_elem675)
|
||||
iprot.readListEnd()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('multiGetLastReadMessageIds_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.LIST, 0)
|
||||
oprot.writeListBegin(TType.STRUCT, len(self.success))
|
||||
for iter676 in self.success:
|
||||
iter676.write(oprot)
|
||||
oprot.writeListEnd()
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(multiGetLastReadMessageIds_result)
|
||||
multiGetLastReadMessageIds_result.thrift_spec = (
|
||||
(0, TType.LIST, 'success', (TType.STRUCT, [LastReadMessageIds, None], False), None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
fix_spec(all_structs)
|
||||
del all_structs
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
# OpenLineSelfBot - Cores
|
||||
|
||||
> version 2.0
|
||||
|
||||
The core of OLSB project.
|
||||
|
||||
It is used to connect services of LINE.
|
||||
|
||||
## License
|
||||
|
||||
The software licensed under [GNU Lesser General Public License 3.0](LICENSE.md)
|
||||
|
||||
## Requirement
|
||||
|
||||
### Library
|
||||
|
||||
libs_of_thrift >= 0.11.0
|
||||
|
||||
### Compile (If you need)
|
||||
|
||||
thrift >= 0.13.0
|
||||
|
||||
## Usage
|
||||
|
||||
Clone the repository and get the library of the programming language you want.
|
||||
|
||||
> Start to Create your Applications. >o<
|
||||
|
||||
or Compile the ["line.thrift"](https://github.com/star-inc/olsb_cores/blob/master/origin/line.thrift) for yourself...
|
||||
|
||||
*(c) 2019 Star Inc.*
|
|
@ -1,285 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import ShopService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' void buyCoinProduct(PaymentReservation paymentReservation)')
|
||||
print(' void buyFreeProduct(string receiverMid, string productId, i32 messageTemplate, string language, string country, i64 packageId)')
|
||||
print(' void buyMustbuyProduct(string receiverMid, string productId, i32 messageTemplate, string language, string country, i64 packageId, string serialNumber)')
|
||||
print(' void checkCanReceivePresent(string recipientMid, i64 packageId, string language, string country)')
|
||||
print(' ProductList getActivePurchases(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductSimpleList getActivePurchaseVersions(i64 start, i32 size, string language, string country)')
|
||||
print(' getCoinProducts(PaymentType appStoreCode, string country, string language)')
|
||||
print(' getCoinProductsByPgCode(PaymentType appStoreCode, PaymentPgType pgCode, string country, string language)')
|
||||
print(' CoinHistoryResult getCoinPurchaseHistory(CoinHistoryCondition request)')
|
||||
print(' CoinHistoryResult getCoinUseAndRefundHistory(CoinHistoryCondition request)')
|
||||
print(' ProductList getDownloads(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductList getEventPackages(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductList getNewlyReleasedPackages(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductList getPopularPackages(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductList getPresentsReceived(i64 start, i32 size, string language, string country)')
|
||||
print(' ProductList getPresentsSent(i64 start, i32 size, string language, string country)')
|
||||
print(' Product getProduct(i64 packageID, string language, string country)')
|
||||
print(' ProductList getProductList( productIdList, string language, string country)')
|
||||
print(' ProductList getProductListWithCarrier( productIdList, string language, string country, string carrierCode)')
|
||||
print(' Product getProductWithCarrier(i64 packageID, string language, string country, string carrierCode)')
|
||||
print(' ProductList getPurchaseHistory(i64 start, i32 size, string language, string country)')
|
||||
print(' Coin getTotalBalance(PaymentType appStoreCode)')
|
||||
print(' i64 notifyDownloaded(i64 packageId, string language)')
|
||||
print(' PaymentReservationResult reserveCoinPurchase(CoinPurchaseReservation request)')
|
||||
print(' PaymentReservationResult reservePayment(PaymentReservation paymentReservation)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = ShopService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'buyCoinProduct':
|
||||
if len(args) != 1:
|
||||
print('buyCoinProduct requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.buyCoinProduct(eval(args[0]),))
|
||||
|
||||
elif cmd == 'buyFreeProduct':
|
||||
if len(args) != 6:
|
||||
print('buyFreeProduct requires 6 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.buyFreeProduct(args[0], args[1], eval(args[2]), args[3], args[4], eval(args[5]),))
|
||||
|
||||
elif cmd == 'buyMustbuyProduct':
|
||||
if len(args) != 7:
|
||||
print('buyMustbuyProduct requires 7 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.buyMustbuyProduct(args[0], args[1], eval(args[2]), args[3], args[4], eval(args[5]), args[6],))
|
||||
|
||||
elif cmd == 'checkCanReceivePresent':
|
||||
if len(args) != 4:
|
||||
print('checkCanReceivePresent requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.checkCanReceivePresent(args[0], eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getActivePurchases':
|
||||
if len(args) != 4:
|
||||
print('getActivePurchases requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getActivePurchases(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getActivePurchaseVersions':
|
||||
if len(args) != 4:
|
||||
print('getActivePurchaseVersions requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getActivePurchaseVersions(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getCoinProducts':
|
||||
if len(args) != 3:
|
||||
print('getCoinProducts requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCoinProducts(eval(args[0]), args[1], args[2],))
|
||||
|
||||
elif cmd == 'getCoinProductsByPgCode':
|
||||
if len(args) != 4:
|
||||
print('getCoinProductsByPgCode requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCoinProductsByPgCode(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getCoinPurchaseHistory':
|
||||
if len(args) != 1:
|
||||
print('getCoinPurchaseHistory requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCoinPurchaseHistory(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getCoinUseAndRefundHistory':
|
||||
if len(args) != 1:
|
||||
print('getCoinUseAndRefundHistory requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getCoinUseAndRefundHistory(eval(args[0]),))
|
||||
|
||||
elif cmd == 'getDownloads':
|
||||
if len(args) != 4:
|
||||
print('getDownloads requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getDownloads(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getEventPackages':
|
||||
if len(args) != 4:
|
||||
print('getEventPackages requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getEventPackages(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getNewlyReleasedPackages':
|
||||
if len(args) != 4:
|
||||
print('getNewlyReleasedPackages requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getNewlyReleasedPackages(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getPopularPackages':
|
||||
if len(args) != 4:
|
||||
print('getPopularPackages requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPopularPackages(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getPresentsReceived':
|
||||
if len(args) != 4:
|
||||
print('getPresentsReceived requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPresentsReceived(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getPresentsSent':
|
||||
if len(args) != 4:
|
||||
print('getPresentsSent requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPresentsSent(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getProduct':
|
||||
if len(args) != 3:
|
||||
print('getProduct requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getProduct(eval(args[0]), args[1], args[2],))
|
||||
|
||||
elif cmd == 'getProductList':
|
||||
if len(args) != 3:
|
||||
print('getProductList requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getProductList(eval(args[0]), args[1], args[2],))
|
||||
|
||||
elif cmd == 'getProductListWithCarrier':
|
||||
if len(args) != 4:
|
||||
print('getProductListWithCarrier requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getProductListWithCarrier(eval(args[0]), args[1], args[2], args[3],))
|
||||
|
||||
elif cmd == 'getProductWithCarrier':
|
||||
if len(args) != 4:
|
||||
print('getProductWithCarrier requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getProductWithCarrier(eval(args[0]), args[1], args[2], args[3],))
|
||||
|
||||
elif cmd == 'getPurchaseHistory':
|
||||
if len(args) != 4:
|
||||
print('getPurchaseHistory requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getPurchaseHistory(eval(args[0]), eval(args[1]), args[2], args[3],))
|
||||
|
||||
elif cmd == 'getTotalBalance':
|
||||
if len(args) != 1:
|
||||
print('getTotalBalance requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getTotalBalance(eval(args[0]),))
|
||||
|
||||
elif cmd == 'notifyDownloaded':
|
||||
if len(args) != 2:
|
||||
print('notifyDownloaded requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.notifyDownloaded(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'reserveCoinPurchase':
|
||||
if len(args) != 1:
|
||||
print('reserveCoinPurchase requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.reserveCoinPurchase(eval(args[0]),))
|
||||
|
||||
elif cmd == 'reservePayment':
|
||||
if len(args) != 1:
|
||||
print('reservePayment requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.reservePayment(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load diff
|
@ -1,131 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import SnsAdaptorService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' SnsFriends getSnsFriends(SnsIdType snsIdType, string snsAccessToken, i32 startIdx, i32 limit)')
|
||||
print(' SnsProfile getSnsMyProfile(SnsIdType snsIdType, string snsAccessToken)')
|
||||
print(' void postSnsInvitationMessage(SnsIdType snsIdType, string snsAccessToken, string toSnsUserId)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = SnsAdaptorService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'getSnsFriends':
|
||||
if len(args) != 4:
|
||||
print('getSnsFriends requires 4 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getSnsFriends(eval(args[0]), args[1], eval(args[2]), eval(args[3]),))
|
||||
|
||||
elif cmd == 'getSnsMyProfile':
|
||||
if len(args) != 2:
|
||||
print('getSnsMyProfile requires 2 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getSnsMyProfile(eval(args[0]), args[1],))
|
||||
|
||||
elif cmd == 'postSnsInvitationMessage':
|
||||
if len(args) != 3:
|
||||
print('postSnsInvitationMessage requires 3 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.postSnsInvitationMessage(eval(args[0]), args[1], args[2],))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
|
@ -1,757 +0,0 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.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 logging
|
||||
from .ttypes import *
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.transport import TTransport
|
||||
all_structs = []
|
||||
|
||||
|
||||
class Iface(object):
|
||||
def getSnsFriends(self, snsIdType, snsAccessToken, startIdx, limit):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- startIdx
|
||||
- limit
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def getSnsMyProfile(self, snsIdType, snsAccessToken):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def postSnsInvitationMessage(self, snsIdType, snsAccessToken, toSnsUserId):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- toSnsUserId
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Client(Iface):
|
||||
def __init__(self, iprot, oprot=None):
|
||||
self._iprot = self._oprot = iprot
|
||||
if oprot is not None:
|
||||
self._oprot = oprot
|
||||
self._seqid = 0
|
||||
|
||||
def getSnsFriends(self, snsIdType, snsAccessToken, startIdx, limit):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- startIdx
|
||||
- limit
|
||||
|
||||
"""
|
||||
self.send_getSnsFriends(snsIdType, snsAccessToken, startIdx, limit)
|
||||
return self.recv_getSnsFriends()
|
||||
|
||||
def send_getSnsFriends(self, snsIdType, snsAccessToken, startIdx, limit):
|
||||
self._oprot.writeMessageBegin('getSnsFriends', TMessageType.CALL, self._seqid)
|
||||
args = getSnsFriends_args()
|
||||
args.snsIdType = snsIdType
|
||||
args.snsAccessToken = snsAccessToken
|
||||
args.startIdx = startIdx
|
||||
args.limit = limit
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_getSnsFriends(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = getSnsFriends_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "getSnsFriends failed: unknown result")
|
||||
|
||||
def getSnsMyProfile(self, snsIdType, snsAccessToken):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
|
||||
"""
|
||||
self.send_getSnsMyProfile(snsIdType, snsAccessToken)
|
||||
return self.recv_getSnsMyProfile()
|
||||
|
||||
def send_getSnsMyProfile(self, snsIdType, snsAccessToken):
|
||||
self._oprot.writeMessageBegin('getSnsMyProfile', TMessageType.CALL, self._seqid)
|
||||
args = getSnsMyProfile_args()
|
||||
args.snsIdType = snsIdType
|
||||
args.snsAccessToken = snsAccessToken
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_getSnsMyProfile(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = getSnsMyProfile_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.success is not None:
|
||||
return result.success
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
raise TApplicationException(TApplicationException.MISSING_RESULT, "getSnsMyProfile failed: unknown result")
|
||||
|
||||
def postSnsInvitationMessage(self, snsIdType, snsAccessToken, toSnsUserId):
|
||||
"""
|
||||
Parameters:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- toSnsUserId
|
||||
|
||||
"""
|
||||
self.send_postSnsInvitationMessage(snsIdType, snsAccessToken, toSnsUserId)
|
||||
self.recv_postSnsInvitationMessage()
|
||||
|
||||
def send_postSnsInvitationMessage(self, snsIdType, snsAccessToken, toSnsUserId):
|
||||
self._oprot.writeMessageBegin('postSnsInvitationMessage', TMessageType.CALL, self._seqid)
|
||||
args = postSnsInvitationMessage_args()
|
||||
args.snsIdType = snsIdType
|
||||
args.snsAccessToken = snsAccessToken
|
||||
args.toSnsUserId = toSnsUserId
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_postSnsInvitationMessage(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = postSnsInvitationMessage_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
return
|
||||
|
||||
|
||||
class Processor(Iface, TProcessor):
|
||||
def __init__(self, handler):
|
||||
self._handler = handler
|
||||
self._processMap = {}
|
||||
self._processMap["getSnsFriends"] = Processor.process_getSnsFriends
|
||||
self._processMap["getSnsMyProfile"] = Processor.process_getSnsMyProfile
|
||||
self._processMap["postSnsInvitationMessage"] = Processor.process_postSnsInvitationMessage
|
||||
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_getSnsFriends(self, seqid, iprot, oprot):
|
||||
args = getSnsFriends_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = getSnsFriends_result()
|
||||
try:
|
||||
result.success = self._handler.getSnsFriends(args.snsIdType, args.snsAccessToken, args.startIdx, args.limit)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("getSnsFriends", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_getSnsMyProfile(self, seqid, iprot, oprot):
|
||||
args = getSnsMyProfile_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = getSnsMyProfile_result()
|
||||
try:
|
||||
result.success = self._handler.getSnsMyProfile(args.snsIdType, args.snsAccessToken)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("getSnsMyProfile", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
def process_postSnsInvitationMessage(self, seqid, iprot, oprot):
|
||||
args = postSnsInvitationMessage_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = postSnsInvitationMessage_result()
|
||||
try:
|
||||
self._handler.postSnsInvitationMessage(args.snsIdType, args.snsAccessToken, args.toSnsUserId)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except TalkException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("postSnsInvitationMessage", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
# HELPER FUNCTIONS AND STRUCTURES
|
||||
|
||||
|
||||
class getSnsFriends_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- startIdx
|
||||
- limit
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, snsIdType=None, snsAccessToken=None, startIdx=None, limit=None,):
|
||||
self.snsIdType = snsIdType
|
||||
self.snsAccessToken = snsAccessToken
|
||||
self.startIdx = startIdx
|
||||
self.limit = limit
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I32:
|
||||
self.snsIdType = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.STRING:
|
||||
self.snsAccessToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 4:
|
||||
if ftype == TType.I32:
|
||||
self.startIdx = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 5:
|
||||
if ftype == TType.I32:
|
||||
self.limit = iprot.readI32()
|
||||
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('getSnsFriends_args')
|
||||
if self.snsIdType is not None:
|
||||
oprot.writeFieldBegin('snsIdType', TType.I32, 2)
|
||||
oprot.writeI32(self.snsIdType)
|
||||
oprot.writeFieldEnd()
|
||||
if self.snsAccessToken is not None:
|
||||
oprot.writeFieldBegin('snsAccessToken', TType.STRING, 3)
|
||||
oprot.writeString(self.snsAccessToken.encode('utf-8') if sys.version_info[0] == 2 else self.snsAccessToken)
|
||||
oprot.writeFieldEnd()
|
||||
if self.startIdx is not None:
|
||||
oprot.writeFieldBegin('startIdx', TType.I32, 4)
|
||||
oprot.writeI32(self.startIdx)
|
||||
oprot.writeFieldEnd()
|
||||
if self.limit is not None:
|
||||
oprot.writeFieldBegin('limit', TType.I32, 5)
|
||||
oprot.writeI32(self.limit)
|
||||
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(getSnsFriends_args)
|
||||
getSnsFriends_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I32, 'snsIdType', None, None, ), # 2
|
||||
(3, TType.STRING, 'snsAccessToken', 'UTF8', None, ), # 3
|
||||
(4, TType.I32, 'startIdx', None, None, ), # 4
|
||||
(5, TType.I32, 'limit', None, None, ), # 5
|
||||
)
|
||||
|
||||
|
||||
class getSnsFriends_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = SnsFriends()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('getSnsFriends_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(getSnsFriends_result)
|
||||
getSnsFriends_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [SnsFriends, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class getSnsMyProfile_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, snsIdType=None, snsAccessToken=None,):
|
||||
self.snsIdType = snsIdType
|
||||
self.snsAccessToken = snsAccessToken
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I32:
|
||||
self.snsIdType = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.STRING:
|
||||
self.snsAccessToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
iprot.readFieldEnd()
|
||||
iprot.readStructEnd()
|
||||
|
||||
def write(self, oprot):
|
||||
if oprot._fast_encode is not None and self.thrift_spec is not None:
|
||||
oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
|
||||
return
|
||||
oprot.writeStructBegin('getSnsMyProfile_args')
|
||||
if self.snsIdType is not None:
|
||||
oprot.writeFieldBegin('snsIdType', TType.I32, 2)
|
||||
oprot.writeI32(self.snsIdType)
|
||||
oprot.writeFieldEnd()
|
||||
if self.snsAccessToken is not None:
|
||||
oprot.writeFieldBegin('snsAccessToken', TType.STRING, 3)
|
||||
oprot.writeString(self.snsAccessToken.encode('utf-8') if sys.version_info[0] == 2 else self.snsAccessToken)
|
||||
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(getSnsMyProfile_args)
|
||||
getSnsMyProfile_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I32, 'snsIdType', None, None, ), # 2
|
||||
(3, TType.STRING, 'snsAccessToken', 'UTF8', None, ), # 3
|
||||
)
|
||||
|
||||
|
||||
class getSnsMyProfile_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- success
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, success=None, e=None,):
|
||||
self.success = success
|
||||
self.e = e
|
||||
|
||||
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.STRUCT:
|
||||
self.success = SnsProfile()
|
||||
self.success.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('getSnsMyProfile_result')
|
||||
if self.success is not None:
|
||||
oprot.writeFieldBegin('success', TType.STRUCT, 0)
|
||||
self.success.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(getSnsMyProfile_result)
|
||||
getSnsMyProfile_result.thrift_spec = (
|
||||
(0, TType.STRUCT, 'success', [SnsProfile, None], None, ), # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
|
||||
|
||||
class postSnsInvitationMessage_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- snsIdType
|
||||
- snsAccessToken
|
||||
- toSnsUserId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, snsIdType=None, snsAccessToken=None, toSnsUserId=None,):
|
||||
self.snsIdType = snsIdType
|
||||
self.snsAccessToken = snsAccessToken
|
||||
self.toSnsUserId = toSnsUserId
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.I32:
|
||||
self.snsIdType = iprot.readI32()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 3:
|
||||
if ftype == TType.STRING:
|
||||
self.snsAccessToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 4:
|
||||
if ftype == TType.STRING:
|
||||
self.toSnsUserId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
iprot.readFieldEnd()
|
||||
iprot.readStructEnd()
|
||||
|
||||
def write(self, oprot):
|
||||
if oprot._fast_encode is not None and self.thrift_spec is not None:
|
||||
oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
|
||||
return
|
||||
oprot.writeStructBegin('postSnsInvitationMessage_args')
|
||||
if self.snsIdType is not None:
|
||||
oprot.writeFieldBegin('snsIdType', TType.I32, 2)
|
||||
oprot.writeI32(self.snsIdType)
|
||||
oprot.writeFieldEnd()
|
||||
if self.snsAccessToken is not None:
|
||||
oprot.writeFieldBegin('snsAccessToken', TType.STRING, 3)
|
||||
oprot.writeString(self.snsAccessToken.encode('utf-8') if sys.version_info[0] == 2 else self.snsAccessToken)
|
||||
oprot.writeFieldEnd()
|
||||
if self.toSnsUserId is not None:
|
||||
oprot.writeFieldBegin('toSnsUserId', TType.STRING, 4)
|
||||
oprot.writeString(self.toSnsUserId.encode('utf-8') if sys.version_info[0] == 2 else self.toSnsUserId)
|
||||
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(postSnsInvitationMessage_args)
|
||||
postSnsInvitationMessage_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.I32, 'snsIdType', None, None, ), # 2
|
||||
(3, TType.STRING, 'snsAccessToken', 'UTF8', None, ), # 3
|
||||
(4, TType.STRING, 'toSnsUserId', 'UTF8', None, ), # 4
|
||||
)
|
||||
|
||||
|
||||
class postSnsInvitationMessage_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, e=None,):
|
||||
self.e = e
|
||||
|
||||
def read(self, iprot):
|
||||
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
|
||||
iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
|
||||
return
|
||||
iprot.readStructBegin()
|
||||
while True:
|
||||
(fname, ftype, fid) = iprot.readFieldBegin()
|
||||
if ftype == TType.STOP:
|
||||
break
|
||||
if fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = TalkException()
|
||||
self.e.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('postSnsInvitationMessage_result')
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(postSnsInvitationMessage_result)
|
||||
postSnsInvitationMessage_result.thrift_spec = (
|
||||
None, # 0
|
||||
(1, TType.STRUCT, 'e', [TalkException, None], None, ), # 1
|
||||
)
|
||||
fix_spec(all_structs)
|
||||
del all_structs
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,117 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
if sys.version_info[0] > 2:
|
||||
from urllib.parse import urlparse
|
||||
else:
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
|
||||
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
|
||||
|
||||
from line import UniversalNotificationService
|
||||
from line.ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print('')
|
||||
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
|
||||
print('')
|
||||
print('Functions:')
|
||||
print(' void notify(GlobalEvent event)')
|
||||
print('')
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
ssl = False
|
||||
validate = True
|
||||
ca_certs = None
|
||||
keyfile = None
|
||||
certfile = None
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi + 1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi + 1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
|
||||
ssl = True
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-novalidate':
|
||||
validate = False
|
||||
argi += 1
|
||||
|
||||
if sys.argv[argi] == '-ca_certs':
|
||||
ca_certs = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-keyfile':
|
||||
keyfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-certfile':
|
||||
certfile = sys.argv[argi+1]
|
||||
argi += 2
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi + 1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
if ssl:
|
||||
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol(transport)
|
||||
client = UniversalNotificationService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'notify':
|
||||
if len(args) != 1:
|
||||
print('notify requires 1 args')
|
||||
sys.exit(1)
|
||||
pp.pprint(client.notify(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print('Unrecognized method %s' % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
|
@ -1,254 +0,0 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.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 logging
|
||||
from .ttypes import *
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.transport import TTransport
|
||||
all_structs = []
|
||||
|
||||
|
||||
class Iface(object):
|
||||
def notify(self, event):
|
||||
"""
|
||||
Parameters:
|
||||
- event
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Client(Iface):
|
||||
def __init__(self, iprot, oprot=None):
|
||||
self._iprot = self._oprot = iprot
|
||||
if oprot is not None:
|
||||
self._oprot = oprot
|
||||
self._seqid = 0
|
||||
|
||||
def notify(self, event):
|
||||
"""
|
||||
Parameters:
|
||||
- event
|
||||
|
||||
"""
|
||||
self.send_notify(event)
|
||||
self.recv_notify()
|
||||
|
||||
def send_notify(self, event):
|
||||
self._oprot.writeMessageBegin('notify', TMessageType.CALL, self._seqid)
|
||||
args = notify_args()
|
||||
args.event = event
|
||||
args.write(self._oprot)
|
||||
self._oprot.writeMessageEnd()
|
||||
self._oprot.trans.flush()
|
||||
|
||||
def recv_notify(self):
|
||||
iprot = self._iprot
|
||||
(fname, mtype, rseqid) = iprot.readMessageBegin()
|
||||
if mtype == TMessageType.EXCEPTION:
|
||||
x = TApplicationException()
|
||||
x.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
raise x
|
||||
result = notify_result()
|
||||
result.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
if result.e is not None:
|
||||
raise result.e
|
||||
return
|
||||
|
||||
|
||||
class Processor(Iface, TProcessor):
|
||||
def __init__(self, handler):
|
||||
self._handler = handler
|
||||
self._processMap = {}
|
||||
self._processMap["notify"] = Processor.process_notify
|
||||
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_notify(self, seqid, iprot, oprot):
|
||||
args = notify_args()
|
||||
args.read(iprot)
|
||||
iprot.readMessageEnd()
|
||||
result = notify_result()
|
||||
try:
|
||||
self._handler.notify(args.event)
|
||||
msg_type = TMessageType.REPLY
|
||||
except TTransport.TTransportException:
|
||||
raise
|
||||
except UniversalNotificationServiceException as e:
|
||||
msg_type = TMessageType.REPLY
|
||||
result.e = e
|
||||
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("notify", msg_type, seqid)
|
||||
result.write(oprot)
|
||||
oprot.writeMessageEnd()
|
||||
oprot.trans.flush()
|
||||
|
||||
# HELPER FUNCTIONS AND STRUCTURES
|
||||
|
||||
|
||||
class notify_args(object):
|
||||
"""
|
||||
Attributes:
|
||||
- event
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, event=None,):
|
||||
self.event = event
|
||||
|
||||
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 == 2:
|
||||
if ftype == TType.STRUCT:
|
||||
self.event = GlobalEvent()
|
||||
self.event.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('notify_args')
|
||||
if self.event is not None:
|
||||
oprot.writeFieldBegin('event', TType.STRUCT, 2)
|
||||
self.event.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(notify_args)
|
||||
notify_args.thrift_spec = (
|
||||
None, # 0
|
||||
None, # 1
|
||||
(2, TType.STRUCT, 'event', [GlobalEvent, None], None, ), # 2
|
||||
)
|
||||
|
||||
|
||||
class notify_result(object):
|
||||
"""
|
||||
Attributes:
|
||||
- e
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, e=None,):
|
||||
self.e = e
|
||||
|
||||
def read(self, iprot):
|
||||
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
|
||||
iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
|
||||
return
|
||||
iprot.readStructBegin()
|
||||
while True:
|
||||
(fname, ftype, fid) = iprot.readFieldBegin()
|
||||
if ftype == TType.STOP:
|
||||
break
|
||||
if fid == 1:
|
||||
if ftype == TType.STRUCT:
|
||||
self.e = UniversalNotificationServiceException()
|
||||
self.e.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('notify_result')
|
||||
if self.e is not None:
|
||||
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
||||
self.e.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(notify_result)
|
||||
notify_result.thrift_spec = (
|
||||
None, # 0
|
||||
(1, TType.STRUCT, 'e', [UniversalNotificationServiceException, None], None, ), # 1
|
||||
)
|
||||
fix_spec(all_structs)
|
||||
del all_structs
|
||||
|
|
@ -1 +1 @@
|
|||
__all__ = ['ttypes', 'constants', 'AccountSupervisorService', 'AgeCheckService', 'BuddyManagementService', 'BuddyService', 'ChannelApplicationProvidedService', 'ChannelService', 'MessageService', 'ShopService', 'SnsAdaptorService', 'TalkService', 'UniversalNotificationService']
|
||||
__all__ = ['ttypes', 'constants', 'TalkService']
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
# Autogenerated by Thrift Compiler (0.11.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
|
|
355
libs/core/src/LICENSE.md
Normal file
355
libs/core/src/LICENSE.md
Normal file
|
@ -0,0 +1,355 @@
|
|||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
### 1. Definitions
|
||||
|
||||
**1.1. “Contributor”**
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
**1.2. “Contributor Version”**
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
**1.3. “Contribution”**
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
**1.4. “Covered Software”**
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
**1.5. “Incompatible With Secondary Licenses”**
|
||||
means
|
||||
|
||||
* **(a)** that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
* **(b)** that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
**1.6. “Executable Form”**
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
**1.7. “Larger Work”**
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
**1.8. “License”**
|
||||
means this document.
|
||||
|
||||
**1.9. “Licensable”**
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
**1.10. “Modifications”**
|
||||
means any of the following:
|
||||
|
||||
* **(a)** any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
* **(b)** any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
**1.11. “Patent Claims” of a Contributor**
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
**1.12. “Secondary License”**
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
**1.13. “Source Code Form”**
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
**1.14. “You” (or “Your”)**
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, “You” includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, “control” means **(a)** the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or **(b)** ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
|
||||
### 2. License Grants and Conditions
|
||||
|
||||
#### 2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
* **(a)** under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
* **(b)** under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
#### 2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
#### 2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
* **(a)** for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
* **(b)** for infringements caused by: **(i)** Your and any other third party's
|
||||
modifications of Covered Software, or **(ii)** the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
* **(c)** under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
#### 2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
#### 2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
#### 2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
#### 2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
|
||||
### 3. Responsibilities
|
||||
|
||||
#### 3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
#### 3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
* **(a)** such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
* **(b)** You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
#### 3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
#### 3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
#### 3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
|
||||
### 4. Inability to Comply Due to Statute or Regulation
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: **(a)** comply with
|
||||
the terms of this License to the maximum extent possible; and **(b)**
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
|
||||
### 5. Termination
|
||||
|
||||
**5.1.** The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated **(a)** provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and **(b)** on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
**5.2.** If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
|
||||
### 6. Disclaimer of Warranty
|
||||
|
||||
> Covered Software is provided under this License on an “as is”
|
||||
> basis, without warranty of any kind, either expressed, implied, or
|
||||
> statutory, including, without limitation, warranties that the
|
||||
> Covered Software is free of defects, merchantable, fit for a
|
||||
> particular purpose or non-infringing. The entire risk as to the
|
||||
> quality and performance of the Covered Software is with You.
|
||||
> Should any Covered Software prove defective in any respect, You
|
||||
> (not any Contributor) assume the cost of any necessary servicing,
|
||||
> repair, or correction. This disclaimer of warranty constitutes an
|
||||
> essential part of this License. No use of any Covered Software is
|
||||
> authorized under this License except under this disclaimer.
|
||||
|
||||
### 7. Limitation of Liability
|
||||
|
||||
> Under no circumstances and under no legal theory, whether tort
|
||||
> (including negligence), contract, or otherwise, shall any
|
||||
> Contributor, or anyone who distributes Covered Software as
|
||||
> permitted above, be liable to You for any direct, indirect,
|
||||
> special, incidental, or consequential damages of any character
|
||||
> including, without limitation, damages for lost profits, loss of
|
||||
> goodwill, work stoppage, computer failure or malfunction, or any
|
||||
> and all other commercial damages or losses, even if such party
|
||||
> shall have been informed of the possibility of such damages. This
|
||||
> limitation of liability shall not apply to liability for death or
|
||||
> personal injury resulting from such party's negligence to the
|
||||
> extent applicable law prohibits such limitation. Some
|
||||
> jurisdictions do not allow the exclusion or limitation of
|
||||
> incidental or consequential damages, so this exclusion and
|
||||
> limitation may not apply to You.
|
||||
|
||||
|
||||
### 8. Litigation
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
|
||||
### 9. Miscellaneous
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
|
||||
### 10. Versions of the License
|
||||
|
||||
#### 10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
#### 10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
#### 10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
## Exhibit A - Source Code Form License Notice
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
## Exhibit B - “Incompatible With Secondary Licenses” Notice
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
12
libs/core/src/README.md
Normal file
12
libs/core/src/README.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Yuuki_Core
|
||||
|
||||
The LINE Protocol for Star Yuuki BOT
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
|
||||
Copyright 2019 [Star Inc.](https://starinc.xyz) All Rights Reserved.
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.14.0)
|
||||
# Autogenerated by Thrift Compiler (0.11.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
|
@ -839,17 +839,23 @@ class GroupAttribute(object):
|
|||
NAME = 1
|
||||
PICTURE_STATUS = 2
|
||||
ALL = 255
|
||||
PREVENTED_JOIN_BY_TICKET = 4
|
||||
NOTIFICATION_SETTING = 8
|
||||
|
||||
_VALUES_TO_NAMES = {
|
||||
1: "NAME",
|
||||
2: "PICTURE_STATUS",
|
||||
255: "ALL",
|
||||
4: "PREVENTED_JOIN_BY_TICKET",
|
||||
8: "NOTIFICATION_SETTING",
|
||||
}
|
||||
|
||||
_NAMES_TO_VALUES = {
|
||||
"NAME": 1,
|
||||
"PICTURE_STATUS": 2,
|
||||
"ALL": 255,
|
||||
"PREVENTED_JOIN_BY_TICKET": 4,
|
||||
"NOTIFICATION_SETTING": 8,
|
||||
}
|
||||
|
||||
|
||||
|
@ -1785,7 +1791,6 @@ class AgeCheckDocomoResult(object):
|
|||
Attributes:
|
||||
- authUrl
|
||||
- userAgeType
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -1853,7 +1858,6 @@ class AgeCheckRequestResult(object):
|
|||
Attributes:
|
||||
- authUrl
|
||||
- sessionId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -1926,7 +1930,6 @@ class Announcement(object):
|
|||
- createdTime
|
||||
- pictureUrl
|
||||
- thumbnailUrl
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2043,7 +2046,6 @@ class ChannelProvider(object):
|
|||
"""
|
||||
Attributes:
|
||||
- name
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2109,7 +2111,6 @@ class ChannelInfo(object):
|
|||
- permissions
|
||||
- iconThumbnailImage
|
||||
- channelConfigurations
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2274,7 +2275,6 @@ class ApprovedChannelInfo(object):
|
|||
Attributes:
|
||||
- channelInfo
|
||||
- approvedAt
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2343,7 +2343,6 @@ class ApprovedChannelInfos(object):
|
|||
Attributes:
|
||||
- approvedChannelInfos
|
||||
- revision
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2420,7 +2419,6 @@ class AuthQrcode(object):
|
|||
Attributes:
|
||||
- qrcode
|
||||
- verifier
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2489,7 +2487,6 @@ class BuddyBanner(object):
|
|||
- buddyBannerLinkType
|
||||
- buddyBannerLink
|
||||
- buddyBannerImageUrl
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2572,7 +2569,6 @@ class BuddyDetail(object):
|
|||
- addable
|
||||
- acceptableContentTypes
|
||||
- capableMyhome
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2715,7 +2711,6 @@ class Contact(object):
|
|||
- attributes
|
||||
- settings
|
||||
- picturePath
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -2955,7 +2950,6 @@ class BuddyList(object):
|
|||
- displayName
|
||||
- totalBuddyCount
|
||||
- popularContacts
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3055,7 +3049,6 @@ class Location(object):
|
|||
- latitude
|
||||
- longitude
|
||||
- phone
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3156,7 +3149,6 @@ class BuddyMessageRequest(object):
|
|||
- location
|
||||
- content
|
||||
- contentMetadata
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3265,7 +3257,6 @@ class BuddyOnAirUrls(object):
|
|||
Attributes:
|
||||
- hls
|
||||
- smoothStreaming
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3360,7 +3351,6 @@ class BuddyOnAir(object):
|
|||
- targetCount
|
||||
- onAirType
|
||||
- onAirUrls
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3503,7 +3493,6 @@ class BuddyProfile(object):
|
|||
- displayName
|
||||
- statusMessage
|
||||
- contactCount
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3615,7 +3604,6 @@ class BuddySearchResult(object):
|
|||
- picturePath
|
||||
- statusMessage
|
||||
- businessAccount
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3723,7 +3711,6 @@ class ChannelDomain(object):
|
|||
Attributes:
|
||||
- host
|
||||
- removed
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3791,7 +3778,6 @@ class ChannelDomains(object):
|
|||
Attributes:
|
||||
- channelDomains
|
||||
- revision
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3869,7 +3855,6 @@ class ChannelException(TException):
|
|||
- code
|
||||
- reason
|
||||
- parameterMap
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -3960,7 +3945,6 @@ class ChannelInfos(object):
|
|||
Attributes:
|
||||
- channelInfos
|
||||
- revision
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4040,7 +4024,6 @@ class ChannelNotificationSetting(object):
|
|||
- notificationReceivable
|
||||
- messageReceivable
|
||||
- showDefault
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4140,7 +4123,6 @@ class ChannelSyncDatas(object):
|
|||
- channelDomains
|
||||
- revision
|
||||
- expires
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4249,7 +4231,6 @@ class ChannelToken(object):
|
|||
- expiration
|
||||
- refreshToken
|
||||
- channelAccessToken
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4349,7 +4330,6 @@ class Coin(object):
|
|||
- payedCoinBalance
|
||||
- totalCoinBalance
|
||||
- rewardCoinBalance
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4439,7 +4419,6 @@ class CoinPayLoad(object):
|
|||
- freeCoin
|
||||
- type
|
||||
- rewardCoin
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4537,7 +4516,6 @@ class CoinHistory(object):
|
|||
- displayPrice
|
||||
- payload
|
||||
- channelId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4709,7 +4687,6 @@ class CoinHistoryCondition(object):
|
|||
- language
|
||||
- eddt
|
||||
- appStoreCode
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4808,7 +4785,6 @@ class CoinHistoryResult(object):
|
|||
- historys
|
||||
- balance
|
||||
- hasNext
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4902,7 +4878,6 @@ class CoinProductItem(object):
|
|||
- displayPrice
|
||||
- name
|
||||
- desc
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5035,7 +5010,6 @@ class CoinPurchaseConfirm(object):
|
|||
- seller
|
||||
- requestType
|
||||
- ignoreReceipt
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5159,7 +5133,6 @@ class CoinPurchaseReservation(object):
|
|||
- language
|
||||
- pgCode
|
||||
- redirectUrl
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5288,7 +5261,6 @@ class CoinUseReservationItem(object):
|
|||
- itemId
|
||||
- itemName
|
||||
- amount
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5369,7 +5341,6 @@ class CoinUseReservation(object):
|
|||
- appStoreCode
|
||||
- items
|
||||
- country
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5480,7 +5451,6 @@ class CompactContact(object):
|
|||
- status
|
||||
- settings
|
||||
- displayNameOverridden
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5591,7 +5561,6 @@ class ContactModification(object):
|
|||
- phones
|
||||
- emails
|
||||
- userids
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5715,7 +5684,6 @@ class ContactRegistration(object):
|
|||
- luid
|
||||
- contactType
|
||||
- contactKey
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5805,7 +5773,6 @@ class ContactReport(object):
|
|||
- mid
|
||||
- exists
|
||||
- contact
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5884,7 +5851,6 @@ class ContactReportResult(object):
|
|||
Attributes:
|
||||
- mid
|
||||
- exists
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -5957,7 +5923,6 @@ class DeviceInfo(object):
|
|||
- carrierCode
|
||||
- carrierName
|
||||
- applicationType
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6077,7 +6042,6 @@ class EmailConfirmation(object):
|
|||
- email
|
||||
- password
|
||||
- ignoreDuplication
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6166,7 +6130,6 @@ class EmailConfirmationSession(object):
|
|||
- emailConfirmationType
|
||||
- verifier
|
||||
- targetEmail
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6245,7 +6208,6 @@ class FriendChannelMatrix(object):
|
|||
- channelId
|
||||
- representMid
|
||||
- count
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6323,7 +6285,6 @@ class FriendChannelMatricesResponse(object):
|
|||
Attributes:
|
||||
- expires
|
||||
- matrices
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6400,7 +6361,6 @@ class Geolocation(object):
|
|||
Attributes:
|
||||
- longitude
|
||||
- latitude
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6469,7 +6429,6 @@ class NotificationTarget(object):
|
|||
- applicationType
|
||||
- applicationVersion
|
||||
- region
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6550,7 +6509,6 @@ class GlobalEvent(object):
|
|||
- createdTime
|
||||
- data
|
||||
- maxDelay
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6652,6 +6610,73 @@ class GlobalEvent(object):
|
|||
return not (self == other)
|
||||
|
||||
|
||||
class GroupPreference(object):
|
||||
"""
|
||||
Attributes:
|
||||
- invitationTicket
|
||||
- favoriteTimestamp
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, invitationTicket=None, favoriteTimestamp=None,):
|
||||
self.invitationTicket = invitationTicket
|
||||
self.favoriteTimestamp = favoriteTimestamp
|
||||
|
||||
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.invitationTicket = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 2:
|
||||
if ftype == TType.I64:
|
||||
self.favoriteTimestamp = iprot.readI64()
|
||||
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('GroupPreference')
|
||||
if self.invitationTicket is not None:
|
||||
oprot.writeFieldBegin('invitationTicket', TType.STRING, 1)
|
||||
oprot.writeString(self.invitationTicket.encode('utf-8') if sys.version_info[0] == 2 else self.invitationTicket)
|
||||
oprot.writeFieldEnd()
|
||||
if self.favoriteTimestamp is not None:
|
||||
oprot.writeFieldBegin('favoriteTimestamp', TType.I64, 2)
|
||||
oprot.writeI64(self.favoriteTimestamp)
|
||||
oprot.writeFieldEnd()
|
||||
oprot.writeFieldStop()
|
||||
oprot.writeStructEnd()
|
||||
|
||||
def validate(self):
|
||||
return
|
||||
|
||||
def __repr__(self):
|
||||
L = ['%s=%r' % (key, value)
|
||||
for key, value in self.__dict__.items()]
|
||||
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
return not (self == other)
|
||||
|
||||
|
||||
class Group(object):
|
||||
"""
|
||||
Attributes:
|
||||
|
@ -6659,19 +6684,22 @@ class Group(object):
|
|||
- createdTime
|
||||
- name
|
||||
- pictureStatus
|
||||
- preventedJoinByTicket
|
||||
- groupPreference
|
||||
- members
|
||||
- creator
|
||||
- invitee
|
||||
- notificationDisabled
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, id=None, createdTime=None, name=None, pictureStatus=None, members=None, creator=None, invitee=None, notificationDisabled=None,):
|
||||
def __init__(self, id=None, createdTime=None, name=None, pictureStatus=None, preventedJoinByTicket=None, groupPreference=None, members=None, creator=None, invitee=None, notificationDisabled=None,):
|
||||
self.id = id
|
||||
self.createdTime = createdTime
|
||||
self.name = name
|
||||
self.pictureStatus = pictureStatus
|
||||
self.preventedJoinByTicket = preventedJoinByTicket
|
||||
self.groupPreference = groupPreference
|
||||
self.members = members
|
||||
self.creator = creator
|
||||
self.invitee = invitee
|
||||
|
@ -6706,6 +6734,17 @@ class Group(object):
|
|||
self.pictureStatus = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 12:
|
||||
if ftype == TType.BOOL:
|
||||
self.preventedJoinByTicket = iprot.readBool()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 13:
|
||||
if ftype == TType.STRUCT:
|
||||
self.groupPreference = GroupPreference()
|
||||
self.groupPreference.read(iprot)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
elif fid == 20:
|
||||
if ftype == TType.LIST:
|
||||
self.members = []
|
||||
|
@ -6765,6 +6804,14 @@ class Group(object):
|
|||
oprot.writeFieldBegin('pictureStatus', TType.STRING, 11)
|
||||
oprot.writeString(self.pictureStatus.encode('utf-8') if sys.version_info[0] == 2 else self.pictureStatus)
|
||||
oprot.writeFieldEnd()
|
||||
if self.preventedJoinByTicket is not None:
|
||||
oprot.writeFieldBegin('preventedJoinByTicket', TType.BOOL, 12)
|
||||
oprot.writeBool(self.preventedJoinByTicket)
|
||||
oprot.writeFieldEnd()
|
||||
if self.groupPreference is not None:
|
||||
oprot.writeFieldBegin('groupPreference', TType.STRUCT, 13)
|
||||
self.groupPreference.write(oprot)
|
||||
oprot.writeFieldEnd()
|
||||
if self.members is not None:
|
||||
oprot.writeFieldBegin('members', TType.LIST, 20)
|
||||
oprot.writeListBegin(TType.STRUCT, len(self.members))
|
||||
|
@ -6811,7 +6858,6 @@ class IdentityCredential(object):
|
|||
- provider
|
||||
- identifier
|
||||
- password
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6889,7 +6935,6 @@ class LastReadMessageId(object):
|
|||
Attributes:
|
||||
- mid
|
||||
- lastReadMessageId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -6957,7 +7002,6 @@ class LastReadMessageIds(object):
|
|||
Attributes:
|
||||
- chatId
|
||||
- lastReadMessageIds
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7037,7 +7081,6 @@ class LoginResult(object):
|
|||
- verifier
|
||||
- pinCode
|
||||
- type
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7138,7 +7181,6 @@ class LoginSession(object):
|
|||
- applicationType
|
||||
- systemName
|
||||
- accessLocation
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7246,7 +7288,6 @@ class Message(object):
|
|||
- contentType
|
||||
- contentPreview
|
||||
- contentMetadata
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7432,7 +7473,6 @@ class MessageOperation(object):
|
|||
- param2
|
||||
- param3
|
||||
- message
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7571,7 +7611,6 @@ class MessageOperations(object):
|
|||
Attributes:
|
||||
- operations
|
||||
- endFlag
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7649,7 +7688,6 @@ class MetaProfile(object):
|
|||
- createTime
|
||||
- regionCode
|
||||
- identities
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7743,7 +7781,6 @@ class NotificationItem(object):
|
|||
- revision
|
||||
- createdTime
|
||||
- content
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7881,7 +7918,6 @@ class NotificationFetchResult(object):
|
|||
Attributes:
|
||||
- fetchMode
|
||||
- itemList
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -7966,7 +8002,6 @@ class Operation(object):
|
|||
- param2
|
||||
- param3
|
||||
- message
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8123,7 +8158,6 @@ class PaymentReservation(object):
|
|||
- messageText
|
||||
- messageTemplate
|
||||
- packageId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8272,7 +8306,6 @@ class PaymentReservationResult(object):
|
|||
- orderId
|
||||
- confirmUrl
|
||||
- extras
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8386,7 +8419,6 @@ class Product(object):
|
|||
- publishSince
|
||||
- newFlag
|
||||
- missionFlag
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8718,7 +8750,6 @@ class ProductList(object):
|
|||
- bannerTargetPath
|
||||
- productList
|
||||
- bannerLang
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8838,7 +8869,6 @@ class ProductSimple(object):
|
|||
- version
|
||||
- onSale
|
||||
- validUntil
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -8940,7 +8970,6 @@ class ProductSimpleList(object):
|
|||
- productList
|
||||
- recentNewReleaseDate
|
||||
- recentEventReleaseDate
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9068,7 +9097,6 @@ class Profile(object):
|
|||
- allowSearchByUserid
|
||||
- allowSearchByEmail
|
||||
- picturePath
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9246,7 +9274,6 @@ class ProximityMatchCandidateResult(object):
|
|||
Attributes:
|
||||
- users
|
||||
- buddies
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9332,7 +9359,6 @@ class RegisterWithSnsIdResult(object):
|
|||
Attributes:
|
||||
- authToken
|
||||
- userCreated
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9400,7 +9426,6 @@ class RequestTokenResponse(object):
|
|||
Attributes:
|
||||
- requestToken
|
||||
- returnUrl
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9470,7 +9495,6 @@ class Room(object):
|
|||
- createdTime
|
||||
- contacts
|
||||
- notificationDisabled
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9569,7 +9593,6 @@ class RSAKey(object):
|
|||
- nvalue
|
||||
- evalue
|
||||
- sessionKey
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9667,7 +9690,6 @@ class SendBuddyMessageResult(object):
|
|||
- unregisterCount
|
||||
- timestamp
|
||||
- message
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -9843,7 +9865,6 @@ class SetBuddyOnAirResult(object):
|
|||
- unregisterCount
|
||||
- timestamp
|
||||
- message
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10013,7 +10034,6 @@ class Settings(object):
|
|||
- emailConfirmationStatus
|
||||
- preferenceLocale
|
||||
- customModes
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10322,7 +10342,6 @@ class SimpleChannelClient(object):
|
|||
- applicationType
|
||||
- applicationVersion
|
||||
- locale
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10403,7 +10422,6 @@ class SimpleChannelContact(object):
|
|||
- pictureStatus
|
||||
- picturePath
|
||||
- statusMessage
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10502,7 +10520,6 @@ class SnsFriend(object):
|
|||
- snsUserId
|
||||
- snsUserName
|
||||
- snsIdType
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10581,7 +10598,6 @@ class SnsFriendContactRegistration(object):
|
|||
- contact
|
||||
- snsIdType
|
||||
- snsUserId
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10660,7 +10676,6 @@ class SnsFriendModification(object):
|
|||
Attributes:
|
||||
- type
|
||||
- snsFriend
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10729,7 +10744,6 @@ class SnsFriends(object):
|
|||
Attributes:
|
||||
- snsFriends
|
||||
- hasMore
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10807,7 +10821,6 @@ class SnsIdUserStatus(object):
|
|||
- userExisting
|
||||
- phoneNumberRegistered
|
||||
- sameDevice
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10887,7 +10900,6 @@ class SnsProfile(object):
|
|||
- snsUserName
|
||||
- email
|
||||
- thumbnailUrl
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -10978,7 +10990,6 @@ class SystemConfiguration(object):
|
|||
- updateUrl
|
||||
- c2dmAccount
|
||||
- nniServer
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11077,7 +11088,6 @@ class TalkException(TException):
|
|||
- code
|
||||
- reason
|
||||
- parameterMap
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11169,7 +11179,6 @@ class Ticket(object):
|
|||
- id
|
||||
- expirationTime
|
||||
- maxUseCount
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11253,7 +11262,6 @@ class TMessageBox(object):
|
|||
- status
|
||||
- midType
|
||||
- lastMessages
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11392,7 +11400,6 @@ class TMessageBoxWrapUp(object):
|
|||
- name
|
||||
- contacts
|
||||
- pictureRevision
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11490,7 +11497,6 @@ class TMessageBoxWrapUpResponse(object):
|
|||
Attributes:
|
||||
- messageBoxWrapUpList
|
||||
- totalSize
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11568,7 +11574,6 @@ class UniversalNotificationServiceException(TException):
|
|||
- code
|
||||
- reason
|
||||
- parameterMap
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11667,7 +11672,6 @@ class UpdateBuddyProfileResult(object):
|
|||
- unregisterCount
|
||||
- timestamp
|
||||
- message
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11815,7 +11819,6 @@ class UserAuthStatus(object):
|
|||
Attributes:
|
||||
- phoneNumberRegistered
|
||||
- registeredSnsIdTypes
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -11896,7 +11899,6 @@ class VerificationSessionData(object):
|
|||
- countryCode
|
||||
- nationalSignificantNumber
|
||||
- availableVerificationMethods
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -12024,7 +12026,6 @@ class WapInvitation(object):
|
|||
- inviteeEmail
|
||||
- inviterMid
|
||||
- roomMid
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
@ -12608,6 +12609,12 @@ GlobalEvent.thrift_spec = (
|
|||
(4, TType.I64, 'data', None, None, ), # 4
|
||||
(5, TType.I32, 'maxDelay', None, None, ), # 5
|
||||
)
|
||||
all_structs.append(GroupPreference)
|
||||
GroupPreference.thrift_spec = (
|
||||
None, # 0
|
||||
(1, TType.STRING, 'invitationTicket', 'UTF8', None, ), # 1
|
||||
(2, TType.I64, 'favoriteTimestamp', None, None, ), # 2
|
||||
)
|
||||
all_structs.append(Group)
|
||||
Group.thrift_spec = (
|
||||
None, # 0
|
||||
|
@ -12622,8 +12629,8 @@ Group.thrift_spec = (
|
|||
None, # 9
|
||||
(10, TType.STRING, 'name', 'UTF8', None, ), # 10
|
||||
(11, TType.STRING, 'pictureStatus', 'UTF8', None, ), # 11
|
||||
None, # 12
|
||||
None, # 13
|
||||
(12, TType.BOOL, 'preventedJoinByTicket', None, None, ), # 12
|
||||
(13, TType.STRUCT, 'groupPreference', [GroupPreference, None], None, ), # 13
|
||||
None, # 14
|
||||
None, # 15
|
||||
None, # 16
|
||||
|
|
34
libs/webadmin/reader.py
Normal file
34
libs/webadmin/reader.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
from bs4 import BeautifulSoup
|
||||
|
||||
class Yuuki_WebDataReader:
|
||||
def __init__(self, Yuuki_Data):
|
||||
self.handle = Yuuki_Data
|
||||
|
||||
def get_log(self, name):
|
||||
if name not in self.handle.LogType:
|
||||
return {"status": 404}
|
||||
with open(
|
||||
self.handle.LogPath
|
||||
+
|
||||
self.handle.LogName.format(name)
|
||||
) as file:
|
||||
html_doc = file.read()
|
||||
parser = BeautifulSoup(html_doc, 'html.parser')
|
||||
events = parser.find_all('li')
|
||||
return {name: [result.string for result in events]}
|
||||
|
||||
def get_all_logs(self):
|
||||
logs = {}
|
||||
|
||||
for name in self.handle.LogType:
|
||||
with open(
|
||||
self.handle.LogPath
|
||||
+
|
||||
self.handle.LogName.format(name)
|
||||
) as file:
|
||||
html_doc = file.read()
|
||||
parser = BeautifulSoup(html_doc, 'html.parser')
|
||||
events = parser.find_all('li')
|
||||
logs[name] = [result.string for result in events]
|
||||
|
||||
return logs
|
|
@ -3,6 +3,8 @@ import json
|
|||
import random
|
||||
import time
|
||||
|
||||
from .reader import Yuuki_WebDataReader
|
||||
|
||||
from flask import Flask, render_template, Response, request, redirect
|
||||
from flask_bootstrap import Bootstrap
|
||||
|
||||
|
@ -10,14 +12,16 @@ from gevent.pywsgi import WSGIServer
|
|||
|
||||
wa_app = Flask(__name__)
|
||||
Yuuki_Handle = None
|
||||
Yuuki_DataHandle = None
|
||||
|
||||
passports = []
|
||||
password = str(hash(random.random()))
|
||||
|
||||
class Yuuki_WebAdmin:
|
||||
def __init__(self, Yuuki):
|
||||
global Yuuki_Handle
|
||||
global Yuuki_Handle, Yuuki_DataHandle
|
||||
Yuuki_Handle = Yuuki
|
||||
Yuuki_DataHandle = Yuuki_WebDataReader(Yuuki_Handle.data)
|
||||
|
||||
self.app = wa_app
|
||||
Bootstrap(self.app)
|
||||
|
@ -80,6 +84,19 @@ class Yuuki_WebAdmin:
|
|||
)
|
||||
return response
|
||||
|
||||
@staticmethod
|
||||
@wa_app.route("/api/logs")
|
||||
@wa_app.route("/api/logs/<name>")
|
||||
def logs(name=""):
|
||||
result = {"status": 403}
|
||||
if "yuuki_admin" in request.cookies:
|
||||
if request.cookies.get("yuuki_admin") in passports:
|
||||
if name:
|
||||
result = Yuuki_DataHandle.get_log(name)
|
||||
else:
|
||||
result = Yuuki_DataHandle.get_all_logs()
|
||||
return Response(json.dumps(result), mimetype='application/json')
|
||||
|
||||
@staticmethod
|
||||
def set_password(code):
|
||||
global password
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
beautifulsoup4==4.8.2
|
||||
gevent==1.4.0
|
||||
flask==1.1.1
|
||||
bootstrap-flask==1.2.0
|
||||
|
|
Loading…
Reference in a new issue