reminders-app-0.4+15.04.20141118/0000755000015301777760000000000012432703240016520 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/run_on_ubuntu_touch.sh0000755000015301777760000000644212432702717023201 0ustar pbusernogroup00000000000000#!/bin/sh CODE_DIR=reminders BUILD_DIR=builddir USER=phablet USER_ID=32011 PASSWORD=phablet PACKAGE=reminders BINARY=reminders TARGET_IP=${TARGET_IP-127.0.0.1} TARGET_SSH_PORT=${TARGET_SSH_PORT-2222} TARGET_DEBUG_PORT=3768 RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT SETUP=false GDB=false CLICK=false SUDO="echo $PASSWORD | sudo -S" NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))' FLIPPED=false DEPS="qt5-default qtbase5-dev qtdeclarative5-dev libboost-dev libssl-dev cmake" exec_with_ssh() { ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t $USER@$TARGET_IP -p $TARGET_SSH_PORT sudo -u $USER -i bash -ic \"$@\" } exec_with_adb() { adb shell $@ } adb_root() { adb root adb wait-for-device } install_ssh_key() { ssh-keygen -R $TARGET_IP HOME_DIR="/home/phablet" adb push ~/.ssh/id_rsa.pub $HOME_DIR/.ssh/authorized_keys adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh/authorized_keys adb shell chmod 700 $HOME_DIR/.ssh adb shell chmod 600 $HOME_DIR/.ssh/authorized_keys } setup_adb_forwarding() { adb shell start ssh adb forward tcp:$TARGET_SSH_PORT tcp:22 adb forward tcp:$TARGET_DEBUG_PORT tcp:$TARGET_DEBUG_PORT } install_dependencies() { exec_with_adb apt-get --yes install build-essential $DEPS } sync_code() { WORK_DIR=`pwd` [ -e .bzr ] && bzr export --uncommitted --format=dir /tmp/$CODE_DIR [ -e .git ] && cd /tmp && cp -r $WORK_DIR $CODE_DIR && cd $CODE_DIR && git clean -f -x && rm .git -rf && cd - rsync -crlOzv --delete --exclude builddir -e "ssh -p $TARGET_SSH_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" /tmp/$CODE_DIR/ $USER@$TARGET_IP:$CODE_DIR/ rm -rf /tmp/$CODE_DIR } build() { exec_with_ssh mkdir -p $CODE_DIR/$BUILD_DIR exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/$BUILD_DIR && PATH=/usr/lib/ccache:$PATH QT_SELECT=qt5 cmake .. -DCLICK_MODE=1" exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/$BUILD_DIR && PATH=/usr/lib/ccache:$PATH make -j2" } build_click_package() { exec_with_ssh "cd $CODE_DIR/$BUILD_DIR/ && make install DESTDIR=install" exec_with_ssh click build $CODE_DIR/$BUILD_DIR/install scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P $TARGET_SSH_PORT $USER@$TARGET_IP:/home/phablet/com.ubuntu*$PACKAGE*.click . } run() { exec_with_ssh "cd $CODE_DIR/$BUILD_DIR/src/app/ && ./$BINARY --desktop_file_hint=/home/$USER/$CODE_DIR/$BUILD_DIR/com.ubuntu.reminders_reminders.desktop" } set -- `getopt -n$0 -u -a --longoptions="setup,gdb,click,help" "sgch" "$@"` # FIXME: giving incorrect arguments does not call usage and exit while [ $# -gt 0 ] do case "$1" in -s|--setup) SETUP=true;; -g|--gdb) GDB=true;; -c|--click) CLICK=true;; -h|--help) usage;; --) shift;break;; esac shift done adb_root [ "${TARGET_IP}" = "127.0.0.1" ] && setup_adb_forwarding echo "Transferring code.." sync_code if $SETUP; then echo "Setting up environment for building $PACKAGE..." install_ssh_key install_dependencies sync_code else echo "Building.." build if $CLICK; then echo "Building click package..." build_click_package else echo "Running.." run fi fi reminders-app-0.4+15.04.20141118/reminders.apparmor0000644000015301777760000000024412432702717022263 0ustar pbusernogroup00000000000000{ "policy_groups": [ "networking", "accounts", "content_exchange", "audio", "webview" ], "policy_version": 1.2 }reminders-app-0.4+15.04.20141118/.excludes0000644000015301777760000000000012432702717020333 0ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/0000755000015301777760000000000012432703240017662 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/0000755000015301777760000000000012432703240021702 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/0000755000015301777760000000000012432703240023202 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/Thrift.py0000644000015301777760000000775012432702717025035 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import sys class TType: STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STRING = 11 UTF7 = 11 STRUCT = 12 MAP = 13 SET = 14 LIST = 15 UTF8 = 16 UTF16 = 17 _VALUES_TO_NAMES = ('STOP', 'VOID', 'BOOL', 'BYTE', 'DOUBLE', None, 'I16', None, 'I32', None, 'I64', 'STRING', 'STRUCT', 'MAP', 'SET', 'LIST', 'UTF8', 'UTF16') class TMessageType: CALL = 1 REPLY = 2 EXCEPTION = 3 ONEWAY = 4 class TProcessor: """Base class for procsessor, which works on two streams.""" def process(iprot, oprot): pass class TException(Exception): """Base class for all thrift exceptions.""" # BaseException.message is deprecated in Python v[2.6,3.0) if (2, 6, 0) <= sys.version_info < (3, 0): def _get_message(self): return self._message def _set_message(self, message): self._message = message message = property(_get_message, _set_message) def __init__(self, message=None): Exception.__init__(self, message) self.message = message class TApplicationException(TException): """Application level thrift exceptions.""" UNKNOWN = 0 UNKNOWN_METHOD = 1 INVALID_MESSAGE_TYPE = 2 WRONG_METHOD_NAME = 3 BAD_SEQUENCE_ID = 4 MISSING_RESULT = 5 INTERNAL_ERROR = 6 PROTOCOL_ERROR = 7 def __init__(self, type=UNKNOWN, message=None): TException.__init__(self, message) self.type = type def __str__(self): if self.message: return self.message elif self.type == self.UNKNOWN_METHOD: return 'Unknown method' elif self.type == self.INVALID_MESSAGE_TYPE: return 'Invalid message type' elif self.type == self.WRONG_METHOD_NAME: return 'Wrong method name' elif self.type == self.BAD_SEQUENCE_ID: return 'Bad sequence ID' elif self.type == self.MISSING_RESULT: return 'Missing result' else: return 'Default (unknown) TApplicationException' def read(self, iprot): iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.message = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.type = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): oprot.writeStructBegin('TApplicationException') if self.message is not None: oprot.writeFieldBegin('message', TType.STRING, 1) oprot.writeString(self.message) oprot.writeFieldEnd() if self.type is not None: oprot.writeFieldBegin('type', TType.I32, 2) oprot.writeI32(self.type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/TSCons.py0000644000015301777760000000235612432702717024743 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from os import path from SCons.Builder import Builder def scons_env(env, add=''): opath = path.dirname(path.abspath('$TARGET')) lstr = 'thrift --gen cpp -o ' + opath + ' ' + add + ' $SOURCE' cppbuild = Builder(action=lstr) env.Append(BUILDERS={'ThriftCpp': cppbuild}) def gen_cpp(env, dir, file): scons_env(env) suffixes = ['_types.h', '_types.cpp'] targets = ['gen-cpp/' + file + s for s in suffixes] return env.ThriftCpp(targets, dir + file + '.thrift') reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/__init__.py0000644000015301777760000000146112432702717025325 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # __all__ = ['Thrift', 'TSCons'] reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/protocol/0000755000015301777760000000000012432703240025043 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/protocol/TBase.py0000644000015301777760000000512212432702717026423 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from thrift.Thrift import * from thrift.protocol import TBinaryProtocol from thrift.transport import TTransport try: from thrift.protocol import fastbinary except: fastbinary = None class TBase(object): __slots__ = [] def __repr__(self): L = ['%s=%r' % (key, getattr(self, key)) for key in self.__slots__] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): if not isinstance(other, self.__class__): return False for attr in self.__slots__: my_val = getattr(self, attr) other_val = getattr(other, attr) if my_val != other_val: return False return True def __ne__(self, other): return not (self == other) def read(self, iprot): if (iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None): fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStruct(self, self.thrift_spec) def write(self, oprot): if (oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None): oprot.trans.write( fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStruct(self, self.thrift_spec) class TExceptionBase(Exception): # old style class so python2.4 can raise exceptions derived from this # This can't inherit from TBase because of that limitation. __slots__ = [] __repr__ = TBase.__repr__.__func__ __eq__ = TBase.__eq__.__func__ __ne__ = TBase.__ne__.__func__ read = TBase.read.__func__ write = TBase.write.__func__ reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/protocol/__init__.py0000644000015301777760000000152412432702717027166 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # __all__ = ['TProtocol', 'TBinaryProtocol', 'fastbinary', 'TBase'] reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/protocol/TProtocol.py0000644000015301777760000002507112432702717027357 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from thrift.Thrift import * class TProtocolException(TException): """Custom Protocol Exception class""" UNKNOWN = 0 INVALID_DATA = 1 NEGATIVE_SIZE = 2 SIZE_LIMIT = 3 BAD_VERSION = 4 def __init__(self, type=UNKNOWN, message=None): TException.__init__(self, message) self.type = type class TProtocolBase: """Base class for Thrift protocol driver.""" def __init__(self, trans): self.trans = trans def writeMessageBegin(self, name, type, seqid): pass def writeMessageEnd(self): pass def writeStructBegin(self, name): pass def writeStructEnd(self): pass def writeFieldBegin(self, name, type, id): pass def writeFieldEnd(self): pass def writeFieldStop(self): pass def writeMapBegin(self, ktype, vtype, size): pass def writeMapEnd(self): pass def writeListBegin(self, etype, size): pass def writeListEnd(self): pass def writeSetBegin(self, etype, size): pass def writeSetEnd(self): pass def writeBool(self, bool): pass def writeByte(self, byte): pass def writeI16(self, i16): pass def writeI32(self, i32): pass def writeI64(self, i64): pass def writeDouble(self, dub): pass def writeString(self, str): pass def readMessageBegin(self): pass def readMessageEnd(self): pass def readStructBegin(self): pass def readStructEnd(self): pass def readFieldBegin(self): pass def readFieldEnd(self): pass def readMapBegin(self): pass def readMapEnd(self): pass def readListBegin(self): pass def readListEnd(self): pass def readSetBegin(self): pass def readSetEnd(self): pass def readBool(self): pass def readByte(self): pass def readI16(self): pass def readI32(self): pass def readI64(self): pass def readDouble(self): pass def readString(self): pass def skip(self, type): if type == TType.STOP: return elif type == TType.BOOL: self.readBool() elif type == TType.BYTE: self.readByte() elif type == TType.I16: self.readI16() elif type == TType.I32: self.readI32() elif type == TType.I64: self.readI64() elif type == TType.DOUBLE: self.readDouble() elif type == TType.STRING: self.readString() elif type == TType.STRUCT: name = self.readStructBegin() while True: (name, type, id) = self.readFieldBegin() if type == TType.STOP: break self.skip(type) self.readFieldEnd() self.readStructEnd() elif type == TType.MAP: (ktype, vtype, size) = self.readMapBegin() for i in range(size): self.skip(ktype) self.skip(vtype) self.readMapEnd() elif type == TType.SET: (etype, size) = self.readSetBegin() for i in range(size): self.skip(etype) self.readSetEnd() elif type == TType.LIST: (etype, size) = self.readListBegin() for i in range(size): self.skip(etype) self.readListEnd() # tuple of: ( 'reader method' name, is_container bool, 'writer_method' name ) _TTYPE_HANDLERS = ( (None, None, False), # 0 TType.STOP (None, None, False), # 1 TType.VOID # TODO: handle void? ('readBool', 'writeBool', False), # 2 TType.BOOL ('readByte', 'writeByte', False), # 3 TType.BYTE and I08 ('readDouble', 'writeDouble', False), # 4 TType.DOUBLE (None, None, False), # 5 undefined ('readI16', 'writeI16', False), # 6 TType.I16 (None, None, False), # 7 undefined ('readI32', 'writeI32', False), # 8 TType.I32 (None, None, False), # 9 undefined ('readI64', 'writeI64', False), # 10 TType.I64 ('readString', 'writeString', False), # 11 TType.STRING and UTF7 ('readContainerStruct', 'writeContainerStruct', True), # 12 *.STRUCT ('readContainerMap', 'writeContainerMap', True), # 13 TType.MAP ('readContainerSet', 'writeContainerSet', True), # 14 TType.SET ('readContainerList', 'writeContainerList', True), # 15 TType.LIST (None, None, False), # 16 TType.UTF8 # TODO: handle utf8 types? (None, None, False) # 17 TType.UTF16 # TODO: handle utf16 types? ) def readFieldByTType(self, ttype, spec): try: (r_handler, w_handler, is_container) = self._TTYPE_HANDLERS[ttype] except IndexError: raise TProtocolException(type=TProtocolException.INVALID_DATA, message='Invalid field type %d' % (ttype)) if r_handler is None: raise TProtocolException(type=TProtocolException.INVALID_DATA, message='Invalid field type %d' % (ttype)) reader = getattr(self, r_handler) if not is_container: return reader() return reader(spec) def readContainerList(self, spec): results = [] ttype, tspec = spec[0], spec[1] r_handler = self._TTYPE_HANDLERS[ttype][0] reader = getattr(self, r_handler) (list_type, list_len) = self.readListBegin() if tspec is None: # list values are simple types for idx in range(list_len): results.append(reader()) else: # this is like an inlined readFieldByTType container_reader = self._TTYPE_HANDLERS[list_type][0] val_reader = getattr(self, container_reader) for idx in range(list_len): val = val_reader(tspec) results.append(val) self.readListEnd() return results def readContainerSet(self, spec): results = set() ttype, tspec = spec[0], spec[1] r_handler = self._TTYPE_HANDLERS[ttype][0] reader = getattr(self, r_handler) (set_type, set_len) = self.readSetBegin() if tspec is None: # set members are simple types for idx in range(set_len): results.add(reader()) else: container_reader = self._TTYPE_HANDLERS[set_type][0] val_reader = getattr(self, container_reader) for idx in range(set_len): results.add(val_reader(tspec)) self.readSetEnd() return results def readContainerStruct(self, spec): (obj_class, obj_spec) = spec obj = obj_class() obj.read(self) return obj def readContainerMap(self, spec): results = dict() key_ttype, key_spec = spec[0], spec[1] val_ttype, val_spec = spec[2], spec[3] (map_ktype, map_vtype, map_len) = self.readMapBegin() # TODO: compare types we just decoded with thrift_spec and # abort/skip if types disagree key_reader = getattr(self, self._TTYPE_HANDLERS[key_ttype][0]) val_reader = getattr(self, self._TTYPE_HANDLERS[val_ttype][0]) # list values are simple types for idx in range(map_len): if key_spec is None: k_val = key_reader() else: k_val = self.readFieldByTType(key_ttype, key_spec) if val_spec is None: v_val = val_reader() else: v_val = self.readFieldByTType(val_ttype, val_spec) # this raises a TypeError with unhashable keys types # i.e. this fails: d=dict(); d[[0,1]] = 2 results[k_val] = v_val self.readMapEnd() return results def readStruct(self, obj, thrift_spec): self.readStructBegin() while True: (fname, ftype, fid) = self.readFieldBegin() if ftype == TType.STOP: break try: field = thrift_spec[fid] except IndexError: self.skip(ftype) else: if field is not None and ftype == field[1]: fname = field[2] fspec = field[3] val = self.readFieldByTType(ftype, fspec) setattr(obj, fname, val) else: self.skip(ftype) self.readFieldEnd() self.readStructEnd() def writeContainerStruct(self, val, spec): val.write(self) def writeContainerList(self, val, spec): self.writeListBegin(spec[0], len(val)) r_handler, w_handler, is_container = self._TTYPE_HANDLERS[spec[0]] e_writer = getattr(self, w_handler) if not is_container: for elem in val: e_writer(elem) else: for elem in val: e_writer(elem, spec[1]) self.writeListEnd() def writeContainerSet(self, val, spec): self.writeSetBegin(spec[0], len(val)) r_handler, w_handler, is_container = self._TTYPE_HANDLERS[spec[0]] e_writer = getattr(self, w_handler) if not is_container: for elem in val: e_writer(elem) else: for elem in val: e_writer(elem, spec[1]) self.writeSetEnd() def writeContainerMap(self, val, spec): k_type = spec[0] v_type = spec[2] ignore, ktype_name, k_is_container = self._TTYPE_HANDLERS[k_type] ignore, vtype_name, v_is_container = self._TTYPE_HANDLERS[v_type] k_writer = getattr(self, ktype_name) v_writer = getattr(self, vtype_name) self.writeMapBegin(k_type, v_type, len(val)) for m_key, m_val in val.items(): if not k_is_container: k_writer(m_key) else: k_writer(m_key, spec[1]) if not v_is_container: v_writer(m_val) else: v_writer(m_val, spec[3]) self.writeMapEnd() def writeStruct(self, obj, thrift_spec): self.writeStructBegin(obj.__class__.__name__) for field in thrift_spec: if field is None: continue fname = field[2] val = getattr(obj, fname) if val is None: # skip writing out unset fields continue fid = field[0] ftype = field[1] fspec = field[3] # get the writer method for this value self.writeFieldBegin(fname, ftype, fid) self.writeFieldByTType(ftype, val, fspec) self.writeFieldEnd() self.writeFieldStop() self.writeStructEnd() def writeFieldByTType(self, ttype, val, spec): r_handler, w_handler, is_container = self._TTYPE_HANDLERS[ttype] writer = getattr(self, w_handler) if is_container: writer(val, spec) else: writer(val) class TProtocolFactory: def getProtocol(self, trans): pass reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/protocol/TBinaryProtocol.py0000644000015301777760000001505112432702717030521 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from .TProtocol import * from struct import pack, unpack class TBinaryProtocol(TProtocolBase): """Binary implementation of the Thrift protocol driver.""" # NastyHaxx. Python 2.4+ on 32-bit machines forces hex constants to be # positive, converting this into a long. If we hardcode the int value # instead it'll stay in 32 bit-land. # VERSION_MASK = 0xffff0000 VERSION_MASK = -65536 # VERSION_1 = 0x80010000 VERSION_1 = -2147418112 TYPE_MASK = 0x000000ff def __init__(self, trans, strictRead=False, strictWrite=True): TProtocolBase.__init__(self, trans) self.strictRead = strictRead self.strictWrite = strictWrite def writeMessageBegin(self, name, type, seqid): if self.strictWrite: self.writeI32(TBinaryProtocol.VERSION_1 | type) self.writeString(name) self.writeI32(seqid) else: self.writeString(name) self.writeByte(type) self.writeI32(seqid) def writeMessageEnd(self): pass def writeStructBegin(self, name): pass def writeStructEnd(self): pass def writeFieldBegin(self, name, type, id): self.writeByte(type) self.writeI16(id) def writeFieldEnd(self): pass def writeFieldStop(self): self.writeByte(TType.STOP) def writeMapBegin(self, ktype, vtype, size): self.writeByte(ktype) self.writeByte(vtype) self.writeI32(size) def writeMapEnd(self): pass def writeListBegin(self, etype, size): self.writeByte(etype) self.writeI32(size) def writeListEnd(self): pass def writeSetBegin(self, etype, size): self.writeByte(etype) self.writeI32(size) def writeSetEnd(self): pass def writeBool(self, bool): if bool: self.writeByte(1) else: self.writeByte(0) def writeByte(self, byte): buff = pack("!b", byte) self.trans.write(buff) def writeI16(self, i16): buff = pack("!h", i16) self.trans.write(buff) def writeI32(self, i32): buff = pack("!i", i32) self.trans.write(buff) def writeI64(self, i64): buff = pack("!q", i64) self.trans.write(buff) def writeDouble(self, dub): buff = pack("!d", dub) self.trans.write(buff) def writeString(self, str): self.writeI32(len(str)) if type(str) == bytes: # The generators treat strings and byte arrays equally self.trans.write(str) else: self.trans.write(bytes(str, "UTF-8")) def readMessageBegin(self): sz = self.readI32() if sz < 0: version = sz & TBinaryProtocol.VERSION_MASK if version != TBinaryProtocol.VERSION_1: raise TProtocolException( type=TProtocolException.BAD_VERSION, message='Bad version in readMessageBegin: %d' % (sz)) type = sz & TBinaryProtocol.TYPE_MASK name = self.readString() seqid = self.readI32() else: if self.strictRead: raise TProtocolException(type=TProtocolException.BAD_VERSION, message='No protocol version header') name = self.trans.readAll(sz) type = self.readByte() seqid = self.readI32() return (name, type, seqid) def readMessageEnd(self): pass def readStructBegin(self): pass def readStructEnd(self): pass def readFieldBegin(self): type = self.readByte() if type == TType.STOP: return (None, type, 0) id = self.readI16() return (None, type, id) def readFieldEnd(self): pass def readMapBegin(self): ktype = self.readByte() vtype = self.readByte() size = self.readI32() return (ktype, vtype, size) def readMapEnd(self): pass def readListBegin(self): etype = self.readByte() size = self.readI32() return (etype, size) def readListEnd(self): pass def readSetBegin(self): etype = self.readByte() size = self.readI32() return (etype, size) def readSetEnd(self): pass def readBool(self): byte = self.readByte() if byte == 0: return False return True def readByte(self): buff = self.trans.readAll(1) val, = unpack('!b', buff) return val def readI16(self): buff = self.trans.readAll(2) val, = unpack('!h', buff) return val def readI32(self): buff = self.trans.readAll(4) val, = unpack('!i', buff) return val def readI64(self): buff = self.trans.readAll(8) val, = unpack('!q', buff) return val def readDouble(self): buff = self.trans.readAll(8) val, = unpack('!d', buff) return val def readString(self): len = self.readI32() str = self.trans.readAll(len) return str class TBinaryProtocolFactory: def __init__(self, strictRead=False, strictWrite=True): self.strictRead = strictRead self.strictWrite = strictWrite def getProtocol(self, trans): prot = TBinaryProtocol(trans, self.strictRead, self.strictWrite) return prot class TBinaryProtocolAccelerated(TBinaryProtocol): """C-Accelerated version of TBinaryProtocol. This class does not override any of TBinaryProtocol's methods, but the generated code recognizes it directly and will call into our C module to do the encoding, bypassing this object entirely. We inherit from TBinaryProtocol so that the normal TBinaryProtocol encoding can happen if the fastbinary module doesn't work for some reason. (TODO(dreiss): Make this happen sanely in more cases.) In order to take advantage of the C module, just use TBinaryProtocolAccelerated instead of TBinaryProtocol. NOTE: This code was contributed by an external developer. The internal Thrift team has reviewed and tested it, but we cannot guarantee that it is production-ready. Please feel free to report bugs and/or success stories to the public mailing list. """ pass class TBinaryProtocolAcceleratedFactory: def getProtocol(self, trans): return TBinaryProtocolAccelerated(trans) reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/transport/0000755000015301777760000000000012432703240025236 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/transport/THttpClient.py0000644000015301777760000001036712432702717030031 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import http.client import os import socket import sys import urllib.parse import warnings from io import BytesIO from .TTransport import * class THttpClient(TTransportBase): """Http implementation of TTransport base.""" def __init__(self, uri_or_host, port=None, path=None): """THttpClient supports two different types constructor parameters. THttpClient(host, port, path) - deprecated THttpClient(uri) Only the second supports https. """ if port is not None: warnings.warn( "Please use the THttpClient('http://host:port/path') syntax", DeprecationWarning, stacklevel=2) self.host = uri_or_host self.port = port assert path self.path = path self.scheme = 'http' else: parsed = urllib.parse.urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or http.client.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or http.client.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__wbuf = BytesIO() self.__http = None self.__timeout = None self.__custom_headers = None def open(self): if self.scheme == 'http': self.__http = http.client.HTTPConnection(self.host, self.port) else: self.__http = http.client.HTTPSConnection(self.host, self.port) def close(self): self.__http.close() self.__http = None def isOpen(self): return self.__http is not None def setTimeout(self, ms): if not hasattr(socket, 'getdefaulttimeout'): raise NotImplementedError if ms is None: self.__timeout = None else: self.__timeout = ms / 1000.0 def setCustomHeaders(self, headers): self.__custom_headers = headers def read(self, sz): return self.response.read(sz) def readAll(self, sz): return self.read(sz) def write(self, buf): self.__wbuf.write(buf) def __withTimeout(f): def _f(*args, **kwargs): orig_timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(args[0].__timeout) result = f(*args, **kwargs) socket.setdefaulttimeout(orig_timeout) return result return _f def flush(self): if self.isOpen(): self.close() self.open() # Pull data out of buffer data = self.__wbuf.getvalue() self.__wbuf = BytesIO() # HTTP request self.__http.putrequest('POST', self.path) # Write headers self.__http.putheader('Host', self.host) self.__http.putheader('Content-Type', 'application/x-thrift') self.__http.putheader('Content-Length', str(len(data))) if not self.__custom_headers or 'User-Agent' not in self.__custom_headers: user_agent = 'Python/THttpClient' script = os.path.basename(sys.argv[0]) if script: user_agent = '%s (%s)' % (user_agent, urllib.parse.quote(script)) self.__http.putheader('User-Agent', user_agent) if self.__custom_headers: for key, val in self.__custom_headers.items(): self.__http.putheader(key, val) self.__http.endheaders() # Write payload self.__http.send(data) # Get reply to flush the request self.response = self.__http.getresponse() #self.code, self.message, self.headers = self.__http.getreply() # Decorate if we know how to timeout if hasattr(socket, 'getdefaulttimeout'): flush = __withTimeout(flush) reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/transport/__init__.py0000644000015301777760000000152712432702717027364 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # __all__ = ['TTransport', 'TSocket', 'THttpClient', 'TZlibTransport'] reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/transport/TTwisted.py0000644000015301777760000001461312432702717027374 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from io import StringIO from zope.interface import implements, Interface, Attribute from twisted.internet.protocol import Protocol, ServerFactory, ClientFactory, \ connectionDone from twisted.internet import defer from twisted.protocols import basic from twisted.python import log from twisted.web import server, resource, http from thrift.transport import TTransport class TMessageSenderTransport(TTransport.TTransportBase): def __init__(self): self.__wbuf = StringIO() def write(self, buf): self.__wbuf.write(buf) def flush(self): msg = self.__wbuf.getvalue() self.__wbuf = StringIO() self.sendMessage(msg) def sendMessage(self, message): raise NotImplementedError class TCallbackTransport(TMessageSenderTransport): def __init__(self, func): TMessageSenderTransport.__init__(self) self.func = func def sendMessage(self, message): self.func(message) class ThriftClientProtocol(basic.Int32StringReceiver): MAX_LENGTH = 2 ** 31 - 1 def __init__(self, client_class, iprot_factory, oprot_factory=None): self._client_class = client_class self._iprot_factory = iprot_factory if oprot_factory is None: self._oprot_factory = iprot_factory else: self._oprot_factory = oprot_factory self.recv_map = {} self.started = defer.Deferred() def dispatch(self, msg): self.sendString(msg) def connectionMade(self): tmo = TCallbackTransport(self.dispatch) self.client = self._client_class(tmo, self._oprot_factory) self.started.callback(self.client) def connectionLost(self, reason=connectionDone): for k, v in self.client._reqs.items(): tex = TTransport.TTransportException( type=TTransport.TTransportException.END_OF_FILE, message='Connection closed') v.errback(tex) def stringReceived(self, frame): tr = TTransport.TMemoryBuffer(frame) iprot = self._iprot_factory.getProtocol(tr) (fname, mtype, rseqid) = iprot.readMessageBegin() try: method = self.recv_map[fname] except KeyError: method = getattr(self.client, 'recv_' + fname) self.recv_map[fname] = method method(iprot, mtype, rseqid) class ThriftServerProtocol(basic.Int32StringReceiver): MAX_LENGTH = 2 ** 31 - 1 def dispatch(self, msg): self.sendString(msg) def processError(self, error): self.transport.loseConnection() def processOk(self, _, tmo): msg = tmo.getvalue() if len(msg) > 0: self.dispatch(msg) def stringReceived(self, frame): tmi = TTransport.TMemoryBuffer(frame) tmo = TTransport.TMemoryBuffer() iprot = self.factory.iprot_factory.getProtocol(tmi) oprot = self.factory.oprot_factory.getProtocol(tmo) d = self.factory.processor.process(iprot, oprot) d.addCallbacks(self.processOk, self.processError, callbackArgs=(tmo,)) class IThriftServerFactory(Interface): processor = Attribute("Thrift processor") iprot_factory = Attribute("Input protocol factory") oprot_factory = Attribute("Output protocol factory") class IThriftClientFactory(Interface): client_class = Attribute("Thrift client class") iprot_factory = Attribute("Input protocol factory") oprot_factory = Attribute("Output protocol factory") class ThriftServerFactory(ServerFactory): implements(IThriftServerFactory) protocol = ThriftServerProtocol def __init__(self, processor, iprot_factory, oprot_factory=None): self.processor = processor self.iprot_factory = iprot_factory if oprot_factory is None: self.oprot_factory = iprot_factory else: self.oprot_factory = oprot_factory class ThriftClientFactory(ClientFactory): implements(IThriftClientFactory) protocol = ThriftClientProtocol def __init__(self, client_class, iprot_factory, oprot_factory=None): self.client_class = client_class self.iprot_factory = iprot_factory if oprot_factory is None: self.oprot_factory = iprot_factory else: self.oprot_factory = oprot_factory def buildProtocol(self, addr): p = self.protocol(self.client_class, self.iprot_factory, self.oprot_factory) p.factory = self return p class ThriftResource(resource.Resource): allowedMethods = ('POST',) def __init__(self, processor, inputProtocolFactory, outputProtocolFactory=None): resource.Resource.__init__(self) self.inputProtocolFactory = inputProtocolFactory if outputProtocolFactory is None: self.outputProtocolFactory = inputProtocolFactory else: self.outputProtocolFactory = outputProtocolFactory self.processor = processor def getChild(self, path, request): return self def _cbProcess(self, _, request, tmo): msg = tmo.getvalue() request.setResponseCode(http.OK) request.setHeader("content-type", "application/x-thrift") request.write(msg) request.finish() def render_POST(self, request): request.content.seek(0, 0) data = request.content.read() tmi = TTransport.TMemoryBuffer(data) tmo = TTransport.TMemoryBuffer() iprot = self.inputProtocolFactory.getProtocol(tmi) oprot = self.outputProtocolFactory.getProtocol(tmo) d = self.processor.process(iprot, oprot) d.addCallback(self._cbProcess, request, tmo) return server.NOT_DONE_YET reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/transport/TTransport.py0000644000015301777760000002027212432702717027743 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from io import StringIO from struct import pack, unpack from thrift.Thrift import TException class TTransportException(TException): """Custom Transport Exception class""" UNKNOWN = 0 NOT_OPEN = 1 ALREADY_OPEN = 2 TIMED_OUT = 3 END_OF_FILE = 4 def __init__(self, type=UNKNOWN, message=None): TException.__init__(self, message) self.type = type class TTransportBase: """Base class for Thrift transport layer.""" def isOpen(self): pass def open(self): pass def close(self): pass def read(self, sz): pass def readAll(self, sz): buff = '' have = 0 while (have < sz): chunk = self.read(sz - have) have += len(chunk) buff += chunk if len(chunk) == 0: raise EOFError() return buff def write(self, buf): pass def flush(self): pass # This class should be thought of as an interface. class CReadableTransport: """base class for transports that are readable from C""" # TODO(dreiss): Think about changing this interface to allow us to use # a (Python, not c) StringIO instead, because it allows # you to write after reading. # NOTE: This is a classic class, so properties will NOT work # correctly for setting. @property def cstringio_buf(self): """A cStringIO buffer that contains the current chunk we are reading.""" pass def cstringio_refill(self, partialread, reqlen): """Refills cstringio_buf. Returns the currently used buffer (which can but need not be the same as the old cstringio_buf). partialread is what the C code has read from the buffer, and should be inserted into the buffer before any more reads. The return value must be a new, not borrowed reference. Something along the lines of self._buf should be fine. If reqlen bytes can't be read, throw EOFError. """ pass class TServerTransportBase: """Base class for Thrift server transports.""" def listen(self): pass def accept(self): pass def close(self): pass class TTransportFactoryBase: """Base class for a Transport Factory""" def getTransport(self, trans): return trans class TBufferedTransportFactory: """Factory transport that builds buffered transports""" def getTransport(self, trans): buffered = TBufferedTransport(trans) return buffered class TBufferedTransport(TTransportBase, CReadableTransport): """Class that wraps another transport and buffers its I/O. The implementation uses a (configurable) fixed-size read buffer but buffers all writes until a flush is performed. """ DEFAULT_BUFFER = 4096 def __init__(self, trans, rbuf_size=DEFAULT_BUFFER): self.__trans = trans self.__wbuf = StringIO() self.__rbuf = StringIO("") self.__rbuf_size = rbuf_size def isOpen(self): return self.__trans.isOpen() def open(self): return self.__trans.open() def close(self): return self.__trans.close() def read(self, sz): ret = self.__rbuf.read(sz) if len(ret) != 0: return ret self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size))) return self.__rbuf.read(sz) def write(self, buf): self.__wbuf.write(buf) def flush(self): out = self.__wbuf.getvalue() # reset wbuf before write/flush to preserve state on underlying failure self.__wbuf = StringIO() self.__trans.write(out) self.__trans.flush() # Implement the CReadableTransport interface. @property def cstringio_buf(self): return self.__rbuf def cstringio_refill(self, partialread, reqlen): retstring = partialread if reqlen < self.__rbuf_size: # try to make a read of as much as we can. retstring += self.__trans.read(self.__rbuf_size) # but make sure we do read reqlen bytes. if len(retstring) < reqlen: retstring += self.__trans.readAll(reqlen - len(retstring)) self.__rbuf = StringIO(retstring) return self.__rbuf class TMemoryBuffer(TTransportBase, CReadableTransport): """Wraps a cStringIO object as a TTransport. NOTE: Unlike the C++ version of this class, you cannot write to it then immediately read from it. If you want to read from a TMemoryBuffer, you must either pass a string to the constructor. TODO(dreiss): Make this work like the C++ version. """ def __init__(self, value=None): """value -- a value to read from for stringio If value is set, this will be a transport for reading, otherwise, it is for writing""" if value is not None: self._buffer = StringIO(value) else: self._buffer = StringIO() def isOpen(self): return not self._buffer.closed def open(self): pass def close(self): self._buffer.close() def read(self, sz): return self._buffer.read(sz) def write(self, buf): self._buffer.write(buf) def flush(self): pass def getvalue(self): return self._buffer.getvalue() # Implement the CReadableTransport interface. @property def cstringio_buf(self): return self._buffer def cstringio_refill(self, partialread, reqlen): # only one shot at reading... raise EOFError() class TFramedTransportFactory: """Factory transport that builds framed transports""" def getTransport(self, trans): framed = TFramedTransport(trans) return framed class TFramedTransport(TTransportBase, CReadableTransport): """Class that wraps another transport and frames its I/O when writing.""" def __init__(self, trans,): self.__trans = trans self.__rbuf = StringIO() self.__wbuf = StringIO() def isOpen(self): return self.__trans.isOpen() def open(self): return self.__trans.open() def close(self): return self.__trans.close() def read(self, sz): ret = self.__rbuf.read(sz) if len(ret) != 0: return ret self.readFrame() return self.__rbuf.read(sz) def readFrame(self): buff = self.__trans.readAll(4) sz, = unpack('!i', buff) self.__rbuf = StringIO(self.__trans.readAll(sz)) def write(self, buf): self.__wbuf.write(buf) def flush(self): wout = self.__wbuf.getvalue() wsz = len(wout) # reset wbuf before write/flush to preserve state on underlying failure self.__wbuf = StringIO() # N.B.: Doing this string concatenation is WAY cheaper than making # two separate calls to the underlying socket object. Socket writes in # Python turn out to be REALLY expensive, but it seems to do a pretty # good job of managing string buffer operations without excessive copies buf = pack("!i", wsz) + wout self.__trans.write(buf) self.__trans.flush() # Implement the CReadableTransport interface. @property def cstringio_buf(self): return self.__rbuf def cstringio_refill(self, prefix, reqlen): # self.__rbuf will already be empty here because fastbinary doesn't # ask for a refill until the previous buffer is empty. Therefore, # we can start reading new frames immediately. while len(prefix) < reqlen: self.readFrame() prefix += self.__rbuf.getvalue() self.__rbuf = StringIO(prefix) return self.__rbuf class TFileObjectTransport(TTransportBase): """Wraps a file-like object to make it work as a Thrift transport.""" def __init__(self, fileobj): self.fileobj = fileobj def isOpen(self): return True def close(self): self.fileobj.close() def read(self, sz): return self.fileobj.read(sz) def write(self, buf): self.fileobj.write(buf) def flush(self): self.fileobj.flush() reminders-app-0.4+15.04.20141118/tests/autopilot/thrift/TSerialization.py0000644000015301777760000000255512432702717026534 0ustar pbusernogroup00000000000000# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from .protocol import TBinaryProtocol from .transport import TTransport def serialize(thrift_object, protocol_factory=TBinaryProtocol.TBinaryProtocolFactory()): transport = TTransport.TMemoryBuffer() protocol = protocol_factory.getProtocol(transport) thrift_object.write(protocol) return transport.getvalue() def deserialize(base, buf, protocol_factory=TBinaryProtocol.TBinaryProtocolFactory()): transport = TTransport.TMemoryBuffer(buf) protocol = protocol_factory.getProtocol(transport) base.read(protocol) return base reminders-app-0.4+15.04.20141118/tests/autopilot/run0000755000015301777760000000025712432702717022450 0ustar pbusernogroup00000000000000#!/bin/bash if [[ -z `which autopilot` ]]; then echo "Autopilot is not installed. Skip" exit fi SCRIPTPATH=`dirname $0` pushd ${SCRIPTPATH} autopilot run reminders popd reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/0000755000015301777760000000000012432703240023531 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/__init__.py0000644000015301777760000000000012432702717025640 0ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/api/0000755000015301777760000000000012432703240024302 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/api/__init__.py0000644000015301777760000000000112432702717026412 0ustar pbusernogroup00000000000000 reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/api/client.py0000644000015301777760000001354712432702717026154 0ustar pbusernogroup00000000000000import sys import functools import inspect import re from requests_oauthlib import OAuth1Session import urllib.error import urllib.parse import urllib.request import evernote.edam.userstore.UserStore as UserStore import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.userstore.constants as UserStoreConstants import thrift.protocol.TBinaryProtocol as TBinaryProtocol import thrift.transport.THttpClient as THttpClient class EvernoteClient(object): def __init__(self, **options): self.consumer_key = options.get('consumer_key') self.consumer_secret = options.get('consumer_secret') self.sandbox = options.get('sandbox', True) if self.sandbox: default_service_host = 'sandbox.evernote.com' else: default_service_host = 'www.evernote.com' self.service_host = options.get('service_host', default_service_host) self.additional_headers = options.get('additional_headers', {}) self.token = options.get('token') self.secret = options.get('secret') def get_request_token(self, callback_url): client = OAuth1Session(client_key=self.consumer_key, client_secret=self.consumer_secret) request_url = '%s?oauth_callback=%s' % ( self._get_endpoint('oauth'), urllib.parse.quote_plus(callback_url)) request_token = client.fetch_request_token(request_url) return request_token def get_authorize_url(self, request_token): return '%s?oauth_token=%s' % ( self._get_endpoint('OAuth.action'), urllib.parse.quote(request_token['oauth_token'])) def get_access_token( self, oauth_token, oauth_token_secret, oauth_verifier ): client = OAuth1Session(client_key=self.consumer_key, client_secret=self.consumer_secret, resource_owner_key=oauth_token, resource_owner_secret=oauth_token_secret, verifier=oauth_verifier) access_token_url = self._get_endpoint('oauth') access_token = client.fetch_access_token(access_token_url) self.token = access_token['oauth_token'] return self.token def get_user_store(self): user_store_uri = self._get_endpoint("/edam/user") store = Store(self.token, UserStore.Client, user_store_uri) if not store: # Trick for PyDev code completion store = UserStore.Client() raise Exception('Should never reach here') return store def get_note_store(self): user_store = self.get_user_store() note_store_uri = user_store.getNoteStoreUrl() store = Store(self.token, NoteStore.Client, note_store_uri) if not store: # Trick for PyDev code completion store = NoteStore.Client() raise Exception('Should never reach here') return store def get_shared_note_store(self, linkedNotebook): note_store_uri = linkedNotebook.noteStoreUrl note_store = Store(self.token, NoteStore.Client, note_store_uri) shared_auth = note_store.authenticateToSharedNotebook( linkedNotebook.shareKey) shared_token = shared_auth.authenticationToken store = Store(shared_token, NoteStore.Client, note_store_uri) if not store: # Trick for PyDev code completion store = NoteStore.Client() raise Exception('Should never reach here') return store def get_business_note_store(self): user_store = self.get_user_store() biz_auth = user_store.authenticateToBusiness() biz_token = biz_auth.authenticationToken note_store_uri = biz_auth.noteStoreUrl store = Store(biz_token, NoteStore.Client, note_store_uri) if not store: # Trick for PyDev code completion store = NoteStore.Client() raise Exception('Should never reach here') return store def _get_endpoint(self, path=None): url = "https://%s" % (self.service_host) if path is not None: url += "/%s" % path return url class Store(object): def __init__(self, token, client_class, store_url): self.token = token m = re.search(':A=(.+):', token) if m: self._user_agent_id = m.groups()[0] else: self._user_agent_id = '' self._client = self._get_thrift_client(client_class, store_url) def __getattr__(self, name): def delegate_method(*args, **kwargs): targetMethod = getattr(self._client, name, None) if targetMethod is None: return object.__getattribute__(self, name)(*args, **kwargs) org_args = inspect.getargspec(targetMethod).args if len(org_args) == len(args) + 1: return targetMethod(*args, **kwargs) elif 'authenticationToken' in org_args: skip_args = ['self', 'authenticationToken'] arg_names = [i for i in org_args if i not in skip_args] return functools.partial( targetMethod, authenticationToken=self.token )(**dict(list(zip(arg_names, args)))) else: return targetMethod(*args, **kwargs) return delegate_method def _get_thrift_client(self, client_class, url): http_client = THttpClient.THttpClient(url) http_client.setCustomHeaders({ 'User-Agent': "%s / %s; Python / %s;" % ( self._user_agent_id, self._get_sdk_version(), sys.version) }) thrift_protocol = TBinaryProtocol.TBinaryProtocol(http_client) return client_class(thrift_protocol) def _get_sdk_version(self): return '%s.%s' % ( UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR ) reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/0000755000015301777760000000000012432703240024437 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/userstore/0000755000015301777760000000000012432703240026472 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/userstore/ttypes.py0000644000015301777760000007534612432702717030423 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import evernote.edam.type.ttypes import evernote.edam.error.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class PublicUserInfo(object): """ This structure is used to provide publicly-available user information about a particular account.
userId:
The unique numeric user identifier for the user account.
shardId:
DEPRECATED - Client applications should have no need to use this field.
privilege:
The privilege level of the account, to determine whether this is a Premium or Free account.
noteStoreUrl:
This field will contain the full URL that clients should use to make NoteStore requests to the server shard that contains that user's data. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the NoteStore service for the account.
webApiUrlPrefix:
This field will contain the initial part of the URLs that should be used to make requests to Evernote's thin client "web API", which provide optimized operations for clients that aren't capable of manipulating the full contents of accounts via the full Thrift data model. Clients should concatenate the relative path for the various servlets onto the end of this string to construct the full URL, as documented on our developer web site.
Attributes: - userId - shardId - privilege - username - noteStoreUrl - webApiUrlPrefix """ thrift_spec = ( None, # 0 (1, TType.I32, 'userId', None, None, ), # 1 (2, TType.STRING, 'shardId', None, None, ), # 2 (3, TType.I32, 'privilege', None, None, ), # 3 (4, TType.STRING, 'username', None, None, ), # 4 (5, TType.STRING, 'noteStoreUrl', None, None, ), # 5 (6, TType.STRING, 'webApiUrlPrefix', None, None, ), # 6 ) def __init__(self, userId=None, shardId=None, privilege=None, username=None, noteStoreUrl=None, webApiUrlPrefix=None,): self.userId = userId self.shardId = shardId self.privilege = privilege self.username = username self.noteStoreUrl = noteStoreUrl self.webApiUrlPrefix = webApiUrlPrefix def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.userId = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.shardId = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.privilege = iprot.readI32(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.username = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.noteStoreUrl = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.webApiUrlPrefix = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('PublicUserInfo') if self.userId is not None: oprot.writeFieldBegin('userId', TType.I32, 1) oprot.writeI32(self.userId) oprot.writeFieldEnd() if self.shardId is not None: oprot.writeFieldBegin('shardId', TType.STRING, 2) oprot.writeString(self.shardId.encode('utf-8')) oprot.writeFieldEnd() if self.privilege is not None: oprot.writeFieldBegin('privilege', TType.I32, 3) oprot.writeI32(self.privilege) oprot.writeFieldEnd() if self.username is not None: oprot.writeFieldBegin('username', TType.STRING, 4) oprot.writeString(self.username.encode('utf-8')) oprot.writeFieldEnd() if self.noteStoreUrl is not None: oprot.writeFieldBegin('noteStoreUrl', TType.STRING, 5) oprot.writeString(self.noteStoreUrl.encode('utf-8')) oprot.writeFieldEnd() if self.webApiUrlPrefix is not None: oprot.writeFieldBegin('webApiUrlPrefix', TType.STRING, 6) oprot.writeString(self.webApiUrlPrefix.encode('utf-8')) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.userId is None: raise TProtocol.TProtocolException(message='Required field userId is unset!') if self.shardId is None: raise TProtocol.TProtocolException(message='Required field shardId is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class AuthenticationResult(object): """ When an authentication (or re-authentication) is performed, this structure provides the result to the client.
currentTime:
The server-side date and time when this result was generated.
authenticationToken:
Holds an opaque, ASCII-encoded token that can be used by the client to perform actions on a NoteStore.
expiration:
Holds the server-side date and time when the authentication token will expire. This time can be compared to "currentTime" to produce an expiration time that can be reconciled with the client's local clock.
user:
Holds the information about the account which was authenticated if this was a full authentication. May be absent if this particular authentication did not require user information.
publicUserInfo:
If this authentication result was achieved without full permissions to access the full User structure, this field may be set to give back a more limited public set of data.
noteStoreUrl:
This field will contain the full URL that clients should use to make NoteStore requests to the server shard that contains that user's data. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the NoteStore service for the account.
webApiUrlPrefix:
This field will contain the initial part of the URLs that should be used to make requests to Evernote's thin client "web API", which provide optimized operations for clients that aren't capable of manipulating the full contents of accounts via the full Thrift data model. Clients should concatenate the relative path for the various servlets onto the end of this string to construct the full URL, as documented on our developer web site.
secondFactorRequired:
If set to true, this field indicates that the user has enabled two-factor authentication and must enter their second factor in order to complete authentication. In this case the value of authenticationResult will be a short-lived authentication token that may only be used to make a subsequent call to completeTwoFactorAuthentication.
secondFactorDeliveryHint:
When secondFactorRequired is set to true, this field may contain a string describing the second factor delivery method that the user has configured. This will typically be an obfuscated mobile device number, such as "(xxx) xxx-x095". This string can be displayed to the user to remind them how to obtain the required second factor. TODO do we need to differentiate between SMS and voice delivery?
Attributes: - currentTime - authenticationToken - expiration - user - publicUserInfo - noteStoreUrl - webApiUrlPrefix - secondFactorRequired - secondFactorDeliveryHint """ thrift_spec = ( None, # 0 (1, TType.I64, 'currentTime', None, None, ), # 1 (2, TType.STRING, 'authenticationToken', None, None, ), # 2 (3, TType.I64, 'expiration', None, None, ), # 3 (4, TType.STRUCT, 'user', (evernote.edam.type.ttypes.User, evernote.edam.type.ttypes.User.thrift_spec), None, ), # 4 (5, TType.STRUCT, 'publicUserInfo', (PublicUserInfo, PublicUserInfo.thrift_spec), None, ), # 5 (6, TType.STRING, 'noteStoreUrl', None, None, ), # 6 (7, TType.STRING, 'webApiUrlPrefix', None, None, ), # 7 (8, TType.BOOL, 'secondFactorRequired', None, None, ), # 8 (9, TType.STRING, 'secondFactorDeliveryHint', None, None, ), # 9 ) def __init__(self, currentTime=None, authenticationToken=None, expiration=None, user=None, publicUserInfo=None, noteStoreUrl=None, webApiUrlPrefix=None, secondFactorRequired=None, secondFactorDeliveryHint=None,): self.currentTime = currentTime self.authenticationToken = authenticationToken self.expiration = expiration self.user = user self.publicUserInfo = publicUserInfo self.noteStoreUrl = noteStoreUrl self.webApiUrlPrefix = webApiUrlPrefix self.secondFactorRequired = secondFactorRequired self.secondFactorDeliveryHint = secondFactorDeliveryHint def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.currentTime = iprot.readI64(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.expiration = iprot.readI64(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.user = evernote.edam.type.ttypes.User() self.user.read(iprot) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.publicUserInfo = PublicUserInfo() self.publicUserInfo.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.noteStoreUrl = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.webApiUrlPrefix = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 8: if ftype == TType.BOOL: self.secondFactorRequired = iprot.readBool(); else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: self.secondFactorDeliveryHint = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('AuthenticationResult') if self.currentTime is not None: oprot.writeFieldBegin('currentTime', TType.I64, 1) oprot.writeI64(self.currentTime) oprot.writeFieldEnd() if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 2) oprot.writeString(self.authenticationToken.encode('utf-8')) oprot.writeFieldEnd() if self.expiration is not None: oprot.writeFieldBegin('expiration', TType.I64, 3) oprot.writeI64(self.expiration) oprot.writeFieldEnd() if self.user is not None: oprot.writeFieldBegin('user', TType.STRUCT, 4) self.user.write(oprot) oprot.writeFieldEnd() if self.publicUserInfo is not None: oprot.writeFieldBegin('publicUserInfo', TType.STRUCT, 5) self.publicUserInfo.write(oprot) oprot.writeFieldEnd() if self.noteStoreUrl is not None: oprot.writeFieldBegin('noteStoreUrl', TType.STRING, 6) oprot.writeString(self.noteStoreUrl.encode('utf-8')) oprot.writeFieldEnd() if self.webApiUrlPrefix is not None: oprot.writeFieldBegin('webApiUrlPrefix', TType.STRING, 7) oprot.writeString(self.webApiUrlPrefix.encode('utf-8')) oprot.writeFieldEnd() if self.secondFactorRequired is not None: oprot.writeFieldBegin('secondFactorRequired', TType.BOOL, 8) oprot.writeBool(self.secondFactorRequired) oprot.writeFieldEnd() if self.secondFactorDeliveryHint is not None: oprot.writeFieldBegin('secondFactorDeliveryHint', TType.STRING, 9) oprot.writeString(self.secondFactorDeliveryHint.encode('utf-8')) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.currentTime is None: raise TProtocol.TProtocolException(message='Required field currentTime is unset!') if self.authenticationToken is None: raise TProtocol.TProtocolException(message='Required field authenticationToken is unset!') if self.expiration is None: raise TProtocol.TProtocolException(message='Required field expiration is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BootstrapSettings(object): """ This structure describes a collection of bootstrap settings.
serviceHost:
The hostname and optional port for composing Evernote web service URLs. This URL can be used to access the UserStore and related services, but must not be used to compose the NoteStore URL. Client applications must handle serviceHost values that include only the hostname (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080). If no port is specified, or if port 443 is specified, client applications must use the scheme "https" when composing URLs. Otherwise, a client must use the scheme "http".
marketingUrl:
The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com. This stem can be used to compose website URLs. For example, the URL of the Evernote Trunk is composed by appending "/about/trunk/" to the value of marketingUrl.
supportUrl:
The full URL for the Evernote customer support website, e.g. https://support.evernote.com.
accountEmailDomain:
The domain used for an Evernote user's incoming email address, which allows notes to be emailed into an account. E.g. m.evernote.com.
enableFacebookSharing:
Whether the client application should enable sharing of notes on Facebook.
enableGiftSubscriptions:
Whether the client application should enable gift subscriptions.
enableSupportTickets:
Whether the client application should enable in-client creation of support tickets.
enableSharedNotebooks:
Whether the client application should enable shared notebooks.
enableSingleNoteSharing:
Whether the client application should enable single note sharing.
enableSponsoredAccounts:
Whether the client application should enable sponsored accounts.
enableTwitterSharing:
Whether the client application should enable sharing of notes on Twitter.
Attributes: - serviceHost - marketingUrl - supportUrl - accountEmailDomain - enableFacebookSharing - enableGiftSubscriptions - enableSupportTickets - enableSharedNotebooks - enableSingleNoteSharing - enableSponsoredAccounts - enableTwitterSharing - enableLinkedInSharing - enablePublicNotebooks """ thrift_spec = ( None, # 0 (1, TType.STRING, 'serviceHost', None, None, ), # 1 (2, TType.STRING, 'marketingUrl', None, None, ), # 2 (3, TType.STRING, 'supportUrl', None, None, ), # 3 (4, TType.STRING, 'accountEmailDomain', None, None, ), # 4 (5, TType.BOOL, 'enableFacebookSharing', None, None, ), # 5 (6, TType.BOOL, 'enableGiftSubscriptions', None, None, ), # 6 (7, TType.BOOL, 'enableSupportTickets', None, None, ), # 7 (8, TType.BOOL, 'enableSharedNotebooks', None, None, ), # 8 (9, TType.BOOL, 'enableSingleNoteSharing', None, None, ), # 9 (10, TType.BOOL, 'enableSponsoredAccounts', None, None, ), # 10 (11, TType.BOOL, 'enableTwitterSharing', None, None, ), # 11 (12, TType.BOOL, 'enableLinkedInSharing', None, None, ), # 12 (13, TType.BOOL, 'enablePublicNotebooks', None, None, ), # 13 ) def __init__(self, serviceHost=None, marketingUrl=None, supportUrl=None, accountEmailDomain=None, enableFacebookSharing=None, enableGiftSubscriptions=None, enableSupportTickets=None, enableSharedNotebooks=None, enableSingleNoteSharing=None, enableSponsoredAccounts=None, enableTwitterSharing=None, enableLinkedInSharing=None, enablePublicNotebooks=None,): self.serviceHost = serviceHost self.marketingUrl = marketingUrl self.supportUrl = supportUrl self.accountEmailDomain = accountEmailDomain self.enableFacebookSharing = enableFacebookSharing self.enableGiftSubscriptions = enableGiftSubscriptions self.enableSupportTickets = enableSupportTickets self.enableSharedNotebooks = enableSharedNotebooks self.enableSingleNoteSharing = enableSingleNoteSharing self.enableSponsoredAccounts = enableSponsoredAccounts self.enableTwitterSharing = enableTwitterSharing self.enableLinkedInSharing = enableLinkedInSharing self.enablePublicNotebooks = enablePublicNotebooks def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.serviceHost = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.marketingUrl = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.supportUrl = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.accountEmailDomain = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.enableFacebookSharing = iprot.readBool(); else: iprot.skip(ftype) elif fid == 6: if ftype == TType.BOOL: self.enableGiftSubscriptions = iprot.readBool(); else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: self.enableSupportTickets = iprot.readBool(); else: iprot.skip(ftype) elif fid == 8: if ftype == TType.BOOL: self.enableSharedNotebooks = iprot.readBool(); else: iprot.skip(ftype) elif fid == 9: if ftype == TType.BOOL: self.enableSingleNoteSharing = iprot.readBool(); else: iprot.skip(ftype) elif fid == 10: if ftype == TType.BOOL: self.enableSponsoredAccounts = iprot.readBool(); else: iprot.skip(ftype) elif fid == 11: if ftype == TType.BOOL: self.enableTwitterSharing = iprot.readBool(); else: iprot.skip(ftype) elif fid == 12: if ftype == TType.BOOL: self.enableLinkedInSharing = iprot.readBool(); else: iprot.skip(ftype) elif fid == 13: if ftype == TType.BOOL: self.enablePublicNotebooks = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('BootstrapSettings') if self.serviceHost is not None: oprot.writeFieldBegin('serviceHost', TType.STRING, 1) oprot.writeString(self.serviceHost.encode('utf-8')) oprot.writeFieldEnd() if self.marketingUrl is not None: oprot.writeFieldBegin('marketingUrl', TType.STRING, 2) oprot.writeString(self.marketingUrl.encode('utf-8')) oprot.writeFieldEnd() if self.supportUrl is not None: oprot.writeFieldBegin('supportUrl', TType.STRING, 3) oprot.writeString(self.supportUrl.encode('utf-8')) oprot.writeFieldEnd() if self.accountEmailDomain is not None: oprot.writeFieldBegin('accountEmailDomain', TType.STRING, 4) oprot.writeString(self.accountEmailDomain.encode('utf-8')) oprot.writeFieldEnd() if self.enableFacebookSharing is not None: oprot.writeFieldBegin('enableFacebookSharing', TType.BOOL, 5) oprot.writeBool(self.enableFacebookSharing) oprot.writeFieldEnd() if self.enableGiftSubscriptions is not None: oprot.writeFieldBegin('enableGiftSubscriptions', TType.BOOL, 6) oprot.writeBool(self.enableGiftSubscriptions) oprot.writeFieldEnd() if self.enableSupportTickets is not None: oprot.writeFieldBegin('enableSupportTickets', TType.BOOL, 7) oprot.writeBool(self.enableSupportTickets) oprot.writeFieldEnd() if self.enableSharedNotebooks is not None: oprot.writeFieldBegin('enableSharedNotebooks', TType.BOOL, 8) oprot.writeBool(self.enableSharedNotebooks) oprot.writeFieldEnd() if self.enableSingleNoteSharing is not None: oprot.writeFieldBegin('enableSingleNoteSharing', TType.BOOL, 9) oprot.writeBool(self.enableSingleNoteSharing) oprot.writeFieldEnd() if self.enableSponsoredAccounts is not None: oprot.writeFieldBegin('enableSponsoredAccounts', TType.BOOL, 10) oprot.writeBool(self.enableSponsoredAccounts) oprot.writeFieldEnd() if self.enableTwitterSharing is not None: oprot.writeFieldBegin('enableTwitterSharing', TType.BOOL, 11) oprot.writeBool(self.enableTwitterSharing) oprot.writeFieldEnd() if self.enableLinkedInSharing is not None: oprot.writeFieldBegin('enableLinkedInSharing', TType.BOOL, 12) oprot.writeBool(self.enableLinkedInSharing) oprot.writeFieldEnd() if self.enablePublicNotebooks is not None: oprot.writeFieldBegin('enablePublicNotebooks', TType.BOOL, 13) oprot.writeBool(self.enablePublicNotebooks) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.serviceHost is None: raise TProtocol.TProtocolException(message='Required field serviceHost is unset!') if self.marketingUrl is None: raise TProtocol.TProtocolException(message='Required field marketingUrl is unset!') if self.supportUrl is None: raise TProtocol.TProtocolException(message='Required field supportUrl is unset!') if self.accountEmailDomain is None: raise TProtocol.TProtocolException(message='Required field accountEmailDomain is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BootstrapProfile(object): """ This structure describes a collection of bootstrap settings.
name:
The unique name of the profile, which is guaranteed to remain consistent across calls to getBootstrapInfo.
settings:
The settings for this profile.
Attributes: - name - settings """ thrift_spec = ( None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 (2, TType.STRUCT, 'settings', (BootstrapSettings, BootstrapSettings.thrift_spec), None, ), # 2 ) def __init__(self, name=None, settings=None,): self.name = name self.settings = settings def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.name = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.settings = BootstrapSettings() self.settings.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('BootstrapProfile') if self.name is not None: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name.encode('utf-8')) oprot.writeFieldEnd() if self.settings is not None: oprot.writeFieldBegin('settings', TType.STRUCT, 2) self.settings.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: raise TProtocol.TProtocolException(message='Required field name is unset!') if self.settings is None: raise TProtocol.TProtocolException(message='Required field settings is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class BootstrapInfo(object): """ This structure describes a collection of bootstrap profiles.
profiles:
List of one or more bootstrap profiles, in descending preference order.
Attributes: - profiles """ thrift_spec = ( None, # 0 (1, TType.LIST, 'profiles', (TType.STRUCT,(BootstrapProfile, BootstrapProfile.thrift_spec)), None, ), # 1 ) def __init__(self, profiles=None,): self.profiles = profiles def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.profiles = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = BootstrapProfile() _elem5.read(iprot) self.profiles.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('BootstrapInfo') if self.profiles is not None: oprot.writeFieldBegin('profiles', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.profiles)) for iter6 in self.profiles: iter6.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.profiles is None: raise TProtocol.TProtocolException(message='Required field profiles is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/userstore/__init__.py0000644000015301777760000000005712432702717030615 0ustar pbusernogroup00000000000000__all__ = ['ttypes', 'constants', 'UserStore'] reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/userstore/UserStore.py0000644000015301777760000036267412432702717031031 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class Iface(object): """ Service: UserStore

The UserStore service is primarily used by EDAM clients to establish authentication via username and password over a trusted connection (e.g. SSL). A client's first call to this interface should be checkVersion() to ensure that the client's software is up to date.

All calls which require an authenticationToken may throw an EDAMUserException for the following reasons: """ def checkVersion(self, clientName, edamVersionMajor, edamVersionMinor): """ This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client. The service will then return true if the client is capable of talking to the service, and false if the client's protocol version is incompatible with the service, so the client must upgrade. If a client receives a false value, it should report the incompatibility to the user and not continue with any more EDAM requests (UserStore or NoteStore). @param clientName This string provides some information about the client for tracking/logging on the service. It should provide information about the client's software and platform. The structure should be: application/version; platform/version; [ device/version ] E.g. "Evernote Windows/3.0.1; Windows/XP SP3". @param edamVersionMajor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MAJOR constant for the client. @param edamVersionMinor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MINOR constant for the client. Parameters: - clientName - edamVersionMajor - edamVersionMinor """ pass def getBootstrapInfo(self, locale): """ This provides bootstrap information to the client. Various bootstrap profiles and settings may be used by the client to configure itself. @param locale The client's current locale, expressed in language[_country] format. E.g., "en_US". See ISO-639 and ISO-3166 for valid language and country codes. @return The bootstrap information suitable for this client. Parameters: - locale """ pass def authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor): """ This is used to check a username and password in order to create a short-lived authentication session that can be used for further actions. This function is only available to Evernote's internal applications. Third party applications must authenticate using OAuth as described at dev.evernote.com. @param username The username (not numeric user ID) for the account to authenticate against. This function will also accept the user's registered email address in this parameter. @param password The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (e.g. SSL). @param consumerKey The "consumer key" portion of the API key issued to the client application by Evernote. @param consumerSecret The "consumer secret" portion of the API key issued to the client application by Evernote. @param supportsTwoFactor Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. @return

The result of the authentication. If the authentication was successful, the AuthenticationResult.user field will be set with the full information about the User.

If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.

@throws EDAMUserException Parameters: - username - password - consumerKey - consumerSecret - supportsTwoFactor """ pass def authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor): """ This is used to check a username and password in order to create a long-lived authentication token that can be used for further actions. This function is not available to most third party applications, which typically authenticate using OAuth as described at dev.evernote.com. If you believe that your application requires permission to authenticate using username and password instead of OAuth, please contact Evernote developer support by visiting dev.evernote.com. @param username The username or registered email address of the account to authenticate against. @param password The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (i.e. SSL). @param consumerKey The "consumer key" portion of the API key issued to the client application by Evernote. @param consumerSecret The "consumer secret" portion of the API key issued to the client application by Evernote. @param deviceIdentifier An optional string, no more than 32 characters in length, that uniquely identifies the device from which the authentication is being performed. This string allows the service to return the same authentication token when a given application requests authentication repeatedly from the same device. This may happen when the user logs out of an application and then logs back in, or when the application is uninstalled and later reinstalled. If no reliable device identifier can be created, this value should be omitted. If set, the device identifier must be between 1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_ID_REGEX. @param deviceDescription A description of the device from which the authentication is being performed. This field is displayed to the user in a list of authorized applications to allow them to distinguish between multiple tokens issued to the same client application on different devices. For example, the Evernote iOS client on a user's iPhone and iPad might pass the iOS device names "Bob's iPhone" and "Bob's iPad". The device description must be between 1 and EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_DESCRIPTION_REGEX. @param supportsTwoFactor Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. @return

The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by calling application's API key.

If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.

@throws EDAMUserException Parameters: - username - password - consumerKey - consumerSecret - deviceIdentifier - deviceDescription - supportsTwoFactor """ pass def completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription): """ Complete the authentication process when a second factor is required. This call is made after a successful call to authenticate or authenticateLongSession when the authenticating user has enabled two-factor authentication. @param authenticationToken An authentication token returned by a previous call to UserStore.authenticate or UserStore.authenticateLongSession that could not be completed in a single call because a second factor was required. @param oneTimeCode The one time code entered by the user. This value is delivered out-of-band, typically via SMS or an authenticator application. @param deviceIdentifier See the corresponding parameter in authenticateLongSession. @param deviceDescription See the corresponding parameter in authenticateLongSession. @return The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by the calling application's API key. If the initial authentication call was made to authenticateLongSession, the AuthenticationResult will contain a long-lived authentication token. @throws EDAMUserException Parameters: - authenticationToken - oneTimeCode - deviceIdentifier - deviceDescription """ pass def revokeLongSession(self, authenticationToken): """ Revoke an existing long lived authentication token. This can be used to revoke OAuth tokens or tokens created by calling authenticateLongSession, and allows a user to effectively log out of Evernote from the perspective of the application that holds the token. The authentication token that is passed is immediately revoked and may not be used to call any authenticated EDAM function. @param authenticationToken the authentication token to revoke. @throws EDAMUserException Parameters: - authenticationToken """ pass def authenticateToBusiness(self, authenticationToken): """ This is used to take an existing authentication token that grants access to an individual user account (returned from 'authenticate', 'authenticateLongSession' or an OAuth authorization) and obtain an additional authentication token that may be used to access business notebooks if the user is a member of an Evernote Business account. The resulting authentication token may be used to make NoteStore API calls against the business using the NoteStore URL returned in the result. @param authenticationToken The authentication token for the user. This may not be a shared authentication token (returned by NoteStore.authenticateToSharedNotebook or NoteStore.authenticateToSharedNote) or a business authentication token. @return The result of the authentication, with the token granting access to the business in the result's 'authenticationToken' field. The URL that must be used to access the business account NoteStore will be returned in the result's 'noteStoreUrl' field. The 'User' field will not be set in the result. @throws EDAMUserException Parameters: - authenticationToken """ pass def refreshAuthentication(self, authenticationToken): """ This is used to take an existing authentication token (returned from 'authenticate') and exchange it for a newer token which will not expire as soon. This must be invoked before the previous token expires. This function is only availabe to Evernote's internal applications. @param authenticationToken The previous authentication token from the authenticate() result. @return The result of the authentication, with the new token in the result's 'authenticationToken' field. The 'User' field will not be set in the result. Parameters: - authenticationToken """ pass def getUser(self, authenticationToken): """ Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid. The level of detail provided in the returned User structure depends on the access level granted by the token, so a web service client may receive fewer fields than an integrated desktop client. Parameters: - authenticationToken """ pass def getPublicUserInfo(self, username): """ Asks the UserStore about the publicly available location information for a particular username. @throws EDAMUserException Parameters: - username """ pass def getPremiumInfo(self, authenticationToken): """ Returns information regarding a user's Premium account corresponding to the provided authentication token, or throws an exception if this token is not valid. Parameters: - authenticationToken """ pass def getNoteStoreUrl(self, authenticationToken): """ Returns the URL that should be used to talk to the NoteStore for the account represented by the provided authenticationToken. This method isn't needed by most clients, who can retrieve the correct NoteStore URL from the AuthenticationResult returned from the authenticate or refreshAuthentication calls. This method is typically only needed to look up the correct URL for a long-lived session token (e.g. for an OAuth web service). Parameters: - authenticationToken """ pass class Client(Iface): """ Service: UserStore

The UserStore service is primarily used by EDAM clients to establish authentication via username and password over a trusted connection (e.g. SSL). A client's first call to this interface should be checkVersion() to ensure that the client's software is up to date.

All calls which require an authenticationToken may throw an EDAMUserException for the following reasons: """ def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def checkVersion(self, clientName, edamVersionMajor, edamVersionMinor): """ This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client. The service will then return true if the client is capable of talking to the service, and false if the client's protocol version is incompatible with the service, so the client must upgrade. If a client receives a false value, it should report the incompatibility to the user and not continue with any more EDAM requests (UserStore or NoteStore). @param clientName This string provides some information about the client for tracking/logging on the service. It should provide information about the client's software and platform. The structure should be: application/version; platform/version; [ device/version ] E.g. "Evernote Windows/3.0.1; Windows/XP SP3". @param edamVersionMajor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MAJOR constant for the client. @param edamVersionMinor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MINOR constant for the client. Parameters: - clientName - edamVersionMajor - edamVersionMinor """ self.send_checkVersion(clientName, edamVersionMajor, edamVersionMinor) return self.recv_checkVersion() def send_checkVersion(self, clientName, edamVersionMajor, edamVersionMinor): self._oprot.writeMessageBegin('checkVersion', TMessageType.CALL, self._seqid) args = checkVersion_args() args.clientName = clientName args.edamVersionMajor = edamVersionMajor args.edamVersionMinor = edamVersionMinor args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_checkVersion(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = checkVersion_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "checkVersion failed: unknown result"); def getBootstrapInfo(self, locale): """ This provides bootstrap information to the client. Various bootstrap profiles and settings may be used by the client to configure itself. @param locale The client's current locale, expressed in language[_country] format. E.g., "en_US". See ISO-639 and ISO-3166 for valid language and country codes. @return The bootstrap information suitable for this client. Parameters: - locale """ self.send_getBootstrapInfo(locale) return self.recv_getBootstrapInfo() def send_getBootstrapInfo(self, locale): self._oprot.writeMessageBegin('getBootstrapInfo', TMessageType.CALL, self._seqid) args = getBootstrapInfo_args() args.locale = locale args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getBootstrapInfo(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = getBootstrapInfo_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getBootstrapInfo failed: unknown result"); def authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor): """ This is used to check a username and password in order to create a short-lived authentication session that can be used for further actions. This function is only available to Evernote's internal applications. Third party applications must authenticate using OAuth as described at dev.evernote.com. @param username The username (not numeric user ID) for the account to authenticate against. This function will also accept the user's registered email address in this parameter. @param password The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (e.g. SSL). @param consumerKey The "consumer key" portion of the API key issued to the client application by Evernote. @param consumerSecret The "consumer secret" portion of the API key issued to the client application by Evernote. @param supportsTwoFactor Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. @return

The result of the authentication. If the authentication was successful, the AuthenticationResult.user field will be set with the full information about the User.

If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.

@throws EDAMUserException Parameters: - username - password - consumerKey - consumerSecret - supportsTwoFactor """ self.send_authenticate(username, password, consumerKey, consumerSecret, supportsTwoFactor) return self.recv_authenticate() def send_authenticate(self, username, password, consumerKey, consumerSecret, supportsTwoFactor): self._oprot.writeMessageBegin('authenticate', TMessageType.CALL, self._seqid) args = authenticate_args() args.username = username args.password = password args.consumerKey = consumerKey args.consumerSecret = consumerSecret args.supportsTwoFactor = supportsTwoFactor args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_authenticate(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = authenticate_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticate failed: unknown result"); def authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor): """ This is used to check a username and password in order to create a long-lived authentication token that can be used for further actions. This function is not available to most third party applications, which typically authenticate using OAuth as described at dev.evernote.com. If you believe that your application requires permission to authenticate using username and password instead of OAuth, please contact Evernote developer support by visiting dev.evernote.com. @param username The username or registered email address of the account to authenticate against. @param password The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (i.e. SSL). @param consumerKey The "consumer key" portion of the API key issued to the client application by Evernote. @param consumerSecret The "consumer secret" portion of the API key issued to the client application by Evernote. @param deviceIdentifier An optional string, no more than 32 characters in length, that uniquely identifies the device from which the authentication is being performed. This string allows the service to return the same authentication token when a given application requests authentication repeatedly from the same device. This may happen when the user logs out of an application and then logs back in, or when the application is uninstalled and later reinstalled. If no reliable device identifier can be created, this value should be omitted. If set, the device identifier must be between 1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_ID_REGEX. @param deviceDescription A description of the device from which the authentication is being performed. This field is displayed to the user in a list of authorized applications to allow them to distinguish between multiple tokens issued to the same client application on different devices. For example, the Evernote iOS client on a user's iPhone and iPad might pass the iOS device names "Bob's iPhone" and "Bob's iPad". The device description must be between 1 and EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_DESCRIPTION_REGEX. @param supportsTwoFactor Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. @return

The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by calling application's API key.

If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.

@throws EDAMUserException Parameters: - username - password - consumerKey - consumerSecret - deviceIdentifier - deviceDescription - supportsTwoFactor """ self.send_authenticateLongSession(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor) return self.recv_authenticateLongSession() def send_authenticateLongSession(self, username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor): self._oprot.writeMessageBegin('authenticateLongSession', TMessageType.CALL, self._seqid) args = authenticateLongSession_args() args.username = username args.password = password args.consumerKey = consumerKey args.consumerSecret = consumerSecret args.deviceIdentifier = deviceIdentifier args.deviceDescription = deviceDescription args.supportsTwoFactor = supportsTwoFactor args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_authenticateLongSession(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = authenticateLongSession_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateLongSession failed: unknown result"); def completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription): """ Complete the authentication process when a second factor is required. This call is made after a successful call to authenticate or authenticateLongSession when the authenticating user has enabled two-factor authentication. @param authenticationToken An authentication token returned by a previous call to UserStore.authenticate or UserStore.authenticateLongSession that could not be completed in a single call because a second factor was required. @param oneTimeCode The one time code entered by the user. This value is delivered out-of-band, typically via SMS or an authenticator application. @param deviceIdentifier See the corresponding parameter in authenticateLongSession. @param deviceDescription See the corresponding parameter in authenticateLongSession. @return The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by the calling application's API key. If the initial authentication call was made to authenticateLongSession, the AuthenticationResult will contain a long-lived authentication token. @throws EDAMUserException Parameters: - authenticationToken - oneTimeCode - deviceIdentifier - deviceDescription """ self.send_completeTwoFactorAuthentication(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription) return self.recv_completeTwoFactorAuthentication() def send_completeTwoFactorAuthentication(self, authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription): self._oprot.writeMessageBegin('completeTwoFactorAuthentication', TMessageType.CALL, self._seqid) args = completeTwoFactorAuthentication_args() args.authenticationToken = authenticationToken args.oneTimeCode = oneTimeCode args.deviceIdentifier = deviceIdentifier args.deviceDescription = deviceDescription args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_completeTwoFactorAuthentication(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = completeTwoFactorAuthentication_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "completeTwoFactorAuthentication failed: unknown result"); def revokeLongSession(self, authenticationToken): """ Revoke an existing long lived authentication token. This can be used to revoke OAuth tokens or tokens created by calling authenticateLongSession, and allows a user to effectively log out of Evernote from the perspective of the application that holds the token. The authentication token that is passed is immediately revoked and may not be used to call any authenticated EDAM function. @param authenticationToken the authentication token to revoke. @throws EDAMUserException Parameters: - authenticationToken """ self.send_revokeLongSession(authenticationToken) self.recv_revokeLongSession() def send_revokeLongSession(self, authenticationToken): self._oprot.writeMessageBegin('revokeLongSession', TMessageType.CALL, self._seqid) args = revokeLongSession_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_revokeLongSession(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = revokeLongSession_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException return def authenticateToBusiness(self, authenticationToken): """ This is used to take an existing authentication token that grants access to an individual user account (returned from 'authenticate', 'authenticateLongSession' or an OAuth authorization) and obtain an additional authentication token that may be used to access business notebooks if the user is a member of an Evernote Business account. The resulting authentication token may be used to make NoteStore API calls against the business using the NoteStore URL returned in the result. @param authenticationToken The authentication token for the user. This may not be a shared authentication token (returned by NoteStore.authenticateToSharedNotebook or NoteStore.authenticateToSharedNote) or a business authentication token. @return The result of the authentication, with the token granting access to the business in the result's 'authenticationToken' field. The URL that must be used to access the business account NoteStore will be returned in the result's 'noteStoreUrl' field. The 'User' field will not be set in the result. @throws EDAMUserException Parameters: - authenticationToken """ self.send_authenticateToBusiness(authenticationToken) return self.recv_authenticateToBusiness() def send_authenticateToBusiness(self, authenticationToken): self._oprot.writeMessageBegin('authenticateToBusiness', TMessageType.CALL, self._seqid) args = authenticateToBusiness_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_authenticateToBusiness(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = authenticateToBusiness_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateToBusiness failed: unknown result"); def refreshAuthentication(self, authenticationToken): """ This is used to take an existing authentication token (returned from 'authenticate') and exchange it for a newer token which will not expire as soon. This must be invoked before the previous token expires. This function is only availabe to Evernote's internal applications. @param authenticationToken The previous authentication token from the authenticate() result. @return The result of the authentication, with the new token in the result's 'authenticationToken' field. The 'User' field will not be set in the result. Parameters: - authenticationToken """ self.send_refreshAuthentication(authenticationToken) return self.recv_refreshAuthentication() def send_refreshAuthentication(self, authenticationToken): self._oprot.writeMessageBegin('refreshAuthentication', TMessageType.CALL, self._seqid) args = refreshAuthentication_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_refreshAuthentication(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = refreshAuthentication_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "refreshAuthentication failed: unknown result"); def getUser(self, authenticationToken): """ Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid. The level of detail provided in the returned User structure depends on the access level granted by the token, so a web service client may receive fewer fields than an integrated desktop client. Parameters: - authenticationToken """ self.send_getUser(authenticationToken) return self.recv_getUser() def send_getUser(self, authenticationToken): self._oprot.writeMessageBegin('getUser', TMessageType.CALL, self._seqid) args = getUser_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getUser(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = getUser_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "getUser failed: unknown result"); def getPublicUserInfo(self, username): """ Asks the UserStore about the publicly available location information for a particular username. @throws EDAMUserException Parameters: - username """ self.send_getPublicUserInfo(username) return self.recv_getPublicUserInfo() def send_getPublicUserInfo(self, username): self._oprot.writeMessageBegin('getPublicUserInfo', TMessageType.CALL, self._seqid) args = getPublicUserInfo_args() args.username = username args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getPublicUserInfo(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = getPublicUserInfo_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.notFoundException is not None: raise result.notFoundException if result.systemException is not None: raise result.systemException if result.userException is not None: raise result.userException raise TApplicationException(TApplicationException.MISSING_RESULT, "getPublicUserInfo failed: unknown result"); def getPremiumInfo(self, authenticationToken): """ Returns information regarding a user's Premium account corresponding to the provided authentication token, or throws an exception if this token is not valid. Parameters: - authenticationToken """ self.send_getPremiumInfo(authenticationToken) return self.recv_getPremiumInfo() def send_getPremiumInfo(self, authenticationToken): self._oprot.writeMessageBegin('getPremiumInfo', TMessageType.CALL, self._seqid) args = getPremiumInfo_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getPremiumInfo(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = getPremiumInfo_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "getPremiumInfo failed: unknown result"); def getNoteStoreUrl(self, authenticationToken): """ Returns the URL that should be used to talk to the NoteStore for the account represented by the provided authenticationToken. This method isn't needed by most clients, who can retrieve the correct NoteStore URL from the AuthenticationResult returned from the authenticate or refreshAuthentication calls. This method is typically only needed to look up the correct URL for a long-lived session token (e.g. for an OAuth web service). Parameters: - authenticationToken """ self.send_getNoteStoreUrl(authenticationToken) return self.recv_getNoteStoreUrl() def send_getNoteStoreUrl(self, authenticationToken): self._oprot.writeMessageBegin('getNoteStoreUrl', TMessageType.CALL, self._seqid) args = getNoteStoreUrl_args() args.authenticationToken = authenticationToken args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_getNoteStoreUrl(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x result = getNoteStoreUrl_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.userException is not None: raise result.userException if result.systemException is not None: raise result.systemException raise TApplicationException(TApplicationException.MISSING_RESULT, "getNoteStoreUrl failed: unknown result"); class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["checkVersion"] = Processor.process_checkVersion self._processMap["getBootstrapInfo"] = Processor.process_getBootstrapInfo self._processMap["authenticate"] = Processor.process_authenticate self._processMap["authenticateLongSession"] = Processor.process_authenticateLongSession self._processMap["completeTwoFactorAuthentication"] = Processor.process_completeTwoFactorAuthentication self._processMap["revokeLongSession"] = Processor.process_revokeLongSession self._processMap["authenticateToBusiness"] = Processor.process_authenticateToBusiness self._processMap["refreshAuthentication"] = Processor.process_refreshAuthentication self._processMap["getUser"] = Processor.process_getUser self._processMap["getPublicUserInfo"] = Processor.process_getPublicUserInfo self._processMap["getPremiumInfo"] = Processor.process_getPremiumInfo self._processMap["getNoteStoreUrl"] = Processor.process_getNoteStoreUrl def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() 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_checkVersion(self, seqid, iprot, oprot): args = checkVersion_args() args.read(iprot) iprot.readMessageEnd() result = checkVersion_result() result.success = self._handler.checkVersion(args.clientName, args.edamVersionMajor, args.edamVersionMinor) oprot.writeMessageBegin("checkVersion", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getBootstrapInfo(self, seqid, iprot, oprot): args = getBootstrapInfo_args() args.read(iprot) iprot.readMessageEnd() result = getBootstrapInfo_result() result.success = self._handler.getBootstrapInfo(args.locale) oprot.writeMessageBegin("getBootstrapInfo", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_authenticate(self, seqid, iprot, oprot): args = authenticate_args() args.read(iprot) iprot.readMessageEnd() result = authenticate_result() try: result.success = self._handler.authenticate(args.username, args.password, args.consumerKey, args.consumerSecret, args.supportsTwoFactor) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("authenticate", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_authenticateLongSession(self, seqid, iprot, oprot): args = authenticateLongSession_args() args.read(iprot) iprot.readMessageEnd() result = authenticateLongSession_result() try: result.success = self._handler.authenticateLongSession(args.username, args.password, args.consumerKey, args.consumerSecret, args.deviceIdentifier, args.deviceDescription, args.supportsTwoFactor) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("authenticateLongSession", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_completeTwoFactorAuthentication(self, seqid, iprot, oprot): args = completeTwoFactorAuthentication_args() args.read(iprot) iprot.readMessageEnd() result = completeTwoFactorAuthentication_result() try: result.success = self._handler.completeTwoFactorAuthentication(args.authenticationToken, args.oneTimeCode, args.deviceIdentifier, args.deviceDescription) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("completeTwoFactorAuthentication", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_revokeLongSession(self, seqid, iprot, oprot): args = revokeLongSession_args() args.read(iprot) iprot.readMessageEnd() result = revokeLongSession_result() try: self._handler.revokeLongSession(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("revokeLongSession", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_authenticateToBusiness(self, seqid, iprot, oprot): args = authenticateToBusiness_args() args.read(iprot) iprot.readMessageEnd() result = authenticateToBusiness_result() try: result.success = self._handler.authenticateToBusiness(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("authenticateToBusiness", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_refreshAuthentication(self, seqid, iprot, oprot): args = refreshAuthentication_args() args.read(iprot) iprot.readMessageEnd() result = refreshAuthentication_result() try: result.success = self._handler.refreshAuthentication(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("refreshAuthentication", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getUser(self, seqid, iprot, oprot): args = getUser_args() args.read(iprot) iprot.readMessageEnd() result = getUser_result() try: result.success = self._handler.getUser(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("getUser", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getPublicUserInfo(self, seqid, iprot, oprot): args = getPublicUserInfo_args() args.read(iprot) iprot.readMessageEnd() result = getPublicUserInfo_result() try: result.success = self._handler.getPublicUserInfo(args.username) except evernote.edam.error.ttypes.EDAMNotFoundException as notFoundException: result.notFoundException = notFoundException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException oprot.writeMessageBegin("getPublicUserInfo", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getPremiumInfo(self, seqid, iprot, oprot): args = getPremiumInfo_args() args.read(iprot) iprot.readMessageEnd() result = getPremiumInfo_result() try: result.success = self._handler.getPremiumInfo(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("getPremiumInfo", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_getNoteStoreUrl(self, seqid, iprot, oprot): args = getNoteStoreUrl_args() args.read(iprot) iprot.readMessageEnd() result = getNoteStoreUrl_result() try: result.success = self._handler.getNoteStoreUrl(args.authenticationToken) except evernote.edam.error.ttypes.EDAMUserException as userException: result.userException = userException except evernote.edam.error.ttypes.EDAMSystemException as systemException: result.systemException = systemException oprot.writeMessageBegin("getNoteStoreUrl", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class checkVersion_args(object): """ Attributes: - clientName - edamVersionMajor - edamVersionMinor """ thrift_spec = ( None, # 0 (1, TType.STRING, 'clientName', None, None, ), # 1 (2, TType.I16, 'edamVersionMajor', None, 1, ), # 2 (3, TType.I16, 'edamVersionMinor', None, 25, ), # 3 ) def __init__(self, clientName=None, edamVersionMajor=thrift_spec[2][4], edamVersionMinor=thrift_spec[3][4],): self.clientName = clientName self.edamVersionMajor = edamVersionMajor self.edamVersionMinor = edamVersionMinor def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.clientName = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I16: self.edamVersionMajor = iprot.readI16(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I16: self.edamVersionMinor = iprot.readI16(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('checkVersion_args') if self.clientName is not None: oprot.writeFieldBegin('clientName', TType.STRING, 1) oprot.writeString(self.clientName.encode('utf-8')) oprot.writeFieldEnd() if self.edamVersionMajor is not None: oprot.writeFieldBegin('edamVersionMajor', TType.I16, 2) oprot.writeI16(self.edamVersionMajor) oprot.writeFieldEnd() if self.edamVersionMinor is not None: oprot.writeFieldBegin('edamVersionMinor', TType.I16, 3) oprot.writeI16(self.edamVersionMinor) 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 checkVersion_result(object): """ Attributes: - success """ thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 ) def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.BOOL: self.success = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('checkVersion_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) 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 getBootstrapInfo_args(object): """ Attributes: - locale """ thrift_spec = ( None, # 0 (1, TType.STRING, 'locale', None, None, ), # 1 ) def __init__(self, locale=None,): self.locale = locale def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.locale = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getBootstrapInfo_args') if self.locale is not None: oprot.writeFieldBegin('locale', TType.STRING, 1) oprot.writeString(self.locale.encode('utf-8')) 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 getBootstrapInfo_result(object): """ Attributes: - success """ thrift_spec = ( (0, TType.STRUCT, 'success', (BootstrapInfo, BootstrapInfo.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = BootstrapInfo() self.success.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getBootstrapInfo_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class authenticate_args(object): """ Attributes: - username - password - consumerKey - consumerSecret - supportsTwoFactor """ thrift_spec = ( None, # 0 (1, TType.STRING, 'username', None, None, ), # 1 (2, TType.STRING, 'password', None, None, ), # 2 (3, TType.STRING, 'consumerKey', None, None, ), # 3 (4, TType.STRING, 'consumerSecret', None, None, ), # 4 (5, TType.BOOL, 'supportsTwoFactor', None, None, ), # 5 ) def __init__(self, username=None, password=None, consumerKey=None, consumerSecret=None, supportsTwoFactor=None,): self.username = username self.password = password self.consumerKey = consumerKey self.consumerSecret = consumerSecret self.supportsTwoFactor = supportsTwoFactor def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.username = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.password = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.consumerKey = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.consumerSecret = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.supportsTwoFactor = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticate_args') if self.username is not None: oprot.writeFieldBegin('username', TType.STRING, 1) oprot.writeString(self.username.encode('utf-8')) oprot.writeFieldEnd() if self.password is not None: oprot.writeFieldBegin('password', TType.STRING, 2) oprot.writeString(self.password.encode('utf-8')) oprot.writeFieldEnd() if self.consumerKey is not None: oprot.writeFieldBegin('consumerKey', TType.STRING, 3) oprot.writeString(self.consumerKey.encode('utf-8')) oprot.writeFieldEnd() if self.consumerSecret is not None: oprot.writeFieldBegin('consumerSecret', TType.STRING, 4) oprot.writeString(self.consumerSecret.encode('utf-8')) oprot.writeFieldEnd() if self.supportsTwoFactor is not None: oprot.writeFieldBegin('supportsTwoFactor', TType.BOOL, 5) oprot.writeBool(self.supportsTwoFactor) 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 authenticate_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = AuthenticationResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticate_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class authenticateLongSession_args(object): """ Attributes: - username - password - consumerKey - consumerSecret - deviceIdentifier - deviceDescription - supportsTwoFactor """ thrift_spec = ( None, # 0 (1, TType.STRING, 'username', None, None, ), # 1 (2, TType.STRING, 'password', None, None, ), # 2 (3, TType.STRING, 'consumerKey', None, None, ), # 3 (4, TType.STRING, 'consumerSecret', None, None, ), # 4 (5, TType.STRING, 'deviceIdentifier', None, None, ), # 5 (6, TType.STRING, 'deviceDescription', None, None, ), # 6 (7, TType.BOOL, 'supportsTwoFactor', None, None, ), # 7 ) def __init__(self, username=None, password=None, consumerKey=None, consumerSecret=None, deviceIdentifier=None, deviceDescription=None, supportsTwoFactor=None,): self.username = username self.password = password self.consumerKey = consumerKey self.consumerSecret = consumerSecret self.deviceIdentifier = deviceIdentifier self.deviceDescription = deviceDescription self.supportsTwoFactor = supportsTwoFactor def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.username = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.password = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.consumerKey = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.consumerSecret = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.deviceIdentifier = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.deviceDescription = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: self.supportsTwoFactor = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticateLongSession_args') if self.username is not None: oprot.writeFieldBegin('username', TType.STRING, 1) oprot.writeString(self.username.encode('utf-8')) oprot.writeFieldEnd() if self.password is not None: oprot.writeFieldBegin('password', TType.STRING, 2) oprot.writeString(self.password.encode('utf-8')) oprot.writeFieldEnd() if self.consumerKey is not None: oprot.writeFieldBegin('consumerKey', TType.STRING, 3) oprot.writeString(self.consumerKey.encode('utf-8')) oprot.writeFieldEnd() if self.consumerSecret is not None: oprot.writeFieldBegin('consumerSecret', TType.STRING, 4) oprot.writeString(self.consumerSecret.encode('utf-8')) oprot.writeFieldEnd() if self.deviceIdentifier is not None: oprot.writeFieldBegin('deviceIdentifier', TType.STRING, 5) oprot.writeString(self.deviceIdentifier.encode('utf-8')) oprot.writeFieldEnd() if self.deviceDescription is not None: oprot.writeFieldBegin('deviceDescription', TType.STRING, 6) oprot.writeString(self.deviceDescription.encode('utf-8')) oprot.writeFieldEnd() if self.supportsTwoFactor is not None: oprot.writeFieldBegin('supportsTwoFactor', TType.BOOL, 7) oprot.writeBool(self.supportsTwoFactor) 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 authenticateLongSession_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = AuthenticationResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticateLongSession_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class completeTwoFactorAuthentication_args(object): """ Attributes: - authenticationToken - oneTimeCode - deviceIdentifier - deviceDescription """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 (2, TType.STRING, 'oneTimeCode', None, None, ), # 2 (3, TType.STRING, 'deviceIdentifier', None, None, ), # 3 (4, TType.STRING, 'deviceDescription', None, None, ), # 4 ) def __init__(self, authenticationToken=None, oneTimeCode=None, deviceIdentifier=None, deviceDescription=None,): self.authenticationToken = authenticationToken self.oneTimeCode = oneTimeCode self.deviceIdentifier = deviceIdentifier self.deviceDescription = deviceDescription def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.oneTimeCode = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.deviceIdentifier = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.deviceDescription = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('completeTwoFactorAuthentication_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) oprot.writeFieldEnd() if self.oneTimeCode is not None: oprot.writeFieldBegin('oneTimeCode', TType.STRING, 2) oprot.writeString(self.oneTimeCode.encode('utf-8')) oprot.writeFieldEnd() if self.deviceIdentifier is not None: oprot.writeFieldBegin('deviceIdentifier', TType.STRING, 3) oprot.writeString(self.deviceIdentifier.encode('utf-8')) oprot.writeFieldEnd() if self.deviceDescription is not None: oprot.writeFieldBegin('deviceDescription', TType.STRING, 4) oprot.writeString(self.deviceDescription.encode('utf-8')) 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 completeTwoFactorAuthentication_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = AuthenticationResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('completeTwoFactorAuthentication_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class revokeLongSession_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('revokeLongSession_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 revokeLongSession_result(object): """ Attributes: - userException - systemException """ thrift_spec = ( None, # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, userException=None, systemException=None,): self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('revokeLongSession_result') if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class authenticateToBusiness_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticateToBusiness_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 authenticateToBusiness_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = AuthenticationResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('authenticateToBusiness_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class refreshAuthentication_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('refreshAuthentication_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 refreshAuthentication_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (AuthenticationResult, AuthenticationResult.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = AuthenticationResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('refreshAuthentication_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class getUser_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getUser_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 getUser_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.User, evernote.edam.type.ttypes.User.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = evernote.edam.type.ttypes.User() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getUser_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class getPublicUserInfo_args(object): """ Attributes: - username """ thrift_spec = ( None, # 0 (1, TType.STRING, 'username', None, None, ), # 1 ) def __init__(self, username=None,): self.username = username def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.username = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getPublicUserInfo_args') if self.username is not None: oprot.writeFieldBegin('username', TType.STRING, 1) oprot.writeString(self.username.encode('utf-8')) 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 getPublicUserInfo_result(object): """ Attributes: - success - notFoundException - systemException - userException """ thrift_spec = ( (0, TType.STRUCT, 'success', (PublicUserInfo, PublicUserInfo.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'notFoundException', (evernote.edam.error.ttypes.EDAMNotFoundException, evernote.edam.error.ttypes.EDAMNotFoundException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 (3, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 3 ) def __init__(self, success=None, notFoundException=None, systemException=None, userException=None,): self.success = success self.notFoundException = notFoundException self.systemException = systemException self.userException = userException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = PublicUserInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.notFoundException = evernote.edam.error.ttypes.EDAMNotFoundException() self.notFoundException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getPublicUserInfo_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.notFoundException is not None: oprot.writeFieldBegin('notFoundException', TType.STRUCT, 1) self.notFoundException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 3) self.userException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class getPremiumInfo_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getPremiumInfo_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 getPremiumInfo_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRUCT, 'success', (evernote.edam.type.ttypes.PremiumInfo, evernote.edam.type.ttypes.PremiumInfo.thrift_spec), None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = evernote.edam.type.ttypes.PremiumInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getPremiumInfo_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class getNoteStoreUrl_args(object): """ Attributes: - authenticationToken """ thrift_spec = ( None, # 0 (1, TType.STRING, 'authenticationToken', None, None, ), # 1 ) def __init__(self, authenticationToken=None,): self.authenticationToken = authenticationToken def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.authenticationToken = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getNoteStoreUrl_args') if self.authenticationToken is not None: oprot.writeFieldBegin('authenticationToken', TType.STRING, 1) oprot.writeString(self.authenticationToken.encode('utf-8')) 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 getNoteStoreUrl_result(object): """ Attributes: - success - userException - systemException """ thrift_spec = ( (0, TType.STRING, 'success', None, None, ), # 0 (1, TType.STRUCT, 'userException', (evernote.edam.error.ttypes.EDAMUserException, evernote.edam.error.ttypes.EDAMUserException.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'systemException', (evernote.edam.error.ttypes.EDAMSystemException, evernote.edam.error.ttypes.EDAMSystemException.thrift_spec), None, ), # 2 ) def __init__(self, success=None, userException=None, systemException=None,): self.success = success self.userException = userException self.systemException = systemException def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.userException = evernote.edam.error.ttypes.EDAMUserException() self.userException.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.systemException = evernote.edam.error.ttypes.EDAMSystemException() self.systemException.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('getNoteStoreUrl_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8')) oprot.writeFieldEnd() if self.userException is not None: oprot.writeFieldBegin('userException', TType.STRUCT, 1) self.userException.write(oprot) oprot.writeFieldEnd() if self.systemException is not None: oprot.writeFieldBegin('systemException', TType.STRUCT, 2) self.systemException.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) reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/userstore/constants.py0000644000015301777760000000047212432702717031073 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from .ttypes import * EDAM_VERSION_MAJOR = 1 EDAM_VERSION_MINOR = 25 reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/__init__.py0000644000015301777760000000000012432702717026546 0ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/notestore/0000755000015301777760000000000012432703240026461 5ustar pbusernogroup00000000000000reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/notestore/ttypes.py0000644000015301777760000031327212432702717030403 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import evernote.edam.userstore.ttypes import evernote.edam.type.ttypes import evernote.edam.error.ttypes import evernote.edam.limits.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class SyncState(object): """ This structure encapsulates the information about the state of the user's account for the purpose of "state based" synchronization.
currentTime
The server's current date and time.
fullSyncBefore
The cutoff date and time for client caches to be updated via incremental synchronization. Any clients that were last synched with the server before this date/time must do a full resync of all objects. This cutoff point will change over time as archival data is deleted or special circumstances on the service require resynchronization.
updateCount
Indicates the total number of transactions that have been committed within the account. This reflects (for example) the number of discrete additions or modifications that have been made to the data in this account (tags, notes, resources, etc.). This number is the "high water mark" for Update Sequence Numbers (USN) within the account.
uploaded
The total number of bytes that have been uploaded to this account in the current monthly period. This can be compared against Accounting.uploadLimit (from the UserStore) to determine how close the user is to their monthly upload limit. This value may not be present if the SyncState has been retrieved by a caller that only has read access to the account.
Attributes: - currentTime - fullSyncBefore - updateCount - uploaded """ thrift_spec = ( None, # 0 (1, TType.I64, 'currentTime', None, None, ), # 1 (2, TType.I64, 'fullSyncBefore', None, None, ), # 2 (3, TType.I32, 'updateCount', None, None, ), # 3 (4, TType.I64, 'uploaded', None, None, ), # 4 ) def __init__(self, currentTime=None, fullSyncBefore=None, updateCount=None, uploaded=None,): self.currentTime = currentTime self.fullSyncBefore = fullSyncBefore self.updateCount = updateCount self.uploaded = uploaded def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.currentTime = iprot.readI64(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.fullSyncBefore = iprot.readI64(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.updateCount = iprot.readI32(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I64: self.uploaded = iprot.readI64(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('SyncState') if self.currentTime is not None: oprot.writeFieldBegin('currentTime', TType.I64, 1) oprot.writeI64(self.currentTime) oprot.writeFieldEnd() if self.fullSyncBefore is not None: oprot.writeFieldBegin('fullSyncBefore', TType.I64, 2) oprot.writeI64(self.fullSyncBefore) oprot.writeFieldEnd() if self.updateCount is not None: oprot.writeFieldBegin('updateCount', TType.I32, 3) oprot.writeI32(self.updateCount) oprot.writeFieldEnd() if self.uploaded is not None: oprot.writeFieldBegin('uploaded', TType.I64, 4) oprot.writeI64(self.uploaded) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.currentTime is None: raise TProtocol.TProtocolException(message='Required field currentTime is unset!') if self.fullSyncBefore is None: raise TProtocol.TProtocolException(message='Required field fullSyncBefore is unset!') if self.updateCount is None: raise TProtocol.TProtocolException(message='Required field updateCount is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SyncChunk(object): """ This structure is given out by the NoteStore when a client asks to receive the current state of an account. The client asks for the server's state one chunk at a time in order to allow clients to retrieve the state of a large account without needing to transfer the entire account in a single message. The server always gives SyncChunks using an ascending series of Update Sequence Numbers (USNs).
currentTime
The server's current date and time.
chunkHighUSN
The highest USN for any of the data objects represented in this sync chunk. If there are no objects in the chunk, this will not be set.
updateCount
The total number of updates that have been performed in the service for this account. This is equal to the highest USN within the account at the point that this SyncChunk was generated. If updateCount and chunkHighUSN are identical, that means that this is the last chunk in the account ... there is no more recent information.
notes
If present, this is a list of non-expunged notes that have a USN in this chunk. This will include notes that are "deleted" but not expunged (i.e. in the trash). The notes will include their list of tags and resources, but the note content, resource content, resource recognition data and resource alternate data will not be supplied.
notebooks
If present, this is a list of non-expunged notebooks that have a USN in this chunk. This will include notebooks that are "deleted" but not expunged (i.e. in the trash).
tags
If present, this is a list of the non-expunged tags that have a USN in this chunk.
searches
If present, this is a list of non-expunged searches that have a USN in this chunk.
resources
If present, this is a list of the non-expunged resources that have a USN in this chunk. This will include the metadata for each resource, but not its binary contents or recognition data, which must be retrieved separately.
expungedNotes
If present, the GUIDs of all of the notes that were permanently expunged in this chunk.
expungedNotebooks
If present, the GUIDs of all of the notebooks that were permanently expunged in this chunk. When a notebook is expunged, this implies that all of its child notes (and their resources) were also expunged.
expungedTags
If present, the GUIDs of all of the tags that were permanently expunged in this chunk.
expungedSearches
If present, the GUIDs of all of the saved searches that were permanently expunged in this chunk.
linkedNotebooks
If present, this is a list of non-expunged LinkedNotebooks that have a USN in this chunk.
expungedLinkedNotebooks
If present, the GUIDs of all of the LinkedNotebooks that were permanently expunged in this chunk.
Attributes: - currentTime - chunkHighUSN - updateCount - notes - notebooks - tags - searches - resources - expungedNotes - expungedNotebooks - expungedTags - expungedSearches - linkedNotebooks - expungedLinkedNotebooks """ thrift_spec = ( None, # 0 (1, TType.I64, 'currentTime', None, None, ), # 1 (2, TType.I32, 'chunkHighUSN', None, None, ), # 2 (3, TType.I32, 'updateCount', None, None, ), # 3 (4, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 4 (5, TType.LIST, 'notebooks', (TType.STRUCT,(evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec)), None, ), # 5 (6, TType.LIST, 'tags', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 6 (7, TType.LIST, 'searches', (TType.STRUCT,(evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec)), None, ), # 7 (8, TType.LIST, 'resources', (TType.STRUCT,(evernote.edam.type.ttypes.Resource, evernote.edam.type.ttypes.Resource.thrift_spec)), None, ), # 8 (9, TType.LIST, 'expungedNotes', (TType.STRING,None), None, ), # 9 (10, TType.LIST, 'expungedNotebooks', (TType.STRING,None), None, ), # 10 (11, TType.LIST, 'expungedTags', (TType.STRING,None), None, ), # 11 (12, TType.LIST, 'expungedSearches', (TType.STRING,None), None, ), # 12 (13, TType.LIST, 'linkedNotebooks', (TType.STRUCT,(evernote.edam.type.ttypes.LinkedNotebook, evernote.edam.type.ttypes.LinkedNotebook.thrift_spec)), None, ), # 13 (14, TType.LIST, 'expungedLinkedNotebooks', (TType.STRING,None), None, ), # 14 ) def __init__(self, currentTime=None, chunkHighUSN=None, updateCount=None, notes=None, notebooks=None, tags=None, searches=None, resources=None, expungedNotes=None, expungedNotebooks=None, expungedTags=None, expungedSearches=None, linkedNotebooks=None, expungedLinkedNotebooks=None,): self.currentTime = currentTime self.chunkHighUSN = chunkHighUSN self.updateCount = updateCount self.notes = notes self.notebooks = notebooks self.tags = tags self.searches = searches self.resources = resources self.expungedNotes = expungedNotes self.expungedNotebooks = expungedNotebooks self.expungedTags = expungedTags self.expungedSearches = expungedSearches self.linkedNotebooks = linkedNotebooks self.expungedLinkedNotebooks = expungedLinkedNotebooks def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: self.currentTime = iprot.readI64(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.chunkHighUSN = iprot.readI32(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.updateCount = iprot.readI32(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.notes = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): _elem5 = evernote.edam.type.ttypes.Note() _elem5.read(iprot) self.notes.append(_elem5) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.notebooks = [] (_etype9, _size6) = iprot.readListBegin() for _i10 in range(_size6): _elem11 = evernote.edam.type.ttypes.Notebook() _elem11.read(iprot) self.notebooks.append(_elem11) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.LIST: self.tags = [] (_etype15, _size12) = iprot.readListBegin() for _i16 in range(_size12): _elem17 = evernote.edam.type.ttypes.Tag() _elem17.read(iprot) self.tags.append(_elem17) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.LIST: self.searches = [] (_etype21, _size18) = iprot.readListBegin() for _i22 in range(_size18): _elem23 = evernote.edam.type.ttypes.SavedSearch() _elem23.read(iprot) self.searches.append(_elem23) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.LIST: self.resources = [] (_etype27, _size24) = iprot.readListBegin() for _i28 in range(_size24): _elem29 = evernote.edam.type.ttypes.Resource() _elem29.read(iprot) self.resources.append(_elem29) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.LIST: self.expungedNotes = [] (_etype33, _size30) = iprot.readListBegin() for _i34 in range(_size30): _elem35 = iprot.readString().decode('utf-8') self.expungedNotes.append(_elem35) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.LIST: self.expungedNotebooks = [] (_etype39, _size36) = iprot.readListBegin() for _i40 in range(_size36): _elem41 = iprot.readString().decode('utf-8') self.expungedNotebooks.append(_elem41) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.LIST: self.expungedTags = [] (_etype45, _size42) = iprot.readListBegin() for _i46 in range(_size42): _elem47 = iprot.readString().decode('utf-8') self.expungedTags.append(_elem47) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.LIST: self.expungedSearches = [] (_etype51, _size48) = iprot.readListBegin() for _i52 in range(_size48): _elem53 = iprot.readString().decode('utf-8') self.expungedSearches.append(_elem53) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.LIST: self.linkedNotebooks = [] (_etype57, _size54) = iprot.readListBegin() for _i58 in range(_size54): _elem59 = evernote.edam.type.ttypes.LinkedNotebook() _elem59.read(iprot) self.linkedNotebooks.append(_elem59) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.LIST: self.expungedLinkedNotebooks = [] (_etype63, _size60) = iprot.readListBegin() for _i64 in range(_size60): _elem65 = iprot.readString().decode('utf-8') self.expungedLinkedNotebooks.append(_elem65) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('SyncChunk') if self.currentTime is not None: oprot.writeFieldBegin('currentTime', TType.I64, 1) oprot.writeI64(self.currentTime) oprot.writeFieldEnd() if self.chunkHighUSN is not None: oprot.writeFieldBegin('chunkHighUSN', TType.I32, 2) oprot.writeI32(self.chunkHighUSN) oprot.writeFieldEnd() if self.updateCount is not None: oprot.writeFieldBegin('updateCount', TType.I32, 3) oprot.writeI32(self.updateCount) oprot.writeFieldEnd() if self.notes is not None: oprot.writeFieldBegin('notes', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.notes)) for iter66 in self.notes: iter66.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.notebooks is not None: oprot.writeFieldBegin('notebooks', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.notebooks)) for iter67 in self.notebooks: iter67.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.tags is not None: oprot.writeFieldBegin('tags', TType.LIST, 6) oprot.writeListBegin(TType.STRUCT, len(self.tags)) for iter68 in self.tags: iter68.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.searches is not None: oprot.writeFieldBegin('searches', TType.LIST, 7) oprot.writeListBegin(TType.STRUCT, len(self.searches)) for iter69 in self.searches: iter69.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.resources is not None: oprot.writeFieldBegin('resources', TType.LIST, 8) oprot.writeListBegin(TType.STRUCT, len(self.resources)) for iter70 in self.resources: iter70.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.expungedNotes is not None: oprot.writeFieldBegin('expungedNotes', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.expungedNotes)) for iter71 in self.expungedNotes: oprot.writeString(iter71.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.expungedNotebooks is not None: oprot.writeFieldBegin('expungedNotebooks', TType.LIST, 10) oprot.writeListBegin(TType.STRING, len(self.expungedNotebooks)) for iter72 in self.expungedNotebooks: oprot.writeString(iter72.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.expungedTags is not None: oprot.writeFieldBegin('expungedTags', TType.LIST, 11) oprot.writeListBegin(TType.STRING, len(self.expungedTags)) for iter73 in self.expungedTags: oprot.writeString(iter73.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.expungedSearches is not None: oprot.writeFieldBegin('expungedSearches', TType.LIST, 12) oprot.writeListBegin(TType.STRING, len(self.expungedSearches)) for iter74 in self.expungedSearches: oprot.writeString(iter74.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.linkedNotebooks is not None: oprot.writeFieldBegin('linkedNotebooks', TType.LIST, 13) oprot.writeListBegin(TType.STRUCT, len(self.linkedNotebooks)) for iter75 in self.linkedNotebooks: iter75.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.expungedLinkedNotebooks is not None: oprot.writeFieldBegin('expungedLinkedNotebooks', TType.LIST, 14) oprot.writeListBegin(TType.STRING, len(self.expungedLinkedNotebooks)) for iter76 in self.expungedLinkedNotebooks: oprot.writeString(iter76.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.currentTime is None: raise TProtocol.TProtocolException(message='Required field currentTime is unset!') if self.updateCount is None: raise TProtocol.TProtocolException(message='Required field updateCount is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class SyncChunkFilter(object): """ This structure is used with the 'getFilteredSyncChunk' call to provide fine-grained control over the data that's returned when a client needs to synchronize with the service. Each flag in this structure specifies whether to include one class of data in the results of that call.
includeNotes
If true, then the server will include the SyncChunks.notes field
includeNoteResources
If true, then the server will include the 'resources' field on all of the Notes that are in SyncChunk.notes. If 'includeNotes' is false, then this will have no effect.
includeNoteAttributes
If true, then the server will include the 'attributes' field on all of the Notes that are in SyncChunks.notes. If 'includeNotes' is false, then this will have no effect.
includeNotebooks
If true, then the server will include the SyncChunks.notebooks field
includeTags
If true, then the server will include the SyncChunks.tags field
includeSearches
If true, then the server will include the SyncChunks.searches field
includeResources
If true, then the server will include the SyncChunks.resources field. Since the Resources are also provided with their Note (in the Notes.resources list), this is primarily useful for clients that want to watch for changes to individual Resources due to recognition data being added.
includeLinkedNotebooks
If true, then the server will include the SyncChunks.linkedNotebooks field.
includeExpunged
If true, then the server will include the 'expunged' data for any type of included data. For example, if 'includeTags' and 'includeExpunged' are both true, then the SyncChunks.expungedTags field will be set with the GUIDs of tags that have been expunged from the server.
includeNoteApplicationDataFullMap
If true, then the values for the applicationData map will be filled in, assuming notes and note attributes are being returned. Otherwise, only the keysOnly field will be filled in.
includeResourceApplicationDataFullMap
If true, then the fullMap values for the applicationData map will be filled in, assuming resources and resource attributes are being returned (includeResources is true). Otherwise, only the keysOnly field will be filled in.
includeNoteResourceApplicationDataFullMap
If true, then the fullMap values for the applicationData map will be filled in for resources found inside of notes, assuming resources are being returned in notes (includeNoteResources is true). Otherwise, only the keysOnly field will be filled in.
requireNoteContentClass
If set, then only send notes whose content class matches this value. The value can be a literal match or, if the last character is an asterisk, a prefix match.
Attributes: - includeNotes - includeNoteResources - includeNoteAttributes - includeNotebooks - includeTags - includeSearches - includeResources - includeLinkedNotebooks - includeExpunged - includeNoteApplicationDataFullMap - includeResourceApplicationDataFullMap - includeNoteResourceApplicationDataFullMap - requireNoteContentClass """ thrift_spec = ( None, # 0 (1, TType.BOOL, 'includeNotes', None, None, ), # 1 (2, TType.BOOL, 'includeNoteResources', None, None, ), # 2 (3, TType.BOOL, 'includeNoteAttributes', None, None, ), # 3 (4, TType.BOOL, 'includeNotebooks', None, None, ), # 4 (5, TType.BOOL, 'includeTags', None, None, ), # 5 (6, TType.BOOL, 'includeSearches', None, None, ), # 6 (7, TType.BOOL, 'includeResources', None, None, ), # 7 (8, TType.BOOL, 'includeLinkedNotebooks', None, None, ), # 8 (9, TType.BOOL, 'includeExpunged', None, None, ), # 9 (10, TType.BOOL, 'includeNoteApplicationDataFullMap', None, None, ), # 10 (11, TType.STRING, 'requireNoteContentClass', None, None, ), # 11 (12, TType.BOOL, 'includeResourceApplicationDataFullMap', None, None, ), # 12 (13, TType.BOOL, 'includeNoteResourceApplicationDataFullMap', None, None, ), # 13 ) def __init__(self, includeNotes=None, includeNoteResources=None, includeNoteAttributes=None, includeNotebooks=None, includeTags=None, includeSearches=None, includeResources=None, includeLinkedNotebooks=None, includeExpunged=None, includeNoteApplicationDataFullMap=None, includeResourceApplicationDataFullMap=None, includeNoteResourceApplicationDataFullMap=None, requireNoteContentClass=None,): self.includeNotes = includeNotes self.includeNoteResources = includeNoteResources self.includeNoteAttributes = includeNoteAttributes self.includeNotebooks = includeNotebooks self.includeTags = includeTags self.includeSearches = includeSearches self.includeResources = includeResources self.includeLinkedNotebooks = includeLinkedNotebooks self.includeExpunged = includeExpunged self.includeNoteApplicationDataFullMap = includeNoteApplicationDataFullMap self.includeResourceApplicationDataFullMap = includeResourceApplicationDataFullMap self.includeNoteResourceApplicationDataFullMap = includeNoteResourceApplicationDataFullMap self.requireNoteContentClass = requireNoteContentClass def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BOOL: self.includeNotes = iprot.readBool(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: self.includeNoteResources = iprot.readBool(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.includeNoteAttributes = iprot.readBool(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.includeNotebooks = iprot.readBool(); else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.includeTags = iprot.readBool(); else: iprot.skip(ftype) elif fid == 6: if ftype == TType.BOOL: self.includeSearches = iprot.readBool(); else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: self.includeResources = iprot.readBool(); else: iprot.skip(ftype) elif fid == 8: if ftype == TType.BOOL: self.includeLinkedNotebooks = iprot.readBool(); else: iprot.skip(ftype) elif fid == 9: if ftype == TType.BOOL: self.includeExpunged = iprot.readBool(); else: iprot.skip(ftype) elif fid == 10: if ftype == TType.BOOL: self.includeNoteApplicationDataFullMap = iprot.readBool(); else: iprot.skip(ftype) elif fid == 12: if ftype == TType.BOOL: self.includeResourceApplicationDataFullMap = iprot.readBool(); else: iprot.skip(ftype) elif fid == 13: if ftype == TType.BOOL: self.includeNoteResourceApplicationDataFullMap = iprot.readBool(); else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.requireNoteContentClass = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('SyncChunkFilter') if self.includeNotes is not None: oprot.writeFieldBegin('includeNotes', TType.BOOL, 1) oprot.writeBool(self.includeNotes) oprot.writeFieldEnd() if self.includeNoteResources is not None: oprot.writeFieldBegin('includeNoteResources', TType.BOOL, 2) oprot.writeBool(self.includeNoteResources) oprot.writeFieldEnd() if self.includeNoteAttributes is not None: oprot.writeFieldBegin('includeNoteAttributes', TType.BOOL, 3) oprot.writeBool(self.includeNoteAttributes) oprot.writeFieldEnd() if self.includeNotebooks is not None: oprot.writeFieldBegin('includeNotebooks', TType.BOOL, 4) oprot.writeBool(self.includeNotebooks) oprot.writeFieldEnd() if self.includeTags is not None: oprot.writeFieldBegin('includeTags', TType.BOOL, 5) oprot.writeBool(self.includeTags) oprot.writeFieldEnd() if self.includeSearches is not None: oprot.writeFieldBegin('includeSearches', TType.BOOL, 6) oprot.writeBool(self.includeSearches) oprot.writeFieldEnd() if self.includeResources is not None: oprot.writeFieldBegin('includeResources', TType.BOOL, 7) oprot.writeBool(self.includeResources) oprot.writeFieldEnd() if self.includeLinkedNotebooks is not None: oprot.writeFieldBegin('includeLinkedNotebooks', TType.BOOL, 8) oprot.writeBool(self.includeLinkedNotebooks) oprot.writeFieldEnd() if self.includeExpunged is not None: oprot.writeFieldBegin('includeExpunged', TType.BOOL, 9) oprot.writeBool(self.includeExpunged) oprot.writeFieldEnd() if self.includeNoteApplicationDataFullMap is not None: oprot.writeFieldBegin('includeNoteApplicationDataFullMap', TType.BOOL, 10) oprot.writeBool(self.includeNoteApplicationDataFullMap) oprot.writeFieldEnd() if self.requireNoteContentClass is not None: oprot.writeFieldBegin('requireNoteContentClass', TType.STRING, 11) oprot.writeString(self.requireNoteContentClass.encode('utf-8')) oprot.writeFieldEnd() if self.includeResourceApplicationDataFullMap is not None: oprot.writeFieldBegin('includeResourceApplicationDataFullMap', TType.BOOL, 12) oprot.writeBool(self.includeResourceApplicationDataFullMap) oprot.writeFieldEnd() if self.includeNoteResourceApplicationDataFullMap is not None: oprot.writeFieldBegin('includeNoteResourceApplicationDataFullMap', TType.BOOL, 13) oprot.writeBool(self.includeNoteResourceApplicationDataFullMap) 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 NoteFilter(object): """ A list of criteria that are used to indicate which notes are desired from the account. This is used in queries to the NoteStore to determine which notes should be retrieved.
order
The NoteSortOrder value indicating what criterion should be used to sort the results of the filter.
ascending
If true, the results will be ascending in the requested sort order. If false, the results will be descending.
words
If present, a search query string that will filter the set of notes to be returned. Accepts the full search grammar documented in the Evernote API Overview.
notebookGuid
If present, the Guid of the notebook that must contain the notes.
tagGuids
If present, the list of tags (by GUID) that must be present on the notes.
timeZone
The zone ID for the user, which will be used to interpret any dates or times in the queries that do not include their desired zone information. For example, if a query requests notes created "yesterday", this will be evaluated from the provided time zone, if provided. The format must be encoded as a standard zone ID such as "America/Los_Angeles".
inactive
If true, then only notes that are not active (i.e. notes in the Trash) will be returned. Otherwise, only active notes will be returned. There is no way to find both active and inactive notes in a single query.
emphasized
If present, a search query string that may or may not influence the notes to be returned, both in terms of coverage as well as of order. Think of it as a wish list, not a requirement. Accepts the full search grammar documented in the Evernote API Overview.
Attributes: - order - ascending - words - notebookGuid - tagGuids - timeZone - inactive - emphasized """ thrift_spec = ( None, # 0 (1, TType.I32, 'order', None, None, ), # 1 (2, TType.BOOL, 'ascending', None, None, ), # 2 (3, TType.STRING, 'words', None, None, ), # 3 (4, TType.STRING, 'notebookGuid', None, None, ), # 4 (5, TType.LIST, 'tagGuids', (TType.STRING,None), None, ), # 5 (6, TType.STRING, 'timeZone', None, None, ), # 6 (7, TType.BOOL, 'inactive', None, None, ), # 7 (8, TType.STRING, 'emphasized', None, None, ), # 8 ) def __init__(self, order=None, ascending=None, words=None, notebookGuid=None, tagGuids=None, timeZone=None, inactive=None, emphasized=None,): self.order = order self.ascending = ascending self.words = words self.notebookGuid = notebookGuid self.tagGuids = tagGuids self.timeZone = timeZone self.inactive = inactive self.emphasized = emphasized def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.order = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: self.ascending = iprot.readBool(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.words = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.notebookGuid = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.tagGuids = [] (_etype80, _size77) = iprot.readListBegin() for _i81 in range(_size77): _elem82 = iprot.readString().decode('utf-8') self.tagGuids.append(_elem82) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.timeZone = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: self.inactive = iprot.readBool(); else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: self.emphasized = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteFilter') if self.order is not None: oprot.writeFieldBegin('order', TType.I32, 1) oprot.writeI32(self.order) oprot.writeFieldEnd() if self.ascending is not None: oprot.writeFieldBegin('ascending', TType.BOOL, 2) oprot.writeBool(self.ascending) oprot.writeFieldEnd() if self.words is not None: oprot.writeFieldBegin('words', TType.STRING, 3) oprot.writeString(self.words.encode('utf-8')) oprot.writeFieldEnd() if self.notebookGuid is not None: oprot.writeFieldBegin('notebookGuid', TType.STRING, 4) oprot.writeString(self.notebookGuid.encode('utf-8')) oprot.writeFieldEnd() if self.tagGuids is not None: oprot.writeFieldBegin('tagGuids', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.tagGuids)) for iter83 in self.tagGuids: oprot.writeString(iter83.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.timeZone is not None: oprot.writeFieldBegin('timeZone', TType.STRING, 6) oprot.writeString(self.timeZone.encode('utf-8')) oprot.writeFieldEnd() if self.inactive is not None: oprot.writeFieldBegin('inactive', TType.BOOL, 7) oprot.writeBool(self.inactive) oprot.writeFieldEnd() if self.emphasized is not None: oprot.writeFieldBegin('emphasized', TType.STRING, 8) oprot.writeString(self.emphasized.encode('utf-8')) 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 NoteList(object): """ A small structure for returning a list of notes out of a larger set.
startIndex
The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set.
totalNotes
The number of notes in the larger set. This can be used to calculate how many notes are "after" this note in the set. (I.e. remaining = totalNotes - (startIndex + notes.length) )
notes
The list of notes from this range. The Notes will include all metadata (attributes, resources, etc.), but will not include the ENML content of the note or the binary contents of any resources.
stoppedWords
If the NoteList was produced using a text based search query that included words that are not indexed or searched by the service, this will include a list of those ignored words.
searchedWords
If the NoteList was produced using a text based search query that included viable search words or quoted expressions, this will include a list of those words. Any stopped words will not be included in this list.
updateCount
Indicates the total number of transactions that have been committed within the account. This reflects (for example) the number of discrete additions or modifications that have been made to the data in this account (tags, notes, resources, etc.). This number is the "high water mark" for Update Sequence Numbers (USN) within the account.
Attributes: - startIndex - totalNotes - notes - stoppedWords - searchedWords - updateCount """ thrift_spec = ( None, # 0 (1, TType.I32, 'startIndex', None, None, ), # 1 (2, TType.I32, 'totalNotes', None, None, ), # 2 (3, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 3 (4, TType.LIST, 'stoppedWords', (TType.STRING,None), None, ), # 4 (5, TType.LIST, 'searchedWords', (TType.STRING,None), None, ), # 5 (6, TType.I32, 'updateCount', None, None, ), # 6 ) def __init__(self, startIndex=None, totalNotes=None, notes=None, stoppedWords=None, searchedWords=None, updateCount=None,): self.startIndex = startIndex self.totalNotes = totalNotes self.notes = notes self.stoppedWords = stoppedWords self.searchedWords = searchedWords self.updateCount = updateCount def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.startIndex = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.totalNotes = iprot.readI32(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.notes = [] (_etype87, _size84) = iprot.readListBegin() for _i88 in range(_size84): _elem89 = evernote.edam.type.ttypes.Note() _elem89.read(iprot) self.notes.append(_elem89) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.stoppedWords = [] (_etype93, _size90) = iprot.readListBegin() for _i94 in range(_size90): _elem95 = iprot.readString().decode('utf-8') self.stoppedWords.append(_elem95) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.searchedWords = [] (_etype99, _size96) = iprot.readListBegin() for _i100 in range(_size96): _elem101 = iprot.readString().decode('utf-8') self.searchedWords.append(_elem101) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: self.updateCount = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteList') if self.startIndex is not None: oprot.writeFieldBegin('startIndex', TType.I32, 1) oprot.writeI32(self.startIndex) oprot.writeFieldEnd() if self.totalNotes is not None: oprot.writeFieldBegin('totalNotes', TType.I32, 2) oprot.writeI32(self.totalNotes) oprot.writeFieldEnd() if self.notes is not None: oprot.writeFieldBegin('notes', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.notes)) for iter102 in self.notes: iter102.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.stoppedWords is not None: oprot.writeFieldBegin('stoppedWords', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.stoppedWords)) for iter103 in self.stoppedWords: oprot.writeString(iter103.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.searchedWords is not None: oprot.writeFieldBegin('searchedWords', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.searchedWords)) for iter104 in self.searchedWords: oprot.writeString(iter104.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.updateCount is not None: oprot.writeFieldBegin('updateCount', TType.I32, 6) oprot.writeI32(self.updateCount) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.startIndex is None: raise TProtocol.TProtocolException(message='Required field startIndex is unset!') if self.totalNotes is None: raise TProtocol.TProtocolException(message='Required field totalNotes is unset!') if self.notes is None: raise TProtocol.TProtocolException(message='Required field notes is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NoteMetadata(object): """ This structure is used in the set of results returned by the findNotesMetadata function. It represents the high-level information about a single Note, without some of the larger deep structure. This allows for the information about a list of Notes to be returned relatively quickly with less marshalling and data transfer to remote clients. Most fields in this structure are identical to the corresponding field in the Note structure, with the exception of:
largestResourceMime
If set, then this will contain the MIME type of the largest Resource (in bytes) within the Note. This may be useful, for example, to choose an appropriate icon or thumbnail to represent the Note.
largestResourceSize
If set, this will contain the size of the largest Resource file, in bytes, within the Note. This may be useful, for example, to decide whether to ask the server for a thumbnail to represent the Note.
Attributes: - guid - title - contentLength - created - updated - deleted - updateSequenceNum - notebookGuid - tagGuids - attributes - largestResourceMime - largestResourceSize """ thrift_spec = ( None, # 0 (1, TType.STRING, 'guid', None, None, ), # 1 (2, TType.STRING, 'title', None, None, ), # 2 None, # 3 None, # 4 (5, TType.I32, 'contentLength', None, None, ), # 5 (6, TType.I64, 'created', None, None, ), # 6 (7, TType.I64, 'updated', None, None, ), # 7 (8, TType.I64, 'deleted', None, None, ), # 8 None, # 9 (10, TType.I32, 'updateSequenceNum', None, None, ), # 10 (11, TType.STRING, 'notebookGuid', None, None, ), # 11 (12, TType.LIST, 'tagGuids', (TType.STRING,None), None, ), # 12 None, # 13 (14, TType.STRUCT, 'attributes', (evernote.edam.type.ttypes.NoteAttributes, evernote.edam.type.ttypes.NoteAttributes.thrift_spec), None, ), # 14 None, # 15 None, # 16 None, # 17 None, # 18 None, # 19 (20, TType.STRING, 'largestResourceMime', None, None, ), # 20 (21, TType.I32, 'largestResourceSize', None, None, ), # 21 ) def __init__(self, guid=None, title=None, contentLength=None, created=None, updated=None, deleted=None, updateSequenceNum=None, notebookGuid=None, tagGuids=None, attributes=None, largestResourceMime=None, largestResourceSize=None,): self.guid = guid self.title = title self.contentLength = contentLength self.created = created self.updated = updated self.deleted = deleted self.updateSequenceNum = updateSequenceNum self.notebookGuid = notebookGuid self.tagGuids = tagGuids self.attributes = attributes self.largestResourceMime = largestResourceMime self.largestResourceSize = largestResourceSize def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.guid = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.contentLength = iprot.readI32(); else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I64: self.created = iprot.readI64(); else: iprot.skip(ftype) elif fid == 7: if ftype == TType.I64: self.updated = iprot.readI64(); else: iprot.skip(ftype) elif fid == 8: if ftype == TType.I64: self.deleted = iprot.readI64(); else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: self.updateSequenceNum = iprot.readI32(); else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: self.notebookGuid = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 12: if ftype == TType.LIST: self.tagGuids = [] (_etype108, _size105) = iprot.readListBegin() for _i109 in range(_size105): _elem110 = iprot.readString().decode('utf-8') self.tagGuids.append(_elem110) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRUCT: self.attributes = evernote.edam.type.ttypes.NoteAttributes() self.attributes.read(iprot) else: iprot.skip(ftype) elif fid == 20: if ftype == TType.STRING: self.largestResourceMime = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 21: if ftype == TType.I32: self.largestResourceSize = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteMetadata') if self.guid is not None: oprot.writeFieldBegin('guid', TType.STRING, 1) oprot.writeString(self.guid.encode('utf-8')) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 2) oprot.writeString(self.title.encode('utf-8')) oprot.writeFieldEnd() if self.contentLength is not None: oprot.writeFieldBegin('contentLength', TType.I32, 5) oprot.writeI32(self.contentLength) oprot.writeFieldEnd() if self.created is not None: oprot.writeFieldBegin('created', TType.I64, 6) oprot.writeI64(self.created) oprot.writeFieldEnd() if self.updated is not None: oprot.writeFieldBegin('updated', TType.I64, 7) oprot.writeI64(self.updated) oprot.writeFieldEnd() if self.deleted is not None: oprot.writeFieldBegin('deleted', TType.I64, 8) oprot.writeI64(self.deleted) oprot.writeFieldEnd() if self.updateSequenceNum is not None: oprot.writeFieldBegin('updateSequenceNum', TType.I32, 10) oprot.writeI32(self.updateSequenceNum) oprot.writeFieldEnd() if self.notebookGuid is not None: oprot.writeFieldBegin('notebookGuid', TType.STRING, 11) oprot.writeString(self.notebookGuid.encode('utf-8')) oprot.writeFieldEnd() if self.tagGuids is not None: oprot.writeFieldBegin('tagGuids', TType.LIST, 12) oprot.writeListBegin(TType.STRING, len(self.tagGuids)) for iter111 in self.tagGuids: oprot.writeString(iter111.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.STRUCT, 14) self.attributes.write(oprot) oprot.writeFieldEnd() if self.largestResourceMime is not None: oprot.writeFieldBegin('largestResourceMime', TType.STRING, 20) oprot.writeString(self.largestResourceMime.encode('utf-8')) oprot.writeFieldEnd() if self.largestResourceSize is not None: oprot.writeFieldBegin('largestResourceSize', TType.I32, 21) oprot.writeI32(self.largestResourceSize) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.guid is None: raise TProtocol.TProtocolException(message='Required field guid is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NotesMetadataList(object): """ This structure is returned from calls to the findNotesMetadata function to give the high-level metadata about a subset of Notes that are found to match a specified NoteFilter in a search.
startIndex
The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set.
totalNotes
The number of notes in the larger set. This can be used to calculate how many notes are "after" this note in the set. (I.e. remaining = totalNotes - (startIndex + notes.length) )
notes
The list of metadata for Notes in this range. The set of optional fields that are set in each metadata structure will depend on the NotesMetadataResultSpec provided by the caller when the search was performed. Only the 'guid' field will be guaranteed to be set in each Note.
stoppedWords
If the NoteList was produced using a text based search query that included words that are not indexed or searched by the service, this will include a list of those ignored words.
searchedWords
If the NoteList was produced using a text based search query that included viable search words or quoted expressions, this will include a list of those words. Any stopped words will not be included in this list.
updateCount
Indicates the total number of transactions that have been committed within the account. This reflects (for example) the number of discrete additions or modifications that have been made to the data in this account (tags, notes, resources, etc.). This number is the "high water mark" for Update Sequence Numbers (USN) within the account.
Attributes: - startIndex - totalNotes - notes - stoppedWords - searchedWords - updateCount """ thrift_spec = ( None, # 0 (1, TType.I32, 'startIndex', None, None, ), # 1 (2, TType.I32, 'totalNotes', None, None, ), # 2 (3, TType.LIST, 'notes', (TType.STRUCT,(NoteMetadata, NoteMetadata.thrift_spec)), None, ), # 3 (4, TType.LIST, 'stoppedWords', (TType.STRING,None), None, ), # 4 (5, TType.LIST, 'searchedWords', (TType.STRING,None), None, ), # 5 (6, TType.I32, 'updateCount', None, None, ), # 6 ) def __init__(self, startIndex=None, totalNotes=None, notes=None, stoppedWords=None, searchedWords=None, updateCount=None,): self.startIndex = startIndex self.totalNotes = totalNotes self.notes = notes self.stoppedWords = stoppedWords self.searchedWords = searchedWords self.updateCount = updateCount def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.startIndex = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.totalNotes = iprot.readI32(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.notes = [] (_etype115, _size112) = iprot.readListBegin() for _i116 in range(_size112): _elem117 = NoteMetadata() _elem117.read(iprot) self.notes.append(_elem117) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.stoppedWords = [] (_etype121, _size118) = iprot.readListBegin() for _i122 in range(_size118): _elem123 = iprot.readString().decode('utf-8') self.stoppedWords.append(_elem123) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.searchedWords = [] (_etype127, _size124) = iprot.readListBegin() for _i128 in range(_size124): _elem129 = iprot.readString().decode('utf-8') self.searchedWords.append(_elem129) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: self.updateCount = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NotesMetadataList') if self.startIndex is not None: oprot.writeFieldBegin('startIndex', TType.I32, 1) oprot.writeI32(self.startIndex) oprot.writeFieldEnd() if self.totalNotes is not None: oprot.writeFieldBegin('totalNotes', TType.I32, 2) oprot.writeI32(self.totalNotes) oprot.writeFieldEnd() if self.notes is not None: oprot.writeFieldBegin('notes', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.notes)) for iter130 in self.notes: iter130.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.stoppedWords is not None: oprot.writeFieldBegin('stoppedWords', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.stoppedWords)) for iter131 in self.stoppedWords: oprot.writeString(iter131.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.searchedWords is not None: oprot.writeFieldBegin('searchedWords', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.searchedWords)) for iter132 in self.searchedWords: oprot.writeString(iter132.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.updateCount is not None: oprot.writeFieldBegin('updateCount', TType.I32, 6) oprot.writeI32(self.updateCount) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.startIndex is None: raise TProtocol.TProtocolException(message='Required field startIndex is unset!') if self.totalNotes is None: raise TProtocol.TProtocolException(message='Required field totalNotes is unset!') if self.notes is None: raise TProtocol.TProtocolException(message='Required field notes is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class NotesMetadataResultSpec(object): """ This structure is provided to the findNotesMetadata function to specify the subset of fields that should be included in each NoteMetadata element that is returned in the NotesMetadataList. Each field on this structure is a boolean flag that indicates whether the corresponding field should be included in the NoteMetadata structure when it is returned. For example, if the 'includeTitle' field is set on this structure when calling findNotesMetadata, then each NoteMetadata in the list should have its 'title' field set. If one of the fields in this spec is not set, then it will be treated as 'false' by the server, so the default behavior is to include nothing in replies (but the mandatory GUID) Attributes: - includeTitle - includeContentLength - includeCreated - includeUpdated - includeDeleted - includeUpdateSequenceNum - includeNotebookGuid - includeTagGuids - includeAttributes - includeLargestResourceMime - includeLargestResourceSize """ thrift_spec = ( None, # 0 None, # 1 (2, TType.BOOL, 'includeTitle', None, None, ), # 2 None, # 3 None, # 4 (5, TType.BOOL, 'includeContentLength', None, None, ), # 5 (6, TType.BOOL, 'includeCreated', None, None, ), # 6 (7, TType.BOOL, 'includeUpdated', None, None, ), # 7 (8, TType.BOOL, 'includeDeleted', None, None, ), # 8 None, # 9 (10, TType.BOOL, 'includeUpdateSequenceNum', None, None, ), # 10 (11, TType.BOOL, 'includeNotebookGuid', None, None, ), # 11 (12, TType.BOOL, 'includeTagGuids', None, None, ), # 12 None, # 13 (14, TType.BOOL, 'includeAttributes', None, None, ), # 14 None, # 15 None, # 16 None, # 17 None, # 18 None, # 19 (20, TType.BOOL, 'includeLargestResourceMime', None, None, ), # 20 (21, TType.BOOL, 'includeLargestResourceSize', None, None, ), # 21 ) def __init__(self, includeTitle=None, includeContentLength=None, includeCreated=None, includeUpdated=None, includeDeleted=None, includeUpdateSequenceNum=None, includeNotebookGuid=None, includeTagGuids=None, includeAttributes=None, includeLargestResourceMime=None, includeLargestResourceSize=None,): self.includeTitle = includeTitle self.includeContentLength = includeContentLength self.includeCreated = includeCreated self.includeUpdated = includeUpdated self.includeDeleted = includeDeleted self.includeUpdateSequenceNum = includeUpdateSequenceNum self.includeNotebookGuid = includeNotebookGuid self.includeTagGuids = includeTagGuids self.includeAttributes = includeAttributes self.includeLargestResourceMime = includeLargestResourceMime self.includeLargestResourceSize = includeLargestResourceSize def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 2: if ftype == TType.BOOL: self.includeTitle = iprot.readBool(); else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.includeContentLength = iprot.readBool(); else: iprot.skip(ftype) elif fid == 6: if ftype == TType.BOOL: self.includeCreated = iprot.readBool(); else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: self.includeUpdated = iprot.readBool(); else: iprot.skip(ftype) elif fid == 8: if ftype == TType.BOOL: self.includeDeleted = iprot.readBool(); else: iprot.skip(ftype) elif fid == 10: if ftype == TType.BOOL: self.includeUpdateSequenceNum = iprot.readBool(); else: iprot.skip(ftype) elif fid == 11: if ftype == TType.BOOL: self.includeNotebookGuid = iprot.readBool(); else: iprot.skip(ftype) elif fid == 12: if ftype == TType.BOOL: self.includeTagGuids = iprot.readBool(); else: iprot.skip(ftype) elif fid == 14: if ftype == TType.BOOL: self.includeAttributes = iprot.readBool(); else: iprot.skip(ftype) elif fid == 20: if ftype == TType.BOOL: self.includeLargestResourceMime = iprot.readBool(); else: iprot.skip(ftype) elif fid == 21: if ftype == TType.BOOL: self.includeLargestResourceSize = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NotesMetadataResultSpec') if self.includeTitle is not None: oprot.writeFieldBegin('includeTitle', TType.BOOL, 2) oprot.writeBool(self.includeTitle) oprot.writeFieldEnd() if self.includeContentLength is not None: oprot.writeFieldBegin('includeContentLength', TType.BOOL, 5) oprot.writeBool(self.includeContentLength) oprot.writeFieldEnd() if self.includeCreated is not None: oprot.writeFieldBegin('includeCreated', TType.BOOL, 6) oprot.writeBool(self.includeCreated) oprot.writeFieldEnd() if self.includeUpdated is not None: oprot.writeFieldBegin('includeUpdated', TType.BOOL, 7) oprot.writeBool(self.includeUpdated) oprot.writeFieldEnd() if self.includeDeleted is not None: oprot.writeFieldBegin('includeDeleted', TType.BOOL, 8) oprot.writeBool(self.includeDeleted) oprot.writeFieldEnd() if self.includeUpdateSequenceNum is not None: oprot.writeFieldBegin('includeUpdateSequenceNum', TType.BOOL, 10) oprot.writeBool(self.includeUpdateSequenceNum) oprot.writeFieldEnd() if self.includeNotebookGuid is not None: oprot.writeFieldBegin('includeNotebookGuid', TType.BOOL, 11) oprot.writeBool(self.includeNotebookGuid) oprot.writeFieldEnd() if self.includeTagGuids is not None: oprot.writeFieldBegin('includeTagGuids', TType.BOOL, 12) oprot.writeBool(self.includeTagGuids) oprot.writeFieldEnd() if self.includeAttributes is not None: oprot.writeFieldBegin('includeAttributes', TType.BOOL, 14) oprot.writeBool(self.includeAttributes) oprot.writeFieldEnd() if self.includeLargestResourceMime is not None: oprot.writeFieldBegin('includeLargestResourceMime', TType.BOOL, 20) oprot.writeBool(self.includeLargestResourceMime) oprot.writeFieldEnd() if self.includeLargestResourceSize is not None: oprot.writeFieldBegin('includeLargestResourceSize', TType.BOOL, 21) oprot.writeBool(self.includeLargestResourceSize) 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 NoteCollectionCounts(object): """ A data structure representing the number of notes for each notebook and tag with a non-zero set of applicable notes.
notebookCounts
A mapping from the Notebook GUID to the number of notes (from some selection) that are in the corresponding notebook.
tagCounts
A mapping from the Tag GUID to the number of notes (from some selection) that have the corresponding tag.
trashCount
If this is set, then this is the number of notes that are in the trash. If this is not set, then the number of notes in the trash hasn't been reported. (I.e. if there are no notes in the trash, this will be set to 0.)
Attributes: - notebookCounts - tagCounts - trashCount """ thrift_spec = ( None, # 0 (1, TType.MAP, 'notebookCounts', (TType.STRING,None,TType.I32,None), None, ), # 1 (2, TType.MAP, 'tagCounts', (TType.STRING,None,TType.I32,None), None, ), # 2 (3, TType.I32, 'trashCount', None, None, ), # 3 ) def __init__(self, notebookCounts=None, tagCounts=None, trashCount=None,): self.notebookCounts = notebookCounts self.tagCounts = tagCounts self.trashCount = trashCount def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: self.notebookCounts = {} (_ktype134, _vtype135, _size133 ) = iprot.readMapBegin() for _i137 in range(_size133): _key138 = iprot.readString().decode('utf-8') _val139 = iprot.readI32(); self.notebookCounts[_key138] = _val139 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.MAP: self.tagCounts = {} (_ktype141, _vtype142, _size140 ) = iprot.readMapBegin() for _i144 in range(_size140): _key145 = iprot.readString().decode('utf-8') _val146 = iprot.readI32(); self.tagCounts[_key145] = _val146 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.trashCount = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteCollectionCounts') if self.notebookCounts is not None: oprot.writeFieldBegin('notebookCounts', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.I32, len(self.notebookCounts)) for kiter147,viter148 in list(self.notebookCounts.items()): oprot.writeString(kiter147.encode('utf-8')) oprot.writeI32(viter148) oprot.writeMapEnd() oprot.writeFieldEnd() if self.tagCounts is not None: oprot.writeFieldBegin('tagCounts', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.I32, len(self.tagCounts)) for kiter149,viter150 in list(self.tagCounts.items()): oprot.writeString(kiter149.encode('utf-8')) oprot.writeI32(viter150) oprot.writeMapEnd() oprot.writeFieldEnd() if self.trashCount is not None: oprot.writeFieldBegin('trashCount', TType.I32, 3) oprot.writeI32(self.trashCount) 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 NoteEmailParameters(object): """ Parameters that must be given to the NoteStore emailNote call. These allow the caller to specify the note to send, the recipient addresses, etc.
guid
If set, this must be the GUID of a note within the user's account that should be retrieved from the service and sent as email. If not set, the 'note' field must be provided instead.
note
If the 'guid' field is not set, this field must be provided, including the full contents of the note note (and all of its Resources) to send. This can be used for a Note that as not been created in the service, for example by a local client with local notes.
toAddresses
If provided, this should contain a list of the SMTP email addresses that should be included in the "To:" line of the email. Callers must specify at least one "to" or "cc" email address.
ccAddresses
If provided, this should contain a list of the SMTP email addresses that should be included in the "Cc:" line of the email. Callers must specify at least one "to" or "cc" email address.
subject
If provided, this should contain the subject line of the email that will be sent. If not provided, the title of the note will be used as the subject of the email.
message
If provided, this is additional personal text that should be included into the email as a message from the owner to the recipient(s).
Attributes: - guid - note - toAddresses - ccAddresses - subject - message """ thrift_spec = ( None, # 0 (1, TType.STRING, 'guid', None, None, ), # 1 (2, TType.STRUCT, 'note', (evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec), None, ), # 2 (3, TType.LIST, 'toAddresses', (TType.STRING,None), None, ), # 3 (4, TType.LIST, 'ccAddresses', (TType.STRING,None), None, ), # 4 (5, TType.STRING, 'subject', None, None, ), # 5 (6, TType.STRING, 'message', None, None, ), # 6 ) def __init__(self, guid=None, note=None, toAddresses=None, ccAddresses=None, subject=None, message=None,): self.guid = guid self.note = note self.toAddresses = toAddresses self.ccAddresses = ccAddresses self.subject = subject self.message = message def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.guid = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.note = evernote.edam.type.ttypes.Note() self.note.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.toAddresses = [] (_etype154, _size151) = iprot.readListBegin() for _i155 in range(_size151): _elem156 = iprot.readString().decode('utf-8') self.toAddresses.append(_elem156) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.ccAddresses = [] (_etype160, _size157) = iprot.readListBegin() for _i161 in range(_size157): _elem162 = iprot.readString().decode('utf-8') self.ccAddresses.append(_elem162) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.subject = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.message = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteEmailParameters') if self.guid is not None: oprot.writeFieldBegin('guid', TType.STRING, 1) oprot.writeString(self.guid.encode('utf-8')) oprot.writeFieldEnd() if self.note is not None: oprot.writeFieldBegin('note', TType.STRUCT, 2) self.note.write(oprot) oprot.writeFieldEnd() if self.toAddresses is not None: oprot.writeFieldBegin('toAddresses', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.toAddresses)) for iter163 in self.toAddresses: oprot.writeString(iter163.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.ccAddresses is not None: oprot.writeFieldBegin('ccAddresses', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.ccAddresses)) for iter164 in self.ccAddresses: oprot.writeString(iter164.encode('utf-8')) oprot.writeListEnd() oprot.writeFieldEnd() if self.subject is not None: oprot.writeFieldBegin('subject', TType.STRING, 5) oprot.writeString(self.subject.encode('utf-8')) oprot.writeFieldEnd() if self.message is not None: oprot.writeFieldBegin('message', TType.STRING, 6) oprot.writeString(self.message.encode('utf-8')) 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 NoteVersionId(object): """ Identifying information about previous versions of a note that are backed up within Evernote's servers. Used in the return value of the listNoteVersions call.
updateSequenceNum
The update sequence number for the Note when it last had this content. This serves to uniquely identify each version of the note, since USN values are unique within an account for each update.
updated
The 'updated' time that was set on the Note when it had this version of the content. This is the user-modifiable modification time on the note, so it's not reliable for guaranteeing the order of various versions. (E.g. if someone modifies the note, then changes this time manually into the past and then updates the note again.)
saved
A timestamp that holds the date and time when this version of the note was backed up by Evernote's servers. This
title
The title of the note when this particular version was saved. (The current title of the note may differ from this value.)
Attributes: - updateSequenceNum - updated - saved - title """ thrift_spec = ( None, # 0 (1, TType.I32, 'updateSequenceNum', None, None, ), # 1 (2, TType.I64, 'updated', None, None, ), # 2 (3, TType.I64, 'saved', None, None, ), # 3 (4, TType.STRING, 'title', None, None, ), # 4 ) def __init__(self, updateSequenceNum=None, updated=None, saved=None, title=None,): self.updateSequenceNum = updateSequenceNum self.updated = updated self.saved = saved self.title = title def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.updateSequenceNum = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.updated = iprot.readI64(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.saved = iprot.readI64(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.title = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('NoteVersionId') if self.updateSequenceNum is not None: oprot.writeFieldBegin('updateSequenceNum', TType.I32, 1) oprot.writeI32(self.updateSequenceNum) oprot.writeFieldEnd() if self.updated is not None: oprot.writeFieldBegin('updated', TType.I64, 2) oprot.writeI64(self.updated) oprot.writeFieldEnd() if self.saved is not None: oprot.writeFieldBegin('saved', TType.I64, 3) oprot.writeI64(self.saved) oprot.writeFieldEnd() if self.title is not None: oprot.writeFieldBegin('title', TType.STRING, 4) oprot.writeString(self.title.encode('utf-8')) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.updateSequenceNum is None: raise TProtocol.TProtocolException(message='Required field updateSequenceNum is unset!') if self.updated is None: raise TProtocol.TProtocolException(message='Required field updated is unset!') if self.saved is None: raise TProtocol.TProtocolException(message='Required field saved is unset!') if self.title is None: raise TProtocol.TProtocolException(message='Required field title is unset!') return def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) class ClientUsageMetrics(object): """ This structure is passed from clients to the Evernote service when they wish to relay coarse-grained usage metrics to the service to help improve products.
sessions
This field contains a count of the number of usage "sessions" that have occurred with this client which have not previously been reported to the service. A "session" is defined as one of the 96 fifteen-minute intervals of the day when someone used Evernote's interface at least once. So if a user interacts with an Evernote client at 12:18, 12:24, and 12:36, and then the client synchronizes at 12:39, it would report that there were two previously-unreported sessions (one session for the 12:15-12:30 time period, and one for the 12:30-12:45 period). If the user used Evernote again at 12:41 and synchronized at 12:43, it would not report any new sessions, because the 12:30-12:45 session had already been reported.
Attributes: - sessions """ thrift_spec = ( None, # 0 (1, TType.I32, 'sessions', None, None, ), # 1 ) def __init__(self, sessions=None,): self.sessions = sessions def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.sessions = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('ClientUsageMetrics') if self.sessions is not None: oprot.writeFieldBegin('sessions', TType.I32, 1) oprot.writeI32(self.sessions) 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 RelatedQuery(object): """ A description of the thing for which we are searching for related entities. You must specify either noteGuid or plainText, but not both. filter and referenceUri are optional.
noteGuid
The GUID of an existing note in your account for which related entities will be found.
plainText
A string of plain text for which to find related entities. You should provide a text block with a number of characters between EDAM_RELATED_PLAINTEXT_LEN_MIN and EDAM_RELATED_PLAINTEXT_LEN_MAX.
filter
The list of criteria that will constrain the notes being considered related. Please note that some of the parameters may be ignored, such as order and ascending.
referenceUri
A URI string specifying a reference entity, around which "relatedness" should be based. This can be an URL pointing to a web page, for example.
Attributes: - noteGuid - plainText - filter - referenceUri """ thrift_spec = ( None, # 0 (1, TType.STRING, 'noteGuid', None, None, ), # 1 (2, TType.STRING, 'plainText', None, None, ), # 2 (3, TType.STRUCT, 'filter', (NoteFilter, NoteFilter.thrift_spec), None, ), # 3 (4, TType.STRING, 'referenceUri', None, None, ), # 4 ) def __init__(self, noteGuid=None, plainText=None, filter=None, referenceUri=None,): self.noteGuid = noteGuid self.plainText = plainText self.filter = filter self.referenceUri = referenceUri def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.noteGuid = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.plainText = iprot.readString().decode('utf-8') else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.filter = NoteFilter() self.filter.read(iprot) else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.referenceUri = iprot.readString().decode('utf-8') else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('RelatedQuery') if self.noteGuid is not None: oprot.writeFieldBegin('noteGuid', TType.STRING, 1) oprot.writeString(self.noteGuid.encode('utf-8')) oprot.writeFieldEnd() if self.plainText is not None: oprot.writeFieldBegin('plainText', TType.STRING, 2) oprot.writeString(self.plainText.encode('utf-8')) oprot.writeFieldEnd() if self.filter is not None: oprot.writeFieldBegin('filter', TType.STRUCT, 3) self.filter.write(oprot) oprot.writeFieldEnd() if self.referenceUri is not None: oprot.writeFieldBegin('referenceUri', TType.STRING, 4) oprot.writeString(self.referenceUri.encode('utf-8')) 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 RelatedResult(object): """ The result of calling findRelated(). The contents of the notes, notebooks, and tags fields will be in decreasing order of expected relevance. It is possible that fewer results than requested will be returned even if there are enough distinct entities in the account in cases where the relevance is estimated to be low.
notes
If notes have been requested to be included, this will be the list of notes.
notebooks
If notebooks have been requested to be included, this will be the list of notebooks.
tags
If tags have been requested to be included, this will be the list of tags.
containingNotebooks
If includeContainingNotebooks is set to true in the RelatedResultSpec, return the list of notebooks to to which the returned related notes belong. The notebooks in this list will occur once per notebook GUID and are represented as NotebookDescriptor objects.
Attributes: - notes - notebooks - tags - containingNotebooks """ thrift_spec = ( None, # 0 (1, TType.LIST, 'notes', (TType.STRUCT,(evernote.edam.type.ttypes.Note, evernote.edam.type.ttypes.Note.thrift_spec)), None, ), # 1 (2, TType.LIST, 'notebooks', (TType.STRUCT,(evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec)), None, ), # 2 (3, TType.LIST, 'tags', (TType.STRUCT,(evernote.edam.type.ttypes.Tag, evernote.edam.type.ttypes.Tag.thrift_spec)), None, ), # 3 (4, TType.LIST, 'containingNotebooks', (TType.STRUCT,(evernote.edam.type.ttypes.NotebookDescriptor, evernote.edam.type.ttypes.NotebookDescriptor.thrift_spec)), None, ), # 4 ) def __init__(self, notes=None, notebooks=None, tags=None, containingNotebooks=None,): self.notes = notes self.notebooks = notebooks self.tags = tags self.containingNotebooks = containingNotebooks def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.LIST: self.notes = [] (_etype168, _size165) = iprot.readListBegin() for _i169 in range(_size165): _elem170 = evernote.edam.type.ttypes.Note() _elem170.read(iprot) self.notes.append(_elem170) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.notebooks = [] (_etype174, _size171) = iprot.readListBegin() for _i175 in range(_size171): _elem176 = evernote.edam.type.ttypes.Notebook() _elem176.read(iprot) self.notebooks.append(_elem176) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.tags = [] (_etype180, _size177) = iprot.readListBegin() for _i181 in range(_size177): _elem182 = evernote.edam.type.ttypes.Tag() _elem182.read(iprot) self.tags.append(_elem182) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.containingNotebooks = [] (_etype186, _size183) = iprot.readListBegin() for _i187 in range(_size183): _elem188 = evernote.edam.type.ttypes.NotebookDescriptor() _elem188.read(iprot) self.containingNotebooks.append(_elem188) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('RelatedResult') if self.notes is not None: oprot.writeFieldBegin('notes', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.notes)) for iter189 in self.notes: iter189.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.notebooks is not None: oprot.writeFieldBegin('notebooks', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.notebooks)) for iter190 in self.notebooks: iter190.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.tags is not None: oprot.writeFieldBegin('tags', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.tags)) for iter191 in self.tags: iter191.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.containingNotebooks is not None: oprot.writeFieldBegin('containingNotebooks', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.containingNotebooks)) for iter192 in self.containingNotebooks: iter192.write(oprot) 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) class RelatedResultSpec(object): """ A description of the thing for which the service will find related entities, via findRelated(), together with a description of what type of entities and how many you are seeking in the RelatedResult.
maxNotes
Return notes that are related to the query, but no more than this many. Any value greater than EDAM_RELATED_MAX_NOTES will be silently capped. If you do not set this field, then no notes will be returned.
maxNotebooks
Return notebooks that are related to the query, but no more than this many. Any value greater than EDAM_RELATED_MAX_NOTEBOOKS will be silently capped. If you do not set this field, then no notebooks will be returned.
maxTags
Return tags that are related to the query, but no more than this many. Any value greater than EDAM_RELATED_MAX_TAGS will be silently capped. If you do not set this field, then no tags will be returned.
writableNotebooksOnly
Require that all returned related notebooks are writable. The user will be able to create notes in all returned notebooks. However, individual notes returned may still belong to notebooks in which the user lacks the ability to create notes.
includeContainingNotebooks
If set to true, return the containingNotebooks field in the RelatedResult, which will contain the list of notebooks to to which the returned related notes belong.
Attributes: - maxNotes - maxNotebooks - maxTags - writableNotebooksOnly - includeContainingNotebooks """ thrift_spec = ( None, # 0 (1, TType.I32, 'maxNotes', None, None, ), # 1 (2, TType.I32, 'maxNotebooks', None, None, ), # 2 (3, TType.I32, 'maxTags', None, None, ), # 3 (4, TType.BOOL, 'writableNotebooksOnly', None, None, ), # 4 (5, TType.BOOL, 'includeContainingNotebooks', None, None, ), # 5 ) def __init__(self, maxNotes=None, maxNotebooks=None, maxTags=None, writableNotebooksOnly=None, includeContainingNotebooks=None,): self.maxNotes = maxNotes self.maxNotebooks = maxNotebooks self.maxTags = maxTags self.writableNotebooksOnly = writableNotebooksOnly self.includeContainingNotebooks = includeContainingNotebooks def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: self.maxNotes = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.maxNotebooks = iprot.readI32(); else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.maxTags = iprot.readI32(); else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.writableNotebooksOnly = iprot.readBool(); else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.includeContainingNotebooks = iprot.readBool(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('RelatedResultSpec') if self.maxNotes is not None: oprot.writeFieldBegin('maxNotes', TType.I32, 1) oprot.writeI32(self.maxNotes) oprot.writeFieldEnd() if self.maxNotebooks is not None: oprot.writeFieldBegin('maxNotebooks', TType.I32, 2) oprot.writeI32(self.maxNotebooks) oprot.writeFieldEnd() if self.maxTags is not None: oprot.writeFieldBegin('maxTags', TType.I32, 3) oprot.writeI32(self.maxTags) oprot.writeFieldEnd() if self.writableNotebooksOnly is not None: oprot.writeFieldBegin('writableNotebooksOnly', TType.BOOL, 4) oprot.writeBool(self.writableNotebooksOnly) oprot.writeFieldEnd() if self.includeContainingNotebooks is not None: oprot.writeFieldBegin('includeContainingNotebooks', TType.BOOL, 5) oprot.writeBool(self.includeContainingNotebooks) 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) reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/notestore/__init__.py0000644000015301777760000000005712432702717030604 0ustar pbusernogroup00000000000000__all__ = ['ttypes', 'constants', 'NoteStore'] reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/notestore/constants.py0000644000015301777760000000041312432702717031055 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from .ttypes import * reminders-app-0.4+15.04.20141118/tests/autopilot/evernote/edam/notestore/NoteStore.py0000644000015301777760000301236712432702717031001 0ustar pbusernogroup00000000000000# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class Iface(object): def getSyncState(self, authenticationToken): """ Asks the NoteStore to provide information about the status of the user account corresponding to the provided authentication token. Parameters: - authenticationToken """ pass def getSyncStateWithMetrics(self, authenticationToken, clientMetrics): """ Asks the NoteStore to provide information about the status of the user account corresponding to the provided authentication token. This version of 'getSyncState' allows the client to upload coarse- grained usage metrics to the service. @param clientMetrics see the documentation of the ClientUsageMetrics structure for an explanation of the fields that clients can pass to the service. Parameters: - authenticationToken - clientMetrics """ pass def getSyncChunk(self, authenticationToken, afterUSN, maxEntries, fullSyncOnly): """ DEPRECATED - use getFilteredSyncChunk. Parameters: - authenticationToken - afterUSN - maxEntries - fullSyncOnly """ pass def getFilteredSyncChunk(self, authenticationToken, afterUSN, maxEntries, filter): """ Asks the NoteStore to provide the state of the account in order of last modification. This request retrieves one block of the server's state so that a client can make several small requests against a large account rather than getting the entire state in one big message. This call gives fine-grained control of the data that will be received by a client by omitting data elements that a client doesn't need. This may reduce network traffic and sync times. @param afterUSN The client can pass this value to ask only for objects that have been updated after a certain point. This allows the client to receive updates after its last checkpoint rather than doing a full synchronization on every pass. The default value of "0" indicates that the client wants to get objects from the start of the account. @param maxEntries The maximum number of modified objects that should be returned in the result SyncChunk. This can be used to limit the size of each individual message to be friendly for network transfer. @param filter The caller must set some of the flags in this structure to specify which data types should be returned during the synchronization. See the SyncChunkFilter structure for information on each flag. @throws EDAMUserException Parameters: - authenticationToken - afterUSN - maxEntries - filter """ pass def getLinkedNotebookSyncState(self, authenticationToken, linkedNotebook): """ Asks the NoteStore to provide information about the status of a linked notebook that has been shared with the caller, or that is public to the world. This will return a result that is similar to getSyncState, but may omit SyncState.uploaded if the caller doesn't have permission to write to the linked notebook. This function must be called on the shard that owns the referenced notebook. (I.e. the shardId in /shard/shardId/edam/note must be the same as LinkedNotebook.shardId.) @param authenticationToken This should be an authenticationToken for the guest who has received the invitation to the share. (I.e. this should not be the result of NoteStore.authenticateToSharedNotebook) @param linkedNotebook This structure should contain identifying information and permissions to access the notebook in question. Parameters: - authenticationToken - linkedNotebook """ pass def getLinkedNotebookSyncChunk(self, authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly): """ Asks the NoteStore to provide information about the contents of a linked notebook that has been shared with the caller, or that is public to the world. This will return a result that is similar to getSyncChunk, but will only contain entries that are visible to the caller. I.e. only that particular Notebook will be visible, along with its Notes, and Tags on those Notes. This function must be called on the shard that owns the referenced notebook. (I.e. the shardId in /shard/shardId/edam/note must be the same as LinkedNotebook.shardId.) @param authenticationToken This should be an authenticationToken for the guest who has received the invitation to the share. (I.e. this should not be the result of NoteStore.authenticateToSharedNotebook) @param linkedNotebook This structure should contain identifying information and permissions to access the notebook in question. This must contain the valid fields for either a shared notebook (e.g. shareKey) or a public notebook (e.g. username, uri) @param afterUSN The client can pass this value to ask only for objects that have been updated after a certain point. This allows the client to receive updates after its last checkpoint rather than doing a full synchronization on every pass. The default value of "0" indicates that the client wants to get objects from the start of the account. @param maxEntries The maximum number of modified objects that should be returned in the result SyncChunk. This can be used to limit the size of each individual message to be friendly for network transfer. Applications should not request more than 256 objects at a time, and must handle the case where the service returns less than the requested number of objects in a given request even though more objects are available on the service. @param fullSyncOnly If true, then the client only wants initial data for a full sync. In this case, the service will not return any expunged objects, and will not return any Resources, since these are also provided in their corresponding Notes. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - linkedNotebook - afterUSN - maxEntries - fullSyncOnly """ pass def listNotebooks(self, authenticationToken): """ Returns a list of all of the notebooks in the account. Parameters: - authenticationToken """ pass def getNotebook(self, authenticationToken, guid): """ Returns the current state of the notebook with the provided GUID. The notebook may be active or deleted (but not expunged). @param guid The GUID of the notebook to be retrieved. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - guid """ pass def getDefaultNotebook(self, authenticationToken): """ Returns the notebook that should be used to store new notes in the user's account when no other notebooks are specified. Parameters: - authenticationToken """ pass def createNotebook(self, authenticationToken, notebook): """ Asks the service to make a notebook with the provided name. @param notebook The desired fields for the notebook must be provided on this object. The name of the notebook must be set, and either the 'active' or 'defaultNotebook' fields may be set by the client at creation. If a notebook exists in the account with the same name (via case-insensitive compare), this will throw an EDAMUserException. @return The newly created Notebook. The server-side GUID will be saved in this object's 'guid' field. @throws EDAMUserException Parameters: - authenticationToken - notebook """ pass def updateNotebook(self, authenticationToken, notebook): """ Submits notebook changes to the service. The provided data must include the notebook's guid field for identification. @param notebook The notebook object containing the requested changes. @return The Update Sequence Number for this change within the account. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - notebook """ pass def expungeNotebook(self, authenticationToken, guid): """ Permanently removes the notebook from the user's account. After this action, the notebook is no longer available for undeletion, etc. If the notebook contains any Notes, they will be moved to the current default notebook and moved into the trash (i.e. Note.active=false).

NOTE: This function is generally not available to third party applications. Calls will result in an EDAMUserException with the error code PERMISSION_DENIED. @param guid The GUID of the notebook to delete. @return The Update Sequence Number for this change within the account. @throws EDAMUserException

Parameters: - authenticationToken - guid """ pass def listTags(self, authenticationToken): """ Returns a list of the tags in the account. Evernote does not support the undeletion of tags, so this will only include active tags. Parameters: - authenticationToken """ pass def listTagsByNotebook(self, authenticationToken, notebookGuid): """ Returns a list of the tags that are applied to at least one note within the provided notebook. If the notebook is public, the authenticationToken may be ignored. @param notebookGuid the GUID of the notebook to use to find tags @throws EDAMNotFoundException Parameters: - authenticationToken - notebookGuid """ pass def getTag(self, authenticationToken, guid): """ Returns the current state of the Tag with the provided GUID. @param guid The GUID of the tag to be retrieved. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - guid """ pass def createTag(self, authenticationToken, tag): """ Asks the service to make a tag with a set of information. @param tag The desired list of fields for the tag are specified in this object. The caller must specify the tag name, and may provide the parentGUID. @return The newly created Tag. The server-side GUID will be saved in this object. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - tag """ pass def updateTag(self, authenticationToken, tag): """ Submits tag changes to the service. The provided data must include the tag's guid field for identification. The service will apply updates to the following tag fields: name, parentGuid @param tag The tag object containing the requested changes. @return The Update Sequence Number for this change within the account. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - tag """ pass def untagAll(self, authenticationToken, guid): """ Removes the provided tag from every note that is currently tagged with this tag. If this operation is successful, the tag will still be in the account, but it will not be tagged on any notes. This function is not indended for use by full synchronizing clients, since it does not provide enough result information to the client to reconcile the local state without performing a follow-up sync from the service. This is intended for "thin clients" that need to efficiently support this as a UI operation. @param guid The GUID of the tag to remove from all notes. @throws EDAMUserException @throws EDAMNotFoundException Parameters: - authenticationToken - guid """ pass def expungeTag(self, authenticationToken, guid): """ Permanently deletes the tag with the provided GUID, if present.

NOTE: This function is generally not available to third party applications. Calls will result in an EDAMUserException with the error code PERMISSION_DENIED. @param guid The GUID of the tag to delete. @return The Update Sequence Number for this change within the account. @throws EDAMUserException

@throws EDAMNotFoundException Parameters: - authenticationToken - guid """ pass def listSearches(self, authenticationToken): """ Returns a list of the searches in the account. Evernote does not support the undeletion of searches, so this will only include active searches. Parameters: - authenticationToken """ pass def getSearch(self, authenticationToken, guid): """ Returns the current state of the search with the provided GUID. @param guid The GUID of the search to be retrieved. @throws EDAMUserException